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

Packaging issue with v1.0.0-alpha.0 #1657

Closed
deweyjose opened this issue Aug 30, 2022 · 7 comments
Closed

Packaging issue with v1.0.0-alpha.0 #1657

deweyjose opened this issue Aug 30, 2022 · 7 comments
Assignees

Comments

@deweyjose
Copy link
Contributor

By default v1.0.0-alpha.0 does not compile. The dependency on router-bridge is incorrect - v0.1.0 instead of v0.1.0-alpha.1.

I updated my Cargo.toml to use 1v1.0.0-alpha.0

   Compiling apollo-router v1.0.0-alpha.0 (https://github.com/apollographql/router.git?tag=v1.0.0-alpha.0#d5e64069)
error[E0432]: unresolved import `router_bridge::planner::DeferStreamSupport`
 --> /Users/rj757l/.cargo/git/checkouts/router-18de2f110854a520/d5e6406/apollo-router/src/introspection.rs:6:5
  |
6 | use router_bridge::planner::DeferStreamSupport;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `DeferStreamSupport` in `planner`

error[E0432]: unresolved import `router_bridge::planner::DeferStreamSupport`
 --> /Users/rj757l/.cargo/git/checkouts/router-18de2f110854a520/d5e6406/apollo-router/src/query_planner/bridge_query_planner.rs:8:5
  |
8 | use router_bridge::planner::DeferStreamSupport;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `DeferStreamSupport` in `planner`

error[E0560]: struct `QueryPlannerConfig` has no field named `defer_stream_support`
  --> /Users/rj757l/.cargo/git/checkouts/router-18de2f110854a520/d5e6406/apollo-router/src/introspection.rs:61:17
   |
61 |                 defer_stream_support: Some(DeferStreamSupport {
   |                 ^^^^^^^^^^^^^^^^^^^^ `QueryPlannerConfig` does not have this field
   |
   = note: available fields are: `incremental_delivery`

error[E0560]: struct `QueryPlannerConfig` has no field named `defer_stream_support`
  --> /Users/rj757l/.cargo/git/checkouts/router-18de2f110854a520/d5e6406/apollo-router/src/query_planner/bridge_query_planner.rs:54:25
   |
54 |                         defer_stream_support: Some(DeferStreamSupport {
   |                         ^^^^^^^^^^^^^^^^^^^^ `QueryPlannerConfig` does not have this field
   |
   = note: available fields are: `incremental_delivery`

Projects generated by the apollo router scaffold also have this issue - v1.0.0-alpha.0 apollo-router depdencies with router-bridge v0.1.0 dependency.

I was able to work around this by updating the dependency manually:

cargo update -p router-bridge --precise 0.1.0-alpha.1

@abernix
Copy link
Member

abernix commented Aug 31, 2022

Interesting. Thanks for reporting this! This might have started happening after the 1.0.0-alpha.0 release since we published a non-alpha 0.1.0 yesterday (so about 18 hours back from when i'm writing this).

Does Rust's variation of semver automatically bump to 0.1.0 if the specifier was 0.1.0-alpha.1 or something?

@abernix abernix added this to the v1.0.0-alpha.1 milestone Aug 31, 2022
@Geal
Copy link
Contributor

Geal commented Aug 31, 2022

sorry, this is not very clear, could you show us your Cargo.toml so we know which dependencies you are importing? Are you using the router from the published tag or from a commit?

abernix added a commit to abernix/repo-apollographql-router-issue-1657 that referenced this issue Aug 31, 2022
@abernix
Copy link
Member

abernix commented Aug 31, 2022

I wasn't able to use cargo-scaffold because of my own reason but I was able to reproduce the above by merely copying the templates out of https://github.com/apollographql/router/tree/main/apollo-router-scaffold/templates/base and manually filling in the {{ handle bar templates }} in the two Cargo.toml files.

I pushed it up here: https://github.com/abernix/repo-apollographql-router-issue-1657

@Geal
Copy link
Contributor

Geal commented Aug 31, 2022

@deweyjose so this is an unfortunate consequence of semver matching in Cargo: 0.1.0-alpha.0 is compatible with 0.1.0, and Cargo dependencies that only specify a version allow the upgrade to another compatible version. Since the scaffolded project does not come with a Cargo.lock, cargo will take the highest available version.

This will be fixed in the next router release, which should happen in the next few days. In the meantime, if you specify the dependency on the router to this commit or any more recent commit, it will compile properly

@abernix abernix pinned this issue Aug 31, 2022
@abernix
Copy link
Member

abernix commented Sep 2, 2022

We believe this will be fixed when #1689 releases, which should be in the next hour or so. Thanks for your patience!

@abernix
Copy link
Member

abernix commented Sep 2, 2022

The v1.0.0-alpha.1 release is out — we hope this is resolved!

Using my reproduction — which used the cargo scaffold workflow — I had to run cargo update inside the xtask directory to bump the clap dependency, but it worked perfect after that:

@abernix abernix closed this as completed Sep 2, 2022
@abernix abernix removed the triage label Sep 2, 2022
@deweyjose
Copy link
Contributor Author

thanks all!

@abernix abernix unpinned this issue Sep 5, 2022
@abernix abernix self-assigned this Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants