Skip to content

llvmPackages should be more easily overridable #375431

@LunNova

Description

@LunNova

llvmPackages doesn't support overrideScope so it's a pain to override its parts. If you override libllvm you need to manually override everything else that references it including patches. It's easy to accidentally allow a non-overridden copy of libllvm to sneak in.

Example of not-fun overriding lots of separate packages in https://github.com/NixOS/nixpkgs/blob/0f5740f6d9c3d0feb3da06e1da2383204fd6f92e/pkgs/development/rocm-modules/6/llvm/default.nix

There seems to be some support for overriding with .override but it's not clear how to use it. You can't use

llvmPackages.overrideScope (final: prev: {
libllvm = prev.libllvm.overrideAttrs { ... };
})

https://github.com/NixOS/nixpkgs/blob/0f5740f6d9c3d0feb3da06e1da2383204fd6f92e/pkgs/development/compilers/llvm/common/default.nix#L30-L34

cc @dtzWill @Ericson2314 @lovek323 @alyssais @RossComputerGuy @rrbutani @sternenseemann

Metadata

Metadata

Labels

0.kind: enhancementAdd something new or improve an existing system.6.topic: llvm/clangIssues related to llvmPackages, clangStdenv and related
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions