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

Crates publishing failed in v0.0.4 release #296

Closed
2 tasks done
greenhat opened this issue Aug 31, 2024 · 1 comment
Closed
2 tasks done

Crates publishing failed in v0.0.4 release #296

greenhat opened this issue Aug 31, 2024 · 1 comment

Comments

@greenhat
Copy link
Contributor

greenhat commented Aug 31, 2024

Log: https://github.com/0xPolygonMiden/compiler/actions/runs/10635422039/job/29484958422

Why

The version of the dependent crate (midenc-hir-analysis) was not bumped when the dependency crate was updated (midenc-session was bumped from v0.0.3 to v0.0.4).
This caused two midenc-session versions in the dependency tree, manifested with an error:

error[E0308]: mismatched types
   --> src/spill.rs:358:58
    |
358 |         let liveness = analyses.get_or_compute(function, session)?;
    |                                 --------------           ^^^^^^^ expected `Session`, found a different `Session`
    |                                 |
    |                                 arguments to this method are incorrect
    |
    = note: `Session` and `Session` have similar names, but are actually distinct types
note: `Session` is defined in crate `midenc_session`
   --> /Users/dzadorozhnyi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/midenc-session-0.0.4/src/lib.rs:79:1
    |
79  | pub struct Session {
    | ^^^^^^^^^^^^^^^^^^
note: `Session` is defined in crate `midenc_session`
   --> /Users/dzadorozhnyi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/midenc-session-0.0.3/src/lib.rs:79:1

Tasks

@greenhat
Copy link
Contributor Author

greenhat commented Sep 3, 2024

I think I found the reason for release-plz update to not bump the member's version when its dependency was bumped. A dependency is expected to have version key specified in the member's crate. I made an issue - MarcoIeni/release-plz#1649

The workaround is to specify the member's dependencies with the version key, which is not ideal. However, while I was looking into the issue, I found a better solution for our case. We can have a single version for all crates in the workspace specified via workspace.package.version and release-plz should it on any change in any member crate. Here is the explanation from the author - MarcoIeni/release-plz#1557 (comment) . Interestingly, the https://github.com/succinctlabs/sp1 are using this approach for their release process for a few months now.
I'm preparing #300 to use this approach and switch to a single version for all crates in the workspace.

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

No branches or pull requests

1 participant