-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
openvswitch: fix cross-compilation #68895
Closed
Closed
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
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.
/cc @Ericson2314
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.
Is
__splicedPackages
targetPackages?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.
Or in other words, what does this change fixes?
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.
openssl_1_0_2
is just a derivation, whereas__splicedPackages.openssl_1_0_2
is augmented with attributes referring to that derivation for other(host, target)
pairs. For example,__splicedPackages.openssl_1_0_2.nativeDrv
refers tobuildPackages.openssl_1_0_2
.See this comment for more detail: #68967 (comment)
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.
openvswitch/default.nix
refers toopenssl
in both.nativeBuildInputs
and.buildInputs
. In the case of cross-compilation,mkDerivation
accesses spliced attributes for elements of these lists. So, theopenssl
argument toopenvswitch/default.nix
must be spliced.callPackage
automatically uses spliced packages. However, the packages in scope intop-level/all-packages.nix
are not spliced. So, to pass in a splicedopenssl_1_0_2
, we must explicitly refer to__splicedPackages.openssl_1_0_2
.This may not be the best solution to cross-compiling this particular package, but similar situations appear throughout Nixpkgs. I think it's worth considering how we should be handling them.
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.
Ok. @Ericson2314 seems to prefer
buildPackages
though.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 agree with them. This case is a bit more complicated because
openvswitch
really takes two distinctopenssl
derivations as parameters, one for the build and one to link against, which are different in the case of cross compilation. They suggest what seems like the most sensible solution right now: #68900 (comment). That is, to explicitly allow the overriding of both derivations separately.