bcc: remove refs to LLVM static libs that bloated closure (#562660)

This commit is contained in:
Winter
2026-09-28 12:23:26 +00:00
committed by GitHub

View File

@@ -16,6 +16,7 @@
nixosTests,
python3Packages,
readline,
removeReferencesTo,
replaceVars,
zip,
}:
@@ -55,6 +56,7 @@ python3Packages.buildPythonApplication rec {
flex
llvmPackages.llvm
makeWrapper
removeReferencesTo
zip
];
@@ -112,8 +114,17 @@ python3Packages.buildPythonApplication rec {
postFixup = ''
wrapPythonProgramsIn "$out/share/bcc/tools" "$out ''${pythonPath[*]}"
''
# Remove string refs to LLVM static libs that are unused at runtime and bloat closure by 2G
+ ''
remove-references-to -t ${lib.getLib llvmPackages.llvm} -t ${lib.getLib llvmPackages.libclang} $out/lib/libbcc.so.*
'';
disallowedReferences = [
(lib.getLib llvmPackages.llvm)
(lib.getLib llvmPackages.libclang)
];
outputs = [
"out"
"man"