Skip to content

Update Alpine versions - #4556

Closed
richlander wants to merge 3 commits into
mainfrom
alpine-eol
Closed

richlander wants to merge 3 commits into
mainfrom
alpine-eol

Conversation

@richlander

Copy link
Copy Markdown
Member
  • Alpine 3.13 is EOL.
  • alpine-3.19-WithNode is the next versions where we have a container image. That's likely good enough.

@mikem8361

Copy link
Copy Markdown
Contributor

Looks like the new image doesn't have the latest clang. There are build errors in the linux musl Build Native leg even through it looks like it succeeded (some problem in our infrastructure).

@richlander

richlander commented Mar 19, 2024 •

Copy link
Copy Markdown
Member Author

Are you sure that's the problem? This is what I see.

rich@mazama:~$ docker run --rm mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.13-WithNode clang --version
Alpine clang version 10.0.1 
Target: x86_64-alpine-linux-musl
Thread model: posix
InstalledDir: /usr/bin
rich@mazama:~$ docker run --rm mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.19-WithNode clang --version
Alpine clang version 17.0.5
Target: x86_64-alpine-linux-musl
Thread model: posix
InstalledDir: /usr/bin
Configuration file: /etc/clang17/x86_64-alpine-linux-musl.cfg

@mikem8361

Copy link
Copy Markdown
Contributor

I assumed it was something about the clang version because the alpine legs are failing like this:

[ 36%] Building CXX object src/shared/pal/src/CMakeFiles/coreclrpal.dir/init/sxs.cpp.o
/__w/1/s/src/shared/pal/src/init/pal.cpp:249:24: error: no matching function for call to 'InterlockedCompareExchangePointerT'
  249 |             if(NULL != InterlockedCompareExchangePointer(&init_critsec, &temp_critsec, NULL))
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/__w/1/s/src/shared/pal/src/include/pal/palinternal.h:725:43: note: expanded from macro 'InterlockedCompareExchangePointer'
  725 | #define InterlockedCompareExchangePointer InterlockedCompareExchangePointerT
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/__w/1/s/src/shared/pal/src/include/pal/palinternal.h:713:11: note: candidate function template not viable: no known conversion from 'std::nullptr_t' to 'int' for 3rd argument
  713 | inline T* InterlockedCompareExchangePointerT(
      |           ^
  714 |     T* volatile * destination,
  715 |     T*            exchange,
  716 |     int           comparand) // When NULL is provided as argument.
      |     ~~~~~~~~~~~~~~~~~~~~~~~
/__w/1/s/src/shared/pal/src/include/pal/palinternal.h:682:4: note: candidate template ignored: could not match 'T *' against 'std::nullptr_t'
  682 | T* InterlockedCompareExchangePointerT(
      |    ^
/__w/1/s/src/shared/pal/src/include/pal/palinternal.h:703:11: note: candidate template ignored: could not match 'T *' against 'std::nullptr_t'
  703 | inline T* InterlockedCompareExchangePointerT(
      |           ^
1 error generated.
make[2]: *** [src/shared/pal/src/CMakeFiles/coreclrpal.dir/build.make:342: src/shared/pal/src/CMakeFiles/coreclrpal.dir/init/pal.cpp.o] Error 1

@richlander

Copy link
Copy Markdown
Member Author

Looks like the new image doesn't have the latest clang.

I think it is the opposite, that the new image has the latest clang. The old image had a very old clang. This may be the first case of attempting to upgrade to Clang v17. We use Clang 16 elsewhere today.

We don't have an Alpine 3.18 image ("with node") today, but we could create one. Alpine 3.18 includes Clang 16. However, I'm not sure that this would help a lot, since we plan to move to Clang 17 this release.

@agocke @sbomer

@richlander
richlander requested a review from a team as a code owner March 19, 2024 18:11
@mikem8361

Copy link
Copy Markdown
Contributor

Looks like the build break was in PAL code that hasn't been updated from the runtime in a long time. I pushed a fix.

@mikem8361

Copy link
Copy Markdown
Contributor

Looks like my fix didn't build. Working on it.

@mikem8361

Copy link
Copy Markdown
Contributor

It turns out there are a lot more changes needed in the diagnostics PAL to get it to build with new clang in the new Alpine images. The diagnostics PAL hasn't been updated from the runtime PAL in a long time. I started to do the runtime sync a couple of months and never finished it having to move on to other things. It is a lot of work. Too much to do in this PR.

/cc: @tommcdon

@richlander

Copy link
Copy Markdown
Member Author

OK. Let's switch to Alpine 3.18 for now (which I can do).

We need to plan for this issue. We are thinking about moving to clang 17 for the .NET 9 build and Alpine 3.18 will eventually go EOL (in just over a year).

https://alpinelinux.org/releases/

@richlander

Copy link
Copy Markdown
Member Author

Thanks everyone for the help! I'm going to close this PR and start again when Alpine 3.18 images are available.

@richlander richlander closed this Mar 20, 2024
@richlander
richlander deleted the alpine-eol branch March 20, 2024 18:21
@richlander richlander mentioned this pull request Mar 21, 2024
mikem8361 pushed a commit that referenced this pull request Apr 8, 2024
Replaces #4556

Previous PR used Alpine 3.19 (with clang 17). This PR attempted to
update to update with Alpine 3.18 (with clang 16). That also failed.

Container images we should be using for .NET 8+:
https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/linux-instructions.md
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants