Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock pgx versions all the way. #430

Merged
merged 1 commit into from
May 25, 2022
Merged

Lock pgx versions all the way. #430

merged 1 commit into from
May 25, 2022

Conversation

epgts
Copy link
Contributor

@epgts epgts commented May 25, 2022

Even to the patch level! Else we get:

`pgx-0.4.4` shouldn't be used with `cargo-pgx-0.4.5`,
please use `pgx = "~0.4.5"` in your `Cargo.toml`.

@epgts epgts requested a review from rtwalker May 25, 2022 13:40
@epgts epgts mentioned this pull request May 25, 2022
@rtwalker
Copy link
Contributor

thread 'main' panicked at 'cannot parse pgx version: Error("unexpected character '=' while parsing major version number")', tools/update-tester/src/installer.rs:107:10

Annnnd my get_pgx_version code from #418 is already not able to keep up

@rtwalker
Copy link
Contributor

Do you want to change

cargo["dependencies"]["pgx"]
.as_str()
.expect("expected pgx to only have a version")
.parse()
.expect("cannot parse pgx version")

to

    cargo["dependencies"]["pgx"]
        .as_str()
        .expect("expected pgx to only have a version")
        .trim_start_matches(&['=', '^', '~'])
        .parse()
        .expect("cannot parse pgx version")

Even to the patch level!  Else we get:

    `pgx-0.4.4` shouldn't be used with `cargo-pgx-0.4.5`,
    please use `pgx = "~0.4.5"` in your `Cargo.toml`.
@epgts
Copy link
Contributor Author

epgts commented May 25, 2022

    .trim_start_matches(&['=', '^', '~'])

Looks like it! Had to phrase it as ['=', '^', '~'].as_slice() though; &['a', 'b', 'c'] has type &[char; 3] when &[char] is required (the size is part of the array type).

@rtwalker
Copy link
Contributor

    .trim_start_matches(&['=', '^', '~'])

Looks like it! Had to phrase it as ['=', '^', '~'].as_slice() though; &['a', 'b', 'c'] has type &[char; 3] when &[char] is required (the size is part of the array type).

hmm weird? https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=2292f156968ec6d31468021a853aaf5d

@epgts
Copy link
Contributor Author

epgts commented May 25, 2022

hmm weird? https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=2292f156968ec6d31468021a853aaf5d

New compiler is more forgiving? ¯\_(ツ)_/¯

0 timescaledb-toolkit eg/specific-pgx% cat foo.rs                    
fn main() {
    assert_eq!("0.2.4".trim_start_matches(&['=', '^', '~']), "0.2.4");
}
0 timescaledb-toolkit eg/specific-pgx% rustc foo.rs            
error[E0277]: expected a `Fn<(char,)>` closure, found `[char; 3]`
 --> foo.rs:2:43
  |
2 |     assert_eq!("0.2.4".trim_start_matches(&['=', '^', '~']), "0.2.4");
  |                        ------------------ ^^^^^^^^^^^^^^^^ expected an `Fn<(char,)>` closure, found `[char; 3]`
  |                        |
  |                        required by a bound introduced by this call
  |
  = help: the trait `Fn<(char,)>` is not implemented for `[char; 3]`
  = note: required because of the requirements on the impl of `FnOnce<(char,)>` for `&[char; 3]`
  = note: required because of the requirements on the impl of `Pattern<'_>` for `&[char; 3]`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
1 timescaledb-toolkit eg/specific-pgx% rustc --version
rustc 1.57.0 (f1edd0429 2021-11-29)

@epgts
Copy link
Contributor Author

epgts commented May 25, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented May 25, 2022

Build succeeded:

@bors bors bot merged commit 5b30f5f into main May 25, 2022
@bors bors bot deleted the eg/specific-pgx branch May 25, 2022 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants