Cargo panics when building a proc-macro crate with build-std present in any parent .cargo/config.toml #8975
Labels
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
Z-build-std
Nightly: build-std
Problem
If you have a
.cargo/config.toml
file withbuild-std = ['std']
(and validtarget
), and you try to build a crate withproc-macro = true
, Cargo panics. This is only really a problem if that.cargo/config.toml
exists in some parent directory of the crate.Steps
cargo build
, orRUST_BACKTRACE=full cargo build
if you so desire.Possible Solution(s)
build-std
is not allowed forproc-macro
crates.build-std
forproc-macro
crates.build-std
forproc-macro
crates..cargo/config
settings through a newreset
config key #8687.Notes
Output of
cargo version
:cargo 1.50.0-nightly (d274fcf86 2020-12-07)
Backtrace: hastebin
My actual use case
I have a crate that targets
wasm32-unknown-unknown
, and I'd like to have a small child crate so I can use procedural macros. Since I'm using atomics in thewasm32
crate, I needbuild-std
. In this case, I will still most likely need something like #8687, so that I can reset therustflags
array. I'll probably just end up figuring out how to pull theproc-macro
crate up a level to get around this whole issue, but I figure a panic is still undesirable and at the very least can be turned into a helpful error message.The text was updated successfully, but these errors were encountered: