From e02c9b5a018a6d868eafcbc8bcb483cddd4e6640 Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Sat, 26 Jul 2025 15:33:58 +0200 Subject: [PATCH] packaging: stop copying unnecessary boost libraries Originally, libboost_context and dependent dynamic libraries have been copied into the nix package to remove boost from the closure and consequently reduce the closure size. Since commit ef0de7c79f3b32f66db447220d26eae7e7c07b19 we do not depend on Boost coroutines any more, so these libraries are not needed at all any more and (somewhat ironically) only increase the package size. Remove them. Change-Id: I6a6a6964dc3e0b29dfad8b2b232b428ba3cc653c --- package.nix | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/package.nix b/package.nix index fa8fdc9c4..4e367fa96 100644 --- a/package.nix +++ b/package.nix @@ -387,30 +387,10 @@ stdenv.mkDerivation (finalAttrs: { cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; }; - preConfigure = - lib.optionalString (!finalAttrs.dontBuild && !hostPlatform.isStatic) '' - # Copy libboost_context so we don't get all of Boost in our closure. - # https://github.com/NixOS/nixpkgs/issues/45462 - mkdir -p $out/lib - cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib - rm -f $out/lib/*.a - '' - + lib.optionalString (!finalAttrs.dontBuild && hostPlatform.isLinux && !hostPlatform.isStatic) '' - chmod u+w $out/lib/*.so.* - patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.* - '' - + lib.optionalString (!finalAttrs.dontBuild && hostPlatform.isDarwin) '' - for LIB in $out/lib/*.dylib; do - chmod u+w $LIB - install_name_tool -id $LIB $LIB - install_name_tool -delete_rpath ${boost}/lib/ $LIB || true - done - install_name_tool -change ${boost}/lib/libboost_system.dylib $out/lib/libboost_system.dylib $out/lib/libboost_thread.dylib - '' - + '' - # Fix up /usr/bin/env shebangs relied on by the build - patchShebangs --build tests/ doc/manual/ - ''; + preConfigure = '' + # Fix up /usr/bin/env shebangs relied on by the build + patchShebangs --build tests/ doc/manual/ + ''; mesonBuildType = "debugoptimized"; @@ -454,14 +434,6 @@ stdenv.mkDerivation (finalAttrs: { mkdir -p $out/nix-support echo "file binary-dist $out/bin/nix" >> $out/nix-support/hydra-build-products '' - + lib.optionalString stdenv.isDarwin '' - for lib in liblixutil.dylib liblixexpr.dylib; do - install_name_tool \ - -change "${lib.getLib boost}/lib/libboost_context.dylib" \ - "$out/lib/libboost_context.dylib" \ - "$out/lib/$lib" - done - '' + lib.optionalString internalApiDocs '' mkdir -p $out/nix-support echo "doc internal-api-docs $out/share/doc/nix/internal-api/html" >> "$out/nix-support/hydra-build-products"