[Backport release-24.05] llvmPackages_{12,13,14,15,16,17,18,git}: Simplify argument passthrough#320234
Merged
Artturin merged 1 commit intorelease-24.05from Jun 19, 2024
Merged
Conversation
This patch is not intended to introduce any functional change. drvPaths
should remain unchanged; if they do change, it's a bug.
Prior to this patch, a set of packages gets passed through from the
llvmPackages top level function to the individual packages via
callPackages, which is a newScope constructed with some specific
arguments.
As it stands this makes it harder to override dependencies of LLVM; for
example take ncurses. If you want to override it, it is an argument to
libllvm, however, if you override libllvm you then have to write a lot
of code to have correctly overridden clang, given how llvmPackages is
previously composed (out of tools and libraries).
Instead, I propose to make sure that all the dependencies of all
llvmPackages are listed as an inputs to the top leve llvmPackages,
and then the resulting newScope will contain all of them. This in
turn will make `llvmPackages.override` work as expected for any
input to each of the llvm packages.
We'll achieve this by first simplifying the code a bit and ensuring that
all arguments to llvmPackage get forwarded to all packages (via
`{}@args`).
This represents a chance to simplify things a bit so I propose doing it
in two steps:
1. This patch: Simplify argument pass through.
2. (Later): Ensure all arguments to each llvm package are listed in the
top level `llvm/X/default.nix`.
Once the second patch lands, this means that `(llvmPackages.override {
ncurses = myncurses; }).clang` would consist of a clang whose libllvm
had the ncurses overridden. This is not the case prior to this patch.
Signed-off-by: Peter Waller <[email protected]>
(cherry picked from commit 8164fd6)
13 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bot-based backport to
release-24.05, triggered by a label in #307211.