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

[release/9.0] Move UseSystemZlib into SetupOSSpecificProps #107770

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 12, 2024

Fixes #106566

Backport of #107666 to release/9.0

/cc @carlossanlop @hwoodiwiss

Customer Impact

  • Customer reported
  • Found internally

Regression

  • Yes
  • No

The recent infrastructure refactoring that switched runtime from consuming zlib to consuming our in-tree copy of zlib-ng introduced a regression where native aot publishing was not possible anymore due to a misplaced msbuild property that would prevent detecting libz.so in the expected location.

Repro:

  • OS: Ubuntu 24.04 x64
  • Uninstall system zlib: sudo apt remove zlib1g-dev
  • Install RC2 nightly: ./dotnet-install.sh -v 9.0.100-rc.2.24462.22
  • Confirm the use of the correct version of dotnet:
    dotnet --list-sdks
    9.0.100-rc.2.24462.22 [/home/carlos/.dotnet/sdk]
    
  • Create a console app: dotnet new console -o naot
  • Add <PublishAot>true</PublishAot> to the csproj
  • Run the publish command using: dotnet publish naot.csproj

This error shows up:

$ dotnet publish

Restore complete (0.9s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  naot failed with 2 error(s) (2.9s) → bin/Release/net9.0/linux-x64/naot.dll
    clang : error : linker command failed with exit code 1 (use -v to see invocation)
    /home/carlos/.nuget/packages/microsoft.dotnet.ilcompiler/9.0.0-rc.2.24459.11/build/Microsoft.NETCore.Native.targets(376,5): error MSB3073: The command ""clang" "obj/Release/net9.0/linux-x64/native/naot.o" -o "bin/Release/net9.0/linux-x64/native/naot" -Wl,--version-script=obj/Release/net9.0/linux-x64/native/naot.exports -Wl,--export-dynamic -gz=zlib -fuse-ld=bfd /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-rc.2.24459.11/sdk/libbootstrapper.o /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-rc.2.24459.11/sdk/libRuntime.WorkstationGC.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-rc.2.24459.11/sdk/libeventpipe-disabled.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-rc.2.24459.11/sdk/libRuntime.VxsortEnabled.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-rc.2.24459.11/sdk/libstandalonegc-disabled.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-rc.2.24459.11/sdk/libstdc++compat.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-rc.2.24459.11/framework/libSystem.Native.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-rc.2.24459.11/framework/libSystem.Globalization.Native.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-rc.2.24459.11/framework/libSystem.IO.Compression.Native.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-rc.2.24459.11/framework/libSystem.Net.Security.Native.a /home/carlos/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.0-rc.2.24459.11/framework/libSystem.Security.Cryptography.Native.OpenSsl.a -g -Wl,-rpath,'$ORIGIN' -Wl,--build-id=sha1 -Wl,--as-needed -pthread -ldl -lz -lrt -lm -pie -Wl,-pie -Wl,-z,relro -Wl,-z,now -Wl,--eh-frame-hdr -Wl,--discard-all -Wl,--gc-sections" exited with code 1.

Build failed with 2 error(s) in 4.0s

Testing

  • Edit the same file this PR is fixing and add move the property to the new location: /home/carlos/.nuget/packages/microsoft.dotnet.ilcompiler/9.0.0-rc.2.24459.11/build/Microsoft.NETCore.Native.Unix.targets
  • Delete the obj/ and bin/ folders.
  • Run dotnet publish naot.csproj again.
  • Success:
    $ dotnet publish
    Restore complete (0.8s)
    You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
      naot succeeded (3.4s) → bin/Release/net9.0/linux-x64/publish/
    
    Build succeeded in 4.4s
    

Risk

Low: This affects the specific case of publishing with NativeAOT.

@carlossanlop carlossanlop added the Servicing-approved Approved for servicing release label Sep 12, 2024
Copy link
Member

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Treating as tell-mode.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants