Skip to content

Builds failing due to semver violation in Zip #492

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

Closed
ddimaria opened this issue Apr 3, 2025 · 9 comments
Closed

Builds failing due to semver violation in Zip #492

ddimaria opened this issue Apr 3, 2025 · 9 comments

Comments

@ddimaria
Copy link

ddimaria commented Apr 3, 2025

Issue in Zip: zip-rs/zip2#332

The workaround is to fix calamine to version 2.5.0 of Zip in Cargo.toml.

@itaysmalia
Copy link

itaysmalia commented Apr 3, 2025

@ddimaria is there any workaround if I have a dependancy that uses calamine? how can I pin the version of zip? the [replace] section in Cargo.toml does not work:

[replace]
"zip:2.6.0" = { git = "https://github.com/zip-rs/zip2", rev = "v2.5.0" }

leads to:

error: failed to get `zip` as a dependency of package `calamine v0.26.1`
    ... which satisfies dependency `calamine = "^0.26.1"` (locked to 0.26.1) of package `nu-command v0.103.0`
    ... which satisfies dependency `nu-command = "^0.103.0"` (locked to 0.103.0) of package `XXX v0.1.0 (XXX)`

sorry if this is out of scope... asking that because of your workaround suggestion

@ddimaria
Copy link
Author

ddimaria commented Apr 3, 2025

@itaysmalia maybe try replacing the version number with the commit hash: 77cde6a. We're working on a fix and will post here when we have it.

@itaysmalia
Copy link

@itaysmalia maybe try replacing the version number with the commit hash: 77cde6a. We're working on a fix and will post here when we have it.

@ddimaria thanks!
I temporarily solved it using local git clone, steps here.

@ddimaria
Copy link
Author

ddimaria commented Apr 3, 2025

Fix if anyone needs it: zip-rs/zip2#332 (comment)

@prophittcorey
Copy link
Contributor

prophittcorey commented Apr 5, 2025

@tafia I opened a PR for the fix here: #497

KonishchevDmitry added a commit to KonishchevDmitry/investments that referenced this issue Apr 6, 2025
@iam888
Copy link

iam888 commented Apr 7, 2025

any progress?

@Stigmatized
Copy link

an other easier fix than cloning would be to just

cargo update -p zip --precise 2.5.0

@simnalamburt
Copy link
Contributor

simnalamburt commented Apr 18, 2025

For those who might be experiencing build issues, here’s a summary of possible workarounds:

1. Temporary solution

For now, doing the following fixes it:

$ cargo update -p zip --precise 2.5.0

But it'll break again if you run cargo update later.

2. Patch dependency version

# Cargo.toml
[patch.crates-io]
zip = { git = "https://github.com/zip-rs/zip2", tag = "v2.5.0" }

Due to a limitation in Cargo (rust-lang/cargo#5478), we unfortunately can’t use the crates.io index when changing dependency versions. As a result, we had to use the git protocol.

3. Patch dependency version (registry)

For those who prefer not to use the git:// protocol:

# Cargo.toml
[patch.crates-io]
zip = { version = "=2.5.0", registry = "crates-io-2" }
# .cargo/config.toml
[registries]
crates-io-2 = { index = "sparse+https://index.crates.io/" }
# Required due to https://github.com/rust-lang/cargo/issues/5478

This can lead to the same sub-dependency being downloaded from both crates-io and crates-io-2. It’s not a major issue to download the same dependency twice, but just be aware of it.

@iam888
Copy link

iam888 commented Apr 18, 2025

Is this project no longer maintained?

@tafia tafia closed this as completed Apr 21, 2025
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

8 participants
@iam888 @ddimaria @simnalamburt @Stigmatized @tafia @itaysmalia @prophittcorey and others