Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove system zlib packages from unix native dependencies #105373

Open
carlossanlop opened this issue Jul 24, 2024 · 2 comments · Fixed by #105419
Open

Remove system zlib packages from unix native dependencies #105373

carlossanlop opened this issue Jul 24, 2024 · 2 comments · Fixed by #105419
Assignees
Labels
area-Infrastructure in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@carlossanlop
Copy link
Member

carlossanlop commented Jul 24, 2024

Follow up of #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.

apt install -y build-essential gettext locales cmake llvm clang lldb liblldb-dev libunwind8-dev libicu-dev liblttng-ust-dev \
libssl-dev libkrb5-dev zlib1g-dev
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
elif [ "$ID" = "fedora" ]; then
dnf install -y cmake llvm lld lldb clang python curl libicu-devel openssl-devel krb5-devel zlib-devel lttng-ust-devel
elif [ "$ID" = "alpine" ]; then
apk add build-base cmake bash curl clang llvm-dev krb5-dev lttng-ust-dev icu-dev zlib-dev openssl-dev

And also remove mentions of zlib in the instructions:

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

Copy link
Contributor

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

@carlossanlop
Copy link
Member Author

Reopening as the PR was resubmitted: #105450

@carlossanlop carlossanlop reopened this Jul 25, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jul 25, 2024
@carlossanlop carlossanlop self-assigned this Jul 25, 2024
@carlossanlop carlossanlop added this to the 9.0.0 milestone Jul 25, 2024
@jeffschwMSFT jeffschwMSFT removed the untriaged New issue has not been triaged by the area owner label Jul 30, 2024
@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Aug 15, 2024
@agocke agocke modified the milestones: 9.0.0, 10.0.0 Aug 22, 2024
nil4 added a commit to royalapplications/royalvnc that referenced this issue Oct 21, 2024
Build with `ZLIB_COMPAT=yes` and deploy to `Sources/Z-win`

`zlib-ng` builds on Windows without baroque workarounds
- ref. dotnet/runtime#101465
- ref. dotnet/runtime#105373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Infrastructure in-pr There is an active PR which will close this issue when it is merged
Projects
Status: Done
3 participants