Skip to content

[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
backport-307211-to-release-24.05
Jun 19, 2024
Merged

[Backport release-24.05] llvmPackages_{12,13,14,15,16,17,18,git}: Simplify argument passthrough#320234
Artturin merged 1 commit intorelease-24.05from
backport-307211-to-release-24.05

Conversation

@github-actions
Copy link
Contributor

Bot-based backport to release-24.05, triggered by a label in #307211.

  • Before merging, ensure that this backport is acceptable for the release.
    • Even as a non-commiter, if you find that it is not acceptable, leave a comment.

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)
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jun 16, 2024
@Artturin Artturin merged commit d15b2aa into release-24.05 Jun 19, 2024
@Artturin Artturin deleted the backport-307211-to-release-24.05 branch June 19, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants