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

cargo build failed on non-related platform dependency #8848

Closed
cathay4t opened this issue Nov 10, 2020 · 2 comments
Closed

cargo build failed on non-related platform dependency #8848

cathay4t opened this issue Nov 10, 2020 · 2 comments
Labels
C-bug Category: bug

Comments

@cathay4t
Copy link

Problem

The cargo vendor will include all dependency regardless platform. After removed the windows dependency,
the cargo build will fail on missing dependency even compiling on unix.

Steps

cargo new bug_test
cd bug_test
mkdir .cargo
echo '[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"' > .cargo/config

echo '[target."cfg(windows)".dependencies.winapi]
version = "0.3"' >> Cargo.toml
cargo build

Possible Solution(s)

No idea

Notes

Output of cargo version: cargo 1.47.0 (f3c7e06 2020-08-28)

@cathay4t cathay4t added the C-bug Category: bug label Nov 10, 2020
@cathay4t
Copy link
Author

cathay4t commented Nov 10, 2020

This might related to #7058 where people are requesting cargo vendor --platform unix.

@ehuss
Copy link
Contributor

ehuss commented Nov 10, 2020

Yea, I'm going to close this as a duplicate of #7058 (and related to #5133). The resolver needs all dependencies regardless of platform, so it is expected that it will fail.

@ehuss ehuss closed this as completed Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants