about summary refs log tree commit diff
path: root/pkgs/development/compilers/dotnet
diff options
context:
space:
mode:
authorDavid McFarland <corngood@gmail.com>2024-03-09 17:32:31 -0400
committerDavid McFarland <corngood@gmail.com>2024-03-09 17:33:41 -0400
commit75c085f6c22aac3d29a279f908b08be51b61a174 (patch)
tree0cd74adfc95d74531f07bb7e3f06734d2922254b /pkgs/development/compilers/dotnet
parent445b240555379492fa6ca5caf8b535a868249fda (diff)
downloadnixlib-75c085f6c22aac3d29a279f908b08be51b61a174.tar
nixlib-75c085f6c22aac3d29a279f908b08be51b61a174.tar.gz
nixlib-75c085f6c22aac3d29a279f908b08be51b61a174.tar.bz2
nixlib-75c085f6c22aac3d29a279f908b08be51b61a174.tar.lz
nixlib-75c085f6c22aac3d29a279f908b08be51b61a174.tar.xz
nixlib-75c085f6c22aac3d29a279f908b08be51b61a174.tar.zst
nixlib-75c085f6c22aac3d29a279f908b08be51b61a174.zip
dotnet: strip native symbols from runtime
This reduces the output size of dotnet_9.vmr from 4.2GiB to 1.9GiB.
Diffstat (limited to 'pkgs/development/compilers/dotnet')
-rw-r--r--pkgs/development/compilers/dotnet/vmr.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkgs/development/compilers/dotnet/vmr.nix b/pkgs/development/compilers/dotnet/vmr.nix
index 36b75c40e6c8..c51791e32484 100644
--- a/pkgs/development/compilers/dotnet/vmr.nix
+++ b/pkgs/development/compilers/dotnet/vmr.nix
@@ -187,6 +187,14 @@ in stdenv.mkDerivation rec {
     substituteInPlace \
       src/runtime/src/native/libs/CMakeLists.txt \
       --replace-fail 'add_compile_options(-Weverything)' 'add_compile_options(-Wall)'
+
+    # strip native symbols in runtime
+    # see: https://github.com/dotnet/source-build/issues/2543
+    xmlstarlet ed \
+      --inplace \
+      -s //Project -t elem -n PropertyGroup \
+      -s \$prev -t elem -n KeepNativeSymbols -v false \
+      src/runtime/Directory.Build.props
   ''
   + lib.optionalString isLinux ''
     substituteInPlace \