#32 error: -g and -C debuginfo both provided
Closed: Fixed 6 years ago Opened 7 years ago by ignatenkobrain.

+ /usr/bin/cargo build --release -j8
   Compiling libc v0.2.21
     Running `/usr/bin/rustc --crate-name libc /usr/src/rust/libc-0.2.21/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C debuginfo=2 --cfg 'feature="use_std"' -C metadata=7e0d23df459df192 -C extra-filename=-7e0d23df459df192 --out-dir /builddir/build/BUILD/aho-corasick-0.6.3/target/release/deps -L dependency=/builddir/build/BUILD/aho-corasick-0.6.3/target/release/deps --cap-lints allow -Copt-level=3 -g -Clink-arg=-Wl,-z,relro,-z,now`
error: -g and -C debuginfo both provided

Looks like it's only case for libc.. Weird.

What's the top-level package you're building? Does it have [release] debuginfo in its Cargo.toml?

We may want to switch our distro flags to use -C debuginfo=2 anyway, as the more explicit form. It's annoying that rustc doesn't let that stack with plain -g though.

[profile.test]
debug = true

[profile.bench]
debug = true

[profile.release]
debug = true

OK, then yes, that "infects" the profile for all its dependencies too. Which is OK, since we do want debuginfo anyway, but we have to make the flags compatible.

@jistone shouldn't we just wipe all [profile.*] sections?

I'd rather not edit if we don't have to. Our chosen rustflags will take precedence anyway, except for this oddball -g incompatibility. I think it should be fine for our macros to use -C debuginfo=2.

@jistone mind sending patch for -g -> -C debuginfo=2 ?

OK, I will.

FWIW, this is new with cargo-0.17. Previously, [profile] debug would send -g, but cargo#3534 made it possible to choose the debuginfo level, with true now mapped to debuginfo=2.

This got fixed by 23b3342.

Metadata Update from @ignatenkobrain:
- Issue assigned to jistone
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

6 years ago

Login to comment on this ticket.

Metadata