dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.93k stars 4.64k forks source link

Remove system zlib packages from unix native dependencies #105373

Open carlossanlop opened 1 month ago

carlossanlop commented 1 month ago

Follow up of https://github.com/dotnet/runtime/pull/105371

We can't yet remove the system zlib packages from the package installation branches in install-native-dependencies.sh because we don't yet consume an SDK version that includes zlib-ng.

If we remove them from this script, and we attempt to run it in a new machine, then try to build runtime with:

eng/install-native-dependencies.sh
./build.sh clr+libs

We see this error:

cdac-build-tool -> /home/carlos/runtime/artifacts/bin/coreclr/linux.x64.Debug/cdac-build-tool/cdac-build-tool.dll
  /usr/bin/ld.bfd: cannot find -lz: No such file or directory
clang : error : linker command failed with exit code 1 (use -v to see invocation) [/home/carlos/runtime/src/native/managed/cdacreader/src/cdacreader.csproj]
/home/carlos/.nuget/packages/microsoft.dotnet.ilcompiler/9.0.0-preview.7.24371.6/build/Microsoft.NETCore.Native.targets(368,5): error MSB3073: The command ""clang" "/home/carlos/runtime/artifacts/obj/cdacreader/Debug/net9.0/linux-x64/native/libcdacreader.o" -o "/home/carlos/runtime/artifacts/bin/cdacreader/Debug/net9.0/linux-x64/native/libcdacreader.so" -Wl,--version-script=/home/carlos/runtime/artifacts/obj/cdacreader/Debug/net9.0/linux-x64/native/libcdacreader.exports -Wl,--export-dynamic -Wl,-soname=cdacreader.so -gz=zlib -fuse-ld=bfd /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-preview.7.24371.6/sdk/libbootstrapperdll.o /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-preview.7.24371.6/sdk/libRuntime.WorkstationGC.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-preview.7.24371.6/sdk/libeventpipe-disabled.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-preview.7.24371.6/sdk/libRuntime.VxsortEnabled.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-preview.7.24371.6/sdk/libstandalonegc-disabled.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-preview.7.24371.6/sdk/libstdc++compat.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-preview.7.24371.6/framework/libSystem.Native.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-preview.7.24371.6/framework/libSystem.IO.Compression.Native.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-preview.7.24371.6/framework/libSystem.Net.Security.Native.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-preview.7.24371.6/framework/libSystem.Security.Cryptography.Native.OpenSsl.a -g -Wl,-rpath,'$ORIGIN' -Wl,--build-id=sha1 -Wl,--as-needed -Wl,-e0x0 -pthread -ldl -lz -lrt -lm -shared -Wl,-z,relro -Wl,-z,now -Wl,--eh-frame-hdr -Wl,--discard-all -Wl,--gc-sections" exited with code 1. [/home/carlos/runtime/src/native/managed/cdacreader/src/cdacreader.csproj]

Once we start consuming an SDK version that includes zlib-ng, we can remove those 3 references from the script: zlib1g-dev, zlib-devel and zlib-dev.

https://github.com/dotnet/runtime/blob/c5b2dcd2967390a2ccc4546cdf3dbf5745d0b0d2/eng/install-native-dependencies.sh#L26-L33

And also remove mentions of zlib in the instructions:

https://github.com/dotnet/runtime/blob/main/docs/workflow/requirements/linux-requirements.md

dotnet-policy-service[bot] commented 1 month ago

Tagging subscribers to this area: @dotnet/runtime-infrastructure See info in area-owners.md if you want to be subscribed.

carlossanlop commented 1 month ago

Reopening as the PR was resubmitted: #105450