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

Implicit features due to target-specific optional dependencies are not added in current version #369

Closed
obi1kenobi opened this issue Feb 16, 2023 · 3 comments · Fixed by #375
Assignees
Labels
C-bug Category: doesn't meet expectations

Comments

@obi1kenobi
Copy link
Owner

@obi1kenobi Upgrading to v0.18 results in a failing semver check despite this crate not having received any significant changes. Could you look into this?

Originally posted by @thomaseizinger in libp2p/rust-libp2p#3469 (comment)

Affected crate: libp2p_uds version 0.17, repro commit 5b4eab7bafe6cba8fea6c806027ea680662b7cc6

Its Cargo.toml contains the following block:

[target.'cfg(all(unix, not(target_os = "emscripten")))'.dependencies]
async-std = { version = "1.6.2", optional = true }
libp2p-core = { version = "0.38.0", path = "../../core" }
log = "0.4.1"
futures = "0.3.1"
tokio = { version = "1.15", default-features = false, features = ["net"], optional = true }

This implicitly defines features named async-std and tokio. These features are enabled in the baseline, but for some reason are not enabled in the "current":

[dependencies.libp2p-uds]
path = "/.../rust-libp2p/transports/uds"
features = []
default-features = false
@obi1kenobi
Copy link
Owner Author

@tonowak would you mind taking a look at this, since you're much more familiar with this code?

I'm surprised that our feature-detection code seems to detect different features when loading a crate's information via the registry (as in the baseline) versus from a local Cargo.toml manifest (as in the current version).

@obi1kenobi obi1kenobi added the C-bug Category: doesn't meet expectations label Feb 16, 2023
@tonowak tonowak self-assigned this Feb 18, 2023
tonowak added a commit to tonowak/cargo-semver-check that referenced this issue Feb 20, 2023
obi1kenobi pushed a commit that referenced this issue Feb 21, 2023
* Fix #369

* Added comment

* Fix CI

* Added test

* clippy
@obi1kenobi
Copy link
Owner Author

I'll release this in a patch version in the morning (my time), because releasing right before going to bed sounds like a recipe for staying up for half the night, just like deploying prod at 5pm on a Friday 😅

@obi1kenobi
Copy link
Owner Author

Released in https://github.com/obi1kenobi/cargo-semver-checks/releases/tag/v0.18.2 — sorry for the inconvenience and thanks for bearing with us while we fixed this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: doesn't meet expectations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants