rust-analyzer: Autopublishing to crates.io is broken
Autopublishing has been broken since January. There were a few causes for this that have been fixed and at least one more to go. I probably should have raised an issue for this when I started looking into it, but better late than never. Some previous discussions on #14827 and https://github.com/pksunkara/cargo-workspaces/pull/92
The remaining (known) issue causes publishing to fail with:
failed to select a version for the requirement `ra_ap_mbe = "=0.0.154"`
candidate versions found which didn't match: 0.0.149, 0.0.148, 0.0.146, ...
location searched: crates.io index
required by package `ra_ap_cfg v0.0.154 (/home/runner/work/rust-analyzer/rust-analyzer/target/package/ra_ap_cfg-0.0.154)`
perhaps a crate was updated and forgotten to be re-vendored?
error: unable to publish package ra_ap_cfg
i.e. it’s trying to publish ra_ap_cfg, but can’t because ra_ap_mbe hasn’t been published yet. ra_ap_cfg has only a dev-dependency on ra_ap_mbe. We probably should just have the autopublish workflow remove all dev dependencies before it publishes. I’m currently looking for an existing tool to do that. If there isn’t one, then perhaps we can add something to cargo-workspaces. @pksunkara, do you have any thoughts as to whether something like that might belong in cargo-workspaces?
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 26 (26 by maintainers)
Yup, “publish upon merge into master if version in Cargo.toml is different” is the way to go.
We should only depend on crates.io versions of the crates anywhere. That means that changing these crates requires a chain of two PRs, but that’s Ok; that’s exactly the workflow one would use if these crates were in a separate repo.
To make this easier, we should pull all crates to top-level Cargo.toml, and use only
.workspace = truedependencies, ensuring that there’s only one place to patch dependencies.Looks like the relevant line is:
It then subsequently failed while trying to publish
ra_ap_base_db v0.0.161becausera_ap_vfs v0.0.161wasn’t available yet (it is now).The timeout warnings looks to have come from cargo, which has a 60 second timeout.
What I don’t understand, is why
cargo-workspacesdidn’t then wait for the new version to be available. It has a timeout of 300 seconds for the version to appear in the index, but as far as I can see from the logs, it never printed out “waiting…”, which makes it look as though it found the new version of the first check.As a dependent of
ra_ap_rust-analyzerand a bunch of its sibling crates: THANK YOU SO MUCH FOR FIXING THIS! 🙏Finally worked in https://github.com/rust-lang/rust-analyzer/actions/runs/5437937695.
Woohoo! Thanks for your patience and help everyone 😃
I think 4 is the right approach of managing dependencies.
We don’t really need to do that though.
icu4xkeepsyokein the repository itself but publishes it independently.