-
Notifications
You must be signed in to change notification settings - Fork 238
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
x509-system: use /usr/bin/security on macOS. #974
x509-system: use /usr/bin/security on macOS. #974
Conversation
This mirrors the workaround in nixpkgs for haskellPackages. ref: NixOS/nixpkgs#47676
# https://github.com/NixOS/nixpkgs/pull/47676 | ||
# https://github.com/NixOS/nixpkgs/issues/45042 | ||
x509-system.components.library.preBuild = "substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security"; |
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.
Does this work if x509-system
isn't in the package set?
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'm using this in a temporary fork to build all kinds of packages, including some non-Stack projects. (It's Stack that pulls in x509-system
100%.)
My expectation was that this expression wouldn't be evaluated unless the package set includes x509-system
.
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.
Cool. I actually just don't know what the module system will do with this. e.g. I could imagine it complaining that x509-system
wasn't defined or something.
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.
For me, the real question about this PR is whether the conditional that guards the override is correct. In nixpkgs
, my understanding is that you just need to use stdenv.isDarwin
and that does the right thing for native builds and cross. But I get the impression (having not tried it myself) that cross-compiles are more complicated in haskell.nix, so it would be good to have someone who knows that stuff take a look at this PR.
There is also the complication that in nixpkgs
, the equivalent code checks for !pkgs.stdenv.cc.nativeLibc
, which I have mimicked here, but I confess that I don't understand why that's necessary:
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.
We use stdenv.isDarwin
all over the place, so I'm fairly confident that this is going to be okay. I have no idea about the nativeLibc
thing, but I'm happy if we're copying it from nixpkgs.
I was about to ask if we should make a note to await the "proper fix" mentioned in the issue, and then I saw it was from 2018 😅
bors try |
tryBuild succeeded: |
Looks good, thanks for this! |
This mirrors the workaround in nixpkgs for haskellPackages. ref: NixOS/nixpkgs#47676
This mirrors the workaround in nixpkgs for haskellPackages.
ref: NixOS/nixpkgs#47676