Open cho-m opened 5 days ago
Opening issue to align to the comment I updated in aptos
after looking into the issue
https://github.com/Homebrew/homebrew-core/blob/572efea83d28844a65079681915760edb4284b2d/Formula/a/aptos.rb#L42-L43
# FIXME: Look into a different way to specify extra RUSTFLAGS in superenv as they override .cargo/config.toml
# Ref: https://github.com/Homebrew/brew/blob/master/Library/Homebrew/extend/ENV/super.rb#L65
Specifically caused by superenv now setting RUSTFLAGS
which takes precedence over config file
https://github.com/Homebrew/brew/blob/3291ad4fc78f33f8e9bb7ce37745d2a0e697f5fb/Library/Homebrew/extend/ENV/super.rb#L65
I recall there was an ask in rust
or cargo
to introduce additive flags but can't find discussion right now. EDIT: https://github.com/rust-lang/cargo/issues/5376
Not sure what is best way to handle this to avoid manual workarounds (which increase formula maintenance to align with upstream) while also optimizing to specific microarchitecture.
ENV.no_rustflags
or something feels like the right fit here.
while also optimizing to specific microarchitecture.
To be clear: we're producing the same bottle regardless of where it's built, right?
To be clear: we're producing the same bottle regardless of where it's built, right?
Yes. Microarchitecture as in our superenv oldest CPU architecture (Core2 and Nehalem), not native arch.
Cargo issue was https://github.com/rust-lang/cargo/issues/5376. There doesn't seem to be a clean way to add extra RUSTFLAGS yet.
May need to be done via a rustc
shim instead.
May need to be done via a
rustc
shim instead.
Would ENV.no_rustflags
not work here to say "don't set RUSTFLAGS
"?
Would
ENV.no_rustflags
not work here to say "don't setRUSTFLAGS
"?
Using a shim may allow us to still pass in --codegen target-cpu=[core2 | nehalem | westmere]
and hopefully just work without extra modifications to the formula.
Yeah a rustc
shim seems to be ultimately what is necessary here and would directly align with how we handle C/C++. Debian uses a cargo
wrapper for as they similarly concluded RUSTFLAGS
to be useless.
They even went as far as ship it as a part of their cargo package: https://salsa.debian.org/rust-team/cargo/-/blob/debian/sid/debian/bin/cargo (we won't do this - just demonstrating how others have had to resort to wrappers too)
Shim is probably the easiest, and is kind of supported by the RUSTC_WRAPPER
environment variable: https://doc.rust-lang.org/cargo/reference/environment-variables.html
brew doctor
outputVerification
brew doctor
output" above saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
twice and am still able to reproduce my issue.brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.brew config
outputWhat were you trying to do (and why)?
Building bottle in CI, e.g. https://github.com/Homebrew/homebrew-core/pull/179360
What happened (include all command output)?
Failure when building due to overridden .cargo/config.toml:
What did you expect to happen?
Successful build without any extra workarounds.
Step-by-step reproduction instructions (by running
brew
commands)