dotnet: strip native symbols from runtime

This reduces the output size of dotnet_9.vmr from 4.2GiB to 1.9GiB.
This commit is contained in:
David McFarland 2024-03-09 17:32:31 -04:00
parent 445b240555
commit 75c085f6c2

View file

@ -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 \