New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{cc,bintools}-wrapper: fix removal of unsupported hardening flags #38941
{cc,bintools}-wrapper: fix removal of unsupported hardening flags #38941
Conversation
@GrahamcOfBorg build stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.binutils |
Success on x86_64-linux (full log) Attempted: stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.binutils Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.binutils Partial log (click to expand)
|
@GrahamcOfBorg build stdenv |
Success on aarch64-linux (full log) Attempted: stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.binutils Partial log (click to expand)
|
Ugh. I made the mistake of thinking that the usual array indexing syntax would suffice, but that only applies when you’re doing something like parameter expansion (I.e. The takeaway is that if you’re using arrays with Thanks for catching this, @pbogdan. I’ll let any remaining borg runs complete, give @Ericson2314 a chance to indicate if he wants to look at it in the next couple hours, and then merge. |
Success on x86_64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Failure on x86_64-darwin (full log) Attempted: stdenv Partial log (click to expand)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured the stdenv build would probably timeout, but the bootPackages are fixed now so it's probably fine.
Success on aarch64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed I absolutely agree with you @cstrahan that "over-quoting" is best idiom given bash's insanity.
Thanks @pbogdan for catching and fixing this! |
Just FYI: this appears to break GHC on staging-
|
AFAICT first broken build is from prior to this change - https://hydra.nixos.org/build/72807800 I would expect that failure to be more related to the change of order in which the hardening flag are injected. Could be wrong though, also not sure what's the proper way to fix it :-( (patching GHC to drop -Wno-format for that file does produce a working build with no compilation warnings / errors). EDIT: to elaborate - IIUC prior to 0884027 |
Hmm I forgot about the order change. That was the one controversial part of @cstrahan's original PR IIRC---I wish we had landed the rest without that so we could just bikeshed that part separately. So either changing the order back (quite a can of worms), or adding the GHC patch is the right order. |
As I've said on other occasions IMHO builds should break if the build systems supplies flags that conflict with hardening flags, iff the specific hardening is not turned off. |
@globin you normally advocated hardening flags going last, right? Ironically it was lowering the priority of the hardening flags that caused the build to break. |
Motivation for this change
add-hardening.sh
is sourced withnullglob
in effect, this apparently causesunset -v hardeningEnableMap["$flag"]
to expand tounset -v
and the unsupported flags aren't removed as a result, causing build failures like so https://hydra.nixos.org/build/72810060/nixlog/1I only verified this change by injecting
set -x
into the bintools wrapper and inspecting the results, and rebuilding a small part of x86_64-{linux,darwin} stdenv.I'm also far from a bash expert so please review with that in mind.
/cc @Ericson2314 @cstrahan
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)