Closed
Description
STR
$ cargo new --bin hello && cd $_
$ mkdir .cargo
$ # this works
$ cat >.cargo/config <<'EOF'
[target.x86_64-unknown-linux-gnu]
runner = "true"
EOF
$ cargo run
Compiling hello v0.1.0 (file:///home/japaric/tmp/hello)
Finished dev [unoptimized + debuginfo] target(s) in 0.28s
Running `true target/debug/hello`
$ # this doesn't
$ cat >.cargo/config <<'EOF'
[target.'cfg(target_os = "linux")']
runner = "true"
EOF
$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.00s
Running `target/debug/hello`
Hello, world!
$ # however rustflags *are* accepted when set via `target.'cfg(..)'`
$ cat >.cargo/config <<'EOF'
[target.'cfg(target_os = "linux")']
rustflags = "--error"
EOF
$ cargo run
Compiling hello v0.1.0 (file:///home/japaric/tmp/hello)
error: Unrecognized option: 'error'
Meta
$ cargo -V
cargo 1.29.0-nightly (0ec7281b9 2018-08-20)
is there a reason why this doesn't work? or is it a bug? My use case is writing a single target.'cfg(..)'
instead of several individual target.$triple
settings.
Metadata
Metadata
Assignees
Labels
No labels