-
Notifications
You must be signed in to change notification settings - Fork 349
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
build-sys: Drop cxxbridge-cmd out of build-dependencies #1420
Conversation
Although maybe we could add a dummy/stub lib target to that? |
Or maybe reverting 58cd415 is the right thing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That warning by itself is not indicative of a problem to me. I would like to better understand how this ends up leading to the failure described in your link. Are you able to share any insight about that? What part of what cargo metadata
is emitting to you is causing anything to break?
The goal of cargo-vendor-filterer is to allow people who e.g. only want to build software for Linux to omit vendoring e.g. Windows dependencies. It uses It seems that |
I guess I am confused what the difference is between this "platform-specific" dependency and any other platform-specific dependency. Like if we replaced the 'cfg(any())' on this line with 'cfg(windows)' then |
I reproduced coreos/cargo-vendor-filterer#111 by running [dependencies]
cxx = "1"
[package.metadata.vendor-filter]
platforms = ["x86_64-unknown-linux-gnu"] and I observe that it's generating these two stub crates (among others): # vendor/windows-sys/Cargo.toml
[lib]
doctest = false
name = "windows_sys"
path = "src/lib.rs"
test = false
[package]
autobenches = false
autobins = false
autoexamples = false
autotests = false # vendor/cxxbridge-cmd/Cargo.toml
[package]
autobenches = false
autobins = false
autoexamples = false
autolib = false
autotests = false That seems like something to fix in The vendor/cxxbridge-cmd/Cargo.toml vendored instead by Can you please look into why the |
xref coreos/cargo-vendor-filterer#111 This was part of an attempt to avoid lockfile skew (which has bit me) but right now cargo says this is actually an invalid dependency: ``` $ cargo metadata --format-version=1 warning: cxx v1.0.136 (/var/home/walters/src/github/dtolnay/cxx) ignoring invalid dependency `cxxbridge-cmd` which is missing a lib target ``` Yet the problem appears to be that other times cargo doesn't ignore it.
7b7520d
to
9fcf58c
Compare
We could, but that doesn't feel to me like a clean fix. Couldn't cxxbridge-cmd equally well have a
That's part of the explicit list https://github.com/coreos/cargo-vendor-filterer/blob/c6bff717af03fac35c4b82fc9fc54dac3b6bb0f0/src/lib.rs#L29 It's important to go back to the start and understand how vendor-filterer works: It was spawned by this comment from a cargo maintainer: rust-lang/cargo#7058 (comment) Now, for sure I would say that the generated manifest here is broken, because we removed the I for sure could easily generate a |
This said, I guess we could change the logic for generating the stub crate to be: - If the project has a Still though, the more I think about this the more I feel like this is at heart a cargo bug. |
Ahh there's another wrinkle in this, which is cxxbridge-cmd sets Yes, cargo-vendor-filterer should clearly be setting |
➡️ coreos/cargo-vendor-filterer#114 Which does fix this, so there's less urgency to merge a fix on this side. That said, I do still think it probably makes sense to a fix either here or in cargo (possibly both) because we still have the core issue that |
I prefer for the issue to be fixed in cargo-vendor-filterer. You'll need that for artifact dependencies anyway. https://doc.rust-lang.org/1.84.0/cargo/reference/unstable.html#artifact-dependencies |
OK. But do you have an opinion on whether there's a cargo bug here? A different angle to look at this from is: what does it mean to have a Oh...now I see, you used this But surely this is effectively working around a cargo bug?
Hum, this one is interesting. So in theory maybe what we want here is some sort of "synthetic only" dependency to basically express "if this crate is in the build graph, it must match this version constraint" (but if not, ignore it) right?
? |
Cargo's behavior is fine in my opinion. I don't think adding a new kind of dependency, distinct from an unconditionally-disabled platform-specific dependency, would be justified. And once the artifact dependencies functionality is stable we'll switch to that. |
xref coreos/cargo-vendor-filterer#111
This was part of an attempt to avoid lockfile skew (which has bit me) but right now cargo says this is actually an invalid dependency:
Yet the problem appears to be that other times cargo doesn't ignore it.