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

libgit2-sys 0.13.3 version issue #838

Closed
chenrui333 opened this issue May 4, 2022 · 10 comments
Closed

libgit2-sys 0.13.3 version issue #838

chenrui333 opened this issue May 4, 2022 · 10 comments

Comments

@chenrui333
Copy link

chenrui333 commented May 4, 2022

It looks like the version scheme does not match what is specified in Cargo.toml

libgit2-sys = { path = "libgit2-sys", version = "0.13.3" }

This caused some build issue:

error: failed to select a version for the requirement `libgit2-sys = "^0.13.3"`
candidate versions found which didn't match: 0.13.2+1.4.2, 0.13.1+1.4.2, 0.13.0+1.4.1, ...
location searched: crates.io index
required by package `git2 v0.14.3`
@ehuss
Copy link
Contributor

ehuss commented May 4, 2022

You'll need at least Rust 1.60.

@joshtriplett Perhaps we should yank the release and move #833 to the next semver release (0.14)?

@chenrui333
Copy link
Author

noted about the rust 1.60.0
but i guess the semver issue might be still valid?

@joshtriplett
Copy link
Member

@ehuss Just libgit2-sys, not git2? That probably wouldn't be too disruptive, since people don't tend to depend on libgit2-sys directly and use its types.

However, I'm not sure that'd actually solve the problem. Wouldn't Cargo still fail to find a matching libgit2-sys for 0.14 just as it does for 0.13.3?

@ehuss
Copy link
Contributor

ehuss commented May 7, 2022

Nah, I think it would need to be both git2 and libgit2-sys.

Yanking isn't a full solution. If we make a new semver bump and a user tries to use git2 = "0.15" with an old rust version, it will run into the same issue.

This is one of the hazards of using this new syntax. My personal feeling is to wait at least a few months before switching to new stable things to reduce the likelihood of someone running into this kind of problem. But every project has its own guidelines.

@joshtriplett
Copy link
Member

git2 0.14 was already rather disruptive; I'm hoping we don't need to move to a new semver-breaking version anytime soon.

I can see another possibility that would eliminate this particular issue: we could yank the latest git2 crate, and upload a new version of git2 that uses weak dependency syntax in git2's Cargo.toml as well (even though it isn't strictly needed). That would avoid the problem of people seeing the new git2 but not the new libgit2-sys; any Cargo capable of finding the new git2 would also find its dependencies.

@qrilka
Copy link

qrilka commented May 18, 2022

I get the same issue with the latest git2-0.14.4:

error: failed to select a version for the requirement `libgit2-sys = "^0.13.4"`
candidate versions found which didn't match: 0.13.2+1.4.2, 0.13.1+1.4.2, 0.13.0+1.4.1, ...
location searched: crates.io index
required by package `git2 v0.14.4`

Is there any workaround for this? I just can't build a test project after just adding git2 = "0.14.4" into [dependencies]

@qrilka
Copy link

qrilka commented May 18, 2022

looks like using 0.14.2 resolves this problem but cargo-outdated fails because it tries out the latest version...

@joshtriplett
Copy link
Member

This issue manifests because libgit2-sys uses a new Cargo feature, so new versions of it aren't visible to old Cargo. While it won't help existing versions of Cargo, for future versions like this, ideally we should improve Cargo's handling of unknown versions, to detect if it encountered versions it didn't understand, and then report that you might want to upgrade Cargo. See rust-lang/cargo#10623 for discussion of that issue.

@alper
Copy link

alper commented Aug 19, 2022

I get:

error: failed to select a version for the requirement `libgit2-sys = "^0.14.0"`

Which is true, this version does not exist.

What's on there is: 0.14.0+1.5.0

See: https://crates.io/crates/libgit2-sys/versions

sharkdp added a commit to sharkdp/bat that referenced this issue Sep 3, 2022
Enselic pushed a commit to sharkdp/bat that referenced this issue Sep 4, 2022
@teliten
Copy link

teliten commented Sep 11, 2022

"w e're here"

and i mean, NEAR is almost the heart of "npm ... dash use rust instead ..."

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

6 participants