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

coreclr compilation failure on Alpine Linux (Musl based), "atoll is missing exception specification 'throw()'" #44988

Closed
PureTryOut opened this issue Nov 20, 2020 · 10 comments · Fixed by #45352

Comments

@PureTryOut
Copy link

Continuation of dotnet/source-build#1882.

Description

coreclr fails to compile on an Alpine Linux edge system due to error: 'atoll' is missing exception specification 'throw()'.

To reproduce:

  1. Get an Alpine Linux edge system, this can be in Docker if need be
  2. Clone this repo
  3. Run build.sh

Configuration

This is on Alpine Linux edge, which is basically a rolling release version of Alpine Linux.
This system uses the Musl libc rather than glibc, which is probably the reason this is failing.

Right now I'm trying to build this for x86_64, but I personally doubt it's architecture related.

Regression?

This is the first time I'm trying it, so I don't know.

Other information

In file included from /home/bart/Documents/Git/runtime/src/coreclr/src/pal/src/misc/tracepointprovider.cpp:18:
  In file included from /home/bart/Documents/Git/runtime/src/coreclr/src/pal/src/include/pal/palinternal.h:584:
  In file included from /usr/bin/../lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../include/c++/10.2.1/stdlib.h:30:
  /usr/include/stdlib.h:23:11: error: 'atoll' is missing exception specification 'throw()'
  long long atoll (const char *);
            ^
  /home/bart/Documents/Git/runtime/src/coreclr/src/pal/inc/pal.h:3892:33: note: previous declaration is here
  PALIMPORT long long int __cdecl atoll(const char *)
                                  ^
  In file included from /home/bart/Documents/Git/runtime/src/coreclr/src/pal/src/exception/remote-unwind.cpp:44:
  In file included from /home/bart/Documents/Git/runtime/src/coreclr/src/pal/src/include/pal/palinternal.h:584:
  In file included from /usr/bin/../lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../include/c++/10.2.1/stdlib.h:30:
  /usr/include/stdlib.h:23:11: error: 'atoll' is missing exception specification 'throw()'
  long long atoll (const char *);
            ^
  /home/bart/Documents/Git/runtime/src/coreclr/src/pal/inc/pal.h:3892:33: note: previous declaration is here
  PALIMPORT long long int __cdecl atoll(const char *)
                                  ^
@janvorli
Copy link
Member

Alpine is supported and we build and provide official packages for it. However, we never tried to build it on the edge, we test only the official released versions. We had the same problem on SunOS some time ago and it was fixed for that one explicitly. So we need to fix it for the new Alpine too.

@janvorli janvorli removed the untriaged New issue has not been triaged by the area owner label Nov 20, 2020
@janvorli janvorli added this to the 6.0.0 milestone Nov 20, 2020
@janvorli
Copy link
Member

@PureTryOut the fix is simple: janvorli@6abd25b. I will send out a PR soon.
However, I had problems building on Alpine edge - find_library in cmake is unable to find ICU libraries and also lttng-ust one. Did you have the same problems?

@PureTryOut
Copy link
Author

Thanks, that does the trick indeed! I don't think I have reached the point where you got to yet, right now it's stuck on something else.

  -- Installing: /home/bart/Documents/Git/dotnet-runtime/artifacts/bin/linux-musl-x64.Debug/corehost_test/nativehost
/home/bart/.nuget/packages/microsoft.dotnet.build.tasks.packaging/6.0.0-beta.20563.2/build/Packaging.targets(1250,5): error : Error when creating nuget lib package from /home/bart/Documents/Git/dotnet-runtime/artifacts/packages/Debug/specs/runtime.linux-x64.Microsoft.NETCore.DotNetHost.nuspec. System.IO.DirectoryNotFoundException: Could not find a part of the path '/home/bart/Documents/Git/dotnet-runtime/artifacts/bin/linux-x64.Debug/corehost'. [/home/bart/Documents/Git/dotnet-runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.pkgproj]  
/home/bart/.nuget/packages/microsoft.dotnet.build.tasks.packaging/6.0.0-beta.20563.2/build/Packaging.targets(1250,5): error :    at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound) [/home/bart/Documents/Git/dotnet-runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.pkgproj]

@janvorli
Copy link
Member

I think you are hitting the problem with standalone build of the corehost on Alpine that I was trying to solve in #37101. That fix works locally, but doesn't work in our CI lab and I didn't have time to investigate why yet. You can try to apply it locally to see if it helps in your case.

@janvorli
Copy link
Member

Actually, I've just found that instead of my change, adding /p:OutputRid=linux-musl-x64 to the build command line fixes that problem too.

@PureTryOut
Copy link
Author

You're right, that did help. I got a successful build now, victory! 🎉

So that's a combination of ./build.sh -p:OutputRid=linux-musl-x64 (what a weird syntax for arguments) and janvorli@6abd25b.

Now let's see how to get this working in combination with https://github.com/dotnet/source-build...

@janvorli
Copy link
Member

/p is setting msbuild property. So /p:OutputRid=linux-musl-x64 means set msbuild property OutputRid to linux-musl-x64

@PureTryOut
Copy link
Author

Yeah I get what it does, it's just an interesting syntax which is completely different from what bash scripts normally use (--something=argument) 😉

@PureTryOut
Copy link
Author

Thank you very much! 🎉

@danmoseley
Copy link
Member

Yeah I get what it does, it's just an interesting syntax which is completely different from what bash scripts normally use (--something=argument) 😉

-p:something=argument also works. It's historical legacy that it doesn't follow the consistent Unix pattern.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants