You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
If you have a .cargo/config.toml file with build-std = ['std'] (and valid target), and you try to build a crate with proc-macro = true, Cargo panics. This is only really a problem if that .cargo/config.toml exists in some parent directory of the crate.
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 the wasm32 crate, I need build-std. In this case, I will still most likely need something like #8687, so that I can reset the rustflags array. I'll probably just end up figuring out how to pull the proc-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:
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: