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

Dependency changes when building a self contained application in SDK version 8.0.303 to 8.0.401 #108354

Closed
MartBentNedap opened this issue Sep 24, 2024 · 15 comments
Assignees
Labels
arch-arm32 area-Infrastructure os-linux Linux OS (any supported distro)

Comments

@MartBentNedap
Copy link

Describe the bug

The library depedencies of our self-contained dotnet application change when building with version 8.0.401 instead of 8.0.303. As far as I can tell this should not be possible since it is a minor version change.

To Reproduce

We reproduce the issue by building our application with the follow command:

dotnet publish TestApplication/TestApplication.csproj -c Release -p:Version=$VERSION -o $CI_PROJECT_DIR/out/ -r linux-arm /p:PublishTrimmed=true --self-contained /p:PublishSingleFile=true -f net6.0

The docker image used is mcr.microsoft.com/dotnet/sdk:8.0. This image contains SDK version 8.0.401.

When running the application on our Linux device, we run into the following error:
./TestApplication: /lib/libc.so.6: version 'GLIBC_2.27' not found (required by ./TestApplication)

But when we build with image: mcr.microsoft.com/dotnet/sdk@sha256:e9f45219cca08134f09cb973de3e8364d5a22ad30dfff1343830003c6494a735 This error does NOT occur, this image uses SDK version 8.0.303.

It is not easily reproduce able since it is a non-public Linux distribution. Let me know if any more information is required.

Further technical details

  • output of uname -a on our device: Linux FX96006B9E16 4.9.182-rt131-yocto-standard dotnet/sdk#1 PREEMPT Mon Aug 14 11:47:31 IST 2023 armv7l GNU/Linux
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Sep 24, 2024
@tmds
Copy link
Member

tmds commented Sep 25, 2024

Per https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md#linux-compatibility arm32 needs glibc 2.35 or higher.

The glibc version on your Linux distribution doesn't meet that requirement, that's why the application fails to load when it tries to find a "GLIBC_2.27" versioned symbol.

This error does NOT occur, this image uses SDK version 8.0.303.

Something in the .NET build changed and now it is using a 2.27 glibc symbol.

This won't cause issues on glibc 2.35+ systems, but if glibc is below 2.27 the application won't run.

cc @richlander

@tmds
Copy link
Member

tmds commented Sep 25, 2024

-f net6.0

Since you are using 6.0, this should apply: https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md#linux-compatibility.

So the minimal required glibc version should be 2.23. The application that gets built shouldn't use a 2.27 glibc symbol.

@tmds
Copy link
Member

tmds commented Sep 25, 2024

@richlander it seems recent .NET 6.0 arm32 builds now require glibc 2.27, which is higher than the documented glibc version (v2.23)

@MartBent
Copy link

The whole reason we build for net6 is to prevent our linux distro from becoming incompatible. It seems odd that the application dependencies change when the SDK which is used to build the application is updated. Is this change intentional? We have no power over the linux distro that is used so this would mean that we must build our application with an outdated SDK version to keep it from breaking... @tmds

@tmds
Copy link
Member

tmds commented Sep 27, 2024

@jkotas the glibc version required by .NET 6 has changed. Do you have some insights why this happened?

@jkotas jkotas transferred this issue from dotnet/sdk Sep 28, 2024
@jkotas jkotas added arch-arm32 os-linux Linux OS (any supported distro) labels Sep 28, 2024
@jkotas
Copy link
Member

jkotas commented Sep 28, 2024

#103266 switched building linux-arm in release/6.0 branch from ubuntu-16.04-cross-20210719121212-8a8d3be to ubuntu-18.04-cross-arm-20220907130538-70ed2e8. It explains the bump in the minimal glibc version.

@amanasifkhalid Was this intentional change?

@amanasifkhalid
Copy link
Member

@amanasifkhalid Was this intentional change?

I don't think so. Looking at #75473, which is where the changes in #103266 were cherry-picked from, the distro version in eng/pipelines/common/templates/pipeline-with-resources.yml should probably match the version previously specified in eng/pipelines/common/platform-matrix.yml, though this version bump wasn't noticed at the time (sorry about that).

I've reverted the version bump locally, and kicked off an official build to see if it breaks anything, though I suspect it won't. I'll open a PR to fix the version bump once it passes.

@amanasifkhalid
Copy link
Member

#108396 has been merged. @MartBent are you ok with using an older SDK until the next release?

@MartBentNedap
Copy link
Author

Yes that is fine with me. Which version will include the fix? or will I get notified when it has been released?

@amanasifkhalid
Copy link
Member

The fix should be included in the .NET Runtime 6.0.36 release. If you'd like, I can ping you here once it's available.

@amanasifkhalid amanasifkhalid self-assigned this Oct 1, 2024
@MartBentNedap
Copy link
Author

That would be great! thanks for solving this in such a promptly manner.

@amanasifkhalid
Copy link
Member

Hi @MartBentNedap, just following up to let you know 6.0.36 is now available; you can download it from here. Please note that .NET 6 has reached end of support, though I'd appreciate it if you could report back here and let me know if your issue has been resolved with 6.0.36. Thanks!

@amanasifkhalid amanasifkhalid added the needs-author-action An issue or pull request that requires more info or actions from the author. label Nov 18, 2024
@MartBentNedap
Copy link
Author

Hi @MartBentNedap, just following up to let you know 6.0.36 is now available; you can download it from here. Please note that .NET 6 has reached end of support, though I'd appreciate it if you could report back here and let me know if your issue has been resolved with 6.0.36. Thanks!

We use docker image mcr.microsoft.com/dotnet/sdk:8.0 to build our application.
The output of of dotnet --list-sdks is: 8.0.404 [/usr/share/dotnet/sdk]

does this fix also apply for dotnet sdk 8.0.404? or am I missing something? we use the -f net6.0 flag to build the app

@dotnet-policy-service dotnet-policy-service bot removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Nov 19, 2024
@amanasifkhalid
Copy link
Member

amanasifkhalid commented Nov 19, 2024

does this fix also apply for dotnet sdk 8.0.404? or am I missing something? we use the -f net6.0 flag to build the app

Your SDK version should be fine for building with -f net6.0, but without updating your .NET 6 runtime version to 6.0.36, I would expect you to get the same error as above (./TestApplication: /lib/libc.so.6: version 'GLIBC_2.27' not found (required by ./TestApplication)) when you try to run your app. Could you please install the latest .NET 6 runtime, rerun your application, and let me know how it goes? Thanks!

@agocke agocke removed this from AppModel Nov 21, 2024
@MartBentNedap
Copy link
Author

does this fix also apply for dotnet sdk 8.0.404? or am I missing something? we use the -f net6.0 flag to build the app

Your SDK version should be fine for building with -f net6.0, but without updating your .NET 6 runtime version to 6.0.36, I would expect you to get the same error as above (./TestApplication: /lib/libc.so.6: version 'GLIBC_2.27' not found (required by ./TestApplication)) when you try to run your app. Could you please install the latest .NET 6 runtime, rerun your application, and let me know how it goes? Thanks!

I just tested the new runtime and the application now runs without any issues. So the issue is resolved for us. Thanks again for the quick reply and for fixing this issue.

@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-arm32 area-Infrastructure os-linux Linux OS (any supported distro)
Projects
Archived in project
Development

No branches or pull requests

5 participants