Skip to content

runner setting is ignored when set via target.cfg(..) #5946

Closed
@japaric

Description

@japaric

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

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