Skip to content

Cfg dependencies are still required on excluded platforms #3233

@TheNeikos

Description

@TheNeikos

A simple use case:

Cargo.toml

[package]
name = "test"
version = "0.1.0"

[target.'cfg(windows)'.dependencies]
does_not_exist = 1

and

main.rs

fn main() {}

Will fail with this error on my linux machine:

    Updating registry `https://github.com/rust-lang/crates.io-index`
error: no matching package named `does_not_exist` found (required by `test`)
location searched: registry https://github.com/rust-lang/crates.io-index
version required: ^1

From what I gathered on the dependencies page is that it should be ignored as I did not run it on a linux machine.

Additional Info:

neikos@work ~> rustc -V
rustc 1.14.0-nightly (3caf63cc0 2016-10-24)
neikos@work ~> cargo -V
cargo 0.13.0-nightly (9a0801d 2016-10-20)

This was a question on SO, and it bugged me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions