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

Linux_musl runs are failing with libs not found due to mismatched RID expectations #3008

Closed
LoopedBard3 opened this issue May 4, 2023 · 11 comments · Fixed by dotnet/runtime#85946
Assignees
Labels
bug Something isn't working pipeline blocker issue blocks perf pipeline stays green. This be considered high priority.

Comments

@LoopedBard3
Copy link
Member

LoopedBard3 commented May 4, 2023

When we build the linux_musl run libraries, the pathing for the libraries is as follows: bin/microsoft.netcore.app.runtime.linux-musl-x64/Release/runtimes/linux-musl-x64/lib/net8.0/Microsoft.CSharp.dll.
When we try to then build the Core_Root it fails with Missing artifacts: /__w/1/s/artifacts/bin/microsoft.netcore.app.runtime.linux-x64/Release/runtimes/linux-x64/lib/net8.0/
This seems to be potentially related to dotnet/runtime#82832.
@tmds is there a parameter to the build.sh that we may be missing or something we should try on our end?
Thank you!

Example run failing under performance linux_musl x64... https://dev.azure.com/dnceng/internal/_build/results?buildId=2173609&view=results

@LoopedBard3 LoopedBard3 added bug Something isn't working pipeline blocker issue blocks perf pipeline stays green. This be considered high priority. labels May 4, 2023
@LoopedBard3 LoopedBard3 self-assigned this May 4, 2023
@tmds
Copy link
Member

tmds commented May 5, 2023

Example run failing under performance linux_musl x64... https://dev.azure.com/dnceng/internal/_build/results?buildId=2173609&view=results

I can't access this.

When we build the linux_musl run libraries, the pathing for the libraries is as follows: bin/microsoft.netcore.app.runtime.linux-musl-x64/Release/runtimes/linux-musl-x64/lib/net8.0/Microsoft.CSharp.dll.
When we try to then build the Core_Root it fails with Missing artifacts: /__w/1/s/artifacts/bin/microsoft.netcore.app.runtime.linux-x64/Release/runtimes/linux-x64/lib/net8.0/

bin/microsoft.netcore.app.runtime.linux-musl-x64/Release/runtimes/linux-musl-x64/lib/net8.0/Microsoft.CSharp.dll seems like the appropriate path for a linux-musl build.
What expect it to be at bin/microsoft.netcore.app.runtime.linux-x64/Release/runtimes/linux-x64/lib/net8.0/?

cc @ViktorHofer

@LoopedBard3
Copy link
Member Author

Sorry about that, let me expand on the different commands. To generate the libraries with the linux-musl-x64 in the path we use build.sh -subset tools+libs+libs.tests -rc release -configuration Release -ci -arch x64 -framework net8.0 /p:CrossBuild=true /p:ArchiveTests=true which seems correct, but when trying to create the corerun with src/tests/build.sh release x64 generatelayoutonly /p:LibrariesConfiguration=Release, it tries to use the incorrect pathing. I think this stems from some of the starting properties being incorrectly loaded in as the start of the generatelayoutonly displays:

__OutputRid: linux-x64
Building Tests...
__TargetOS: linux
__TargetArch: x64
__BuildType: Release

@tmds
Copy link
Member

tmds commented May 5, 2023

I will try to reproduce the issue on Monday.
On what OS/docker image are you running these commands?

@LoopedBard3
Copy link
Member Author

This was run in mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpine-20230414190614-8100bf7 container runner on a ubuntu 1804 amd64 agent.

@tmds
Copy link
Member

tmds commented May 5, 2023

Thanks for the info. I should be able to reproduce the issue with that.

The thing that stands out for me is the /p:CrossBuild=true, I wonder if adding that to the tests build.sh command might make things work.

@tmds
Copy link
Member

tmds commented May 8, 2023

The thing that stands out for me is the /p:CrossBuild=true, I wonder if adding that to the tests build.sh command might make things work.

This is the issue, the test build command doesn't look at the ROOTFS_DIR so it considers the target to be the Mariner distro (linux-x64) instead of Alpine distro (linux-musl-x64).

Adding -cross to the command makes the build pass:

 ./src/tests/build.sh release x64 generatelayoutonly  /p:LibrariesConfiguration=Release -cross

@LoopedBard3 are you able to fix the build using this information?

@ViktorHofer is it so that every cross-build has a ROOTFS_DIR, and all builds with a ROOTFS_DIR are cross-builds?

@ViktorHofer
Copy link
Member

No idea... @janvorli @vitek-karas @wfurt might know.

@LoopedBard3
Copy link
Member Author

I will give this a try today 👍.

@LoopedBard3
Copy link
Member Author

LoopedBard3 commented May 8, 2023

The core_root test build got past the core_root build so it looks like this fixes the issue. @tmds Thank you for the help!

@janvorli
Copy link
Member

janvorli commented May 9, 2023

is it so that every cross-build has a ROOTFS_DIR, and all builds with a ROOTFS_DIR are cross-builds?

That is true except for macOS and Windows. However, I would be hesitant to make the build decide whether to do a cross build or not based on an ambient env var being set. Currently, all of our build scripts require -cross to be passed in for cross builds.

@tmds
Copy link
Member

tmds commented May 9, 2023

So when there is a ROOTFS_DIR, it's meant for a cross-build.
But some cross-builds on macOS and Windows hosts don't have a ROOTFS_DIR.
Is this for mobile targets (android/ios), or what is it the target?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pipeline blocker issue blocks perf pipeline stays green. This be considered high priority.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants