Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
llvmPackages: Make targetLlvmLibraries overridable
Pull #320261 introduced the possibility to consistently override dependencies within an llvm package set. This is useful for development and testing exotic configurations. Go one step further and enable overriding targetLlvmLibraries. This makes it possible to write an overlay such as: ```nix overlays = [ (self: super: { llvmPackages = super.llvmPackages.override (prev: { targetLlvmLibraries = super.targetPackages.llvmPackages.libraries // { compiler-rt = super.targetPackages.llvmPackages.libraries.compiler-rt.override { ... } }; }); }) ]; ``` ... where the overridden compiler-rt will be used in a pkgsLLVM build. As a straw man, I've done the minimally invasive thing to the code structure: `targetLlvmLibraries` is not an explicitly named parameter for llvmPackages; but it is available in `packageSetArgs` if passed. This makes it slightly less discoverable, but this seems like a reasonable tradeoff considered that modifying this would be a fairly advanced/esoteric thing to need to do. In some ways it would be better to have as an explicit parameter with a default, but the obvious thing won't work because the default needs to be a non-trivial expression. Potentially we could instead have it as a defaulted parameter with the value of 'null', and if it's null, then compute the current thing. Signed-off-by: Peter Waller <[email protected]>
- Loading branch information