-
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
Merged
michaelpj
merged 1 commit into
input-output-hk:master
from
hackworthltd:macos-x509-system
Dec 16, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
final: prev: { | ||
|
||
} | ||
final: prev: | ||
{ | ||
haskell-nix = prev.haskell-nix // ({ | ||
defaultModules = prev.haskell-nix.defaultModules ++ [ | ||
({ pkgs, buildModules, config, lib, ... }: | ||
{ | ||
packages = { } // pkgs.lib.optionalAttrs (pkgs.stdenv.hostPlatform.isDarwin && !pkgs.stdenv.cc.nativeLibc) | ||
{ | ||
# Workaround for broken nixpkgs darwin.security_tool in | ||
# Mojave. This mirrors the workaround in nixpkgs | ||
# haskellPackages. | ||
# | ||
# ref: | ||
# 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"; | ||
}; | ||
}) | ||
]; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 usestdenv.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:https://github.com/NixOS/nixpkgs/blob/50863eb06c8f2f3397fa4cf0129a62047fbb765c/pkgs/development/haskell-modules/configuration-nix.nix#L160
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 thenativeLibc
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 😅