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
Refactor gccForLibs so gcc isn't inadvertently compiled #100686
Conversation
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.
Please fix the eval error. Maybe a rebase helps?
I’m not doing any more nix work on my work machine (which is presently the only active Mac computer I have). The team I work with decided to stop using nix due to the difficulty of learning it and broken packages (primarily halide and nix-xcodeenv) I encountered with the proof of concept. Two people also heard a horror story and negative feedback from their networks as well that seemed to line up with my experience. |
I guess this can be closed then? |
Well, I have a personal mac now, but I don't understand the error. I don't see anywhere that I used anything called restrict-eval? |
@ofborg eval |
# with gcc-7: undefined reference to `__divmoddi4' | ||
if stdenv.targetPlatform.isi686 | ||
then gcc6.cc | ||
else if stdenv.targetPlatform == stdenv.hostPlatform && targetPackages.stdenv.cc.isGNU | ||
# Can only do this is in the native case, otherwise we might get infinite | ||
# recursion if `targetPackages.stdenv.cc.cc` itself uses `gccForLibs`. | ||
then targetPackages.stdenv.cc.cc | ||
else gcc.cc; | ||
else gcc.cc | ||
else null; |
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 think this is causing the eval error. The package should never be null.
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.
Got it, that's tricky. Would the idiomatic thing be to mark gcc as broken and then check for that rather than its nullness?
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.
Marking something broken based on targetPlatform sounds weird to me.
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.
Well, as far as I know, that is what's going on - gcc is broken on macOS. Or at least, that's what I thought back in October...
PR #110101 may supercede this. Both fixes in that are required for iOS to work (bootstrap?). The gccForLibs change has a similar effect as this one, it's just simpler. |
Let's land #110251, and then revisit this. I think the way the conditions are written can be improved, but after I broke things on the last attempt, I want to do this in multiple steps. |
OK #110251 is merged. I agree with @SuperSandro2000 that the package shouldn't be null on the top level. But cc-wrapper should be smarter about "gcc for libgcc and friends" vs "gcc for libstdc++". If you want to take a stab at that, that would be much appreciated! |
I marked this as stale due to inactivity. → More info |
Motivation for this change
(I believe) gccForLibs was written in such a way that it would pull in GCC on darwin. This change is from a few days ago, and I'm relatively new to nix.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)