-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Live apphost not being used by crossgen2 with source build #77667
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
@agocke might be able to help but AFAIK, these days crossgen2 uses live build of ilc (NativeAOT) when available or fallback to live build of corehost on platforms where NativeAOT is not available. The use of prebuilt host (from nuget package) was completely removed. Looks like you are seeing a different behavior on x86; something is still expecting prebuilt host. Perhaps we are (unintentionally) skipping live build host on x86? Could you try |
Building just those subsets gives the same result. |
In 9a3626e, Maybe this patch will help: --- a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj
+++ b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj
@@ -9,7 +9,7 @@
<!-- Trimming is not currently working, but set the appropriate feature flags for NativeAOT -->
<PublishTrimmed Condition="'$(NativeAotSupported)' == 'true'">true</PublishTrimmed>
<RuntimeIdentifiers Condition="'$(RunningPublish)' != 'true' and '$(DotNetBuildFromSource)' != 'true'">linux-x64;linux-musl-x64;linux-arm;linux-musl-arm;linux-arm64;linux-musl-arm64;freebsd-x64;osx-x64;osx-arm64;win-x64;win-x86;win-arm64;win-arm</RuntimeIdentifiers>
- <RuntimeIdentifiers Condition="'$(DotNetBuildFromSource)' == 'true'">$(PackageRID)</RuntimeIdentifiers>
+ <RuntimeIdentifiers Condition="'$(RunningPublish)' != 'true' and '$(DotNetBuildFromSource)' == 'true'">$(PackageRID)</RuntimeIdentifiers>
<SelfContained>false</SelfContained>
<SelfContained Condition="'$(RunningPublish)' == 'true'">true</SelfContained>
</PropertyGroup> |
This seems like it's specific to linux x86, right? I don't see any source build problems for other architectures. |
Tagging subscribers to this area: @hoyosjs Issue DetailsDescription.NET 7 in source-build does not currently use NativeAOT. Thus, when building Crossgen2 from source on platforms without apphost in nuget feeds, build of runtime fails with:
Reproduction StepsCrossbuild from Expected behaviorCrossgen2 should be able to use to live apphost built previously by runtime Actual behaviorBuild fails due to no apphost for that RID Regression?Per #7335 and #66866, there was a time when this was a non-issue. With move to NativeAOT, Known WorkaroundsNone for now. I attempted to build runtime in two steps, to no avail:
Configuration.NET 7.0.100-rtm.22519.39 Other informationNo response
|
Indeed. I believe this is specific to
Unfortunately that patch didn't work. Very curious that it insists on the apphost not existing despite the apphost being built. |
Is there a subset for only building and packaging apphost? I'm thinking a workaround might be to build apphost, and push it to a local nuget feed via |
sigh |
I cannot test Does source-build fail for linux-x86 too, as it does for linux-musl-x86? asking because the regular cross build for $ git clone https://github.com/dotnet/runtime -b release/7.0 --single-branch --depth 1
$ docker run -v$(pwd)/runtime:/runtime -e ROOTFS_DIR=/crossrootfs/x86 --rm \
mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-x86-linux-20221024215143-3fc5553 \
/runtime/build.sh clr+libs+host+packs -arch x86 -cross
__DistroRid: linux-x86
... a few minutes later
Build succeeded. |
I could try to figure out a |
NativeAOT doesn't support linux-x86, it builds with apphost (singlefilehost to be specific) when NativeAOT does not support the target platform. |
Interesting, I didn't know that |
I workaround for now, I figure, is to build a Mono flavored runtime as to avoid building crossgen. Seems kind of like a big roundabout for what seems like a bug that's likely due to a misplaced |
Forcing build of Mono-flavored runtime fails with:
Likely a |
This doesn't seem to be an issue anymore. I've crossbuilt version 7.0.102 to 8.0.100-preview.1 without having to deal with this. I do have an issue with the build artifacts, though. I'm getting an execution failure when trying to run the resulting SDK. Running I tried stracing it, but could only attach the process after execution. Edit: The following patchset is used to build the SDK: https://lab.ilot.io/ayakael/dotnet-stage0 |
@ayakael, I have only tried building runtime, didn't test the binaries.
I don't have permission to download it. :)
BTW, were you testing under VM / baremetal install or QEMU? CoreCLR-PAL has some issues with QEMU (even on 64-bit archs). |
Woops, here is a functional link: dotnet-sdk-8.0.100-preview.2.23157.25-r1-linux-musl-x86.tar.xz I tested first within a chroot of alpine-x86 that was in LXC, and then within a chroot in a qemu based env. Both behave the same. |
Opened #83509 for the different issue.
Good to know that this issue no longer repros. Closing. |
Description
.NET 7 in source-build does not currently use NativeAOT. Thus, when building Crossgen2 from source on platforms without apphost in nuget feeds, build of runtime fails with:
Reproduction Steps
Crossbuild from
x64
tox86
, crossgen2 build will fail.Expected behavior
Crossgen2 should be able to use to live apphost built previously by runtime
Actual behavior
Build fails due to no apphost for that RID
Regression?
Per #7335 and #66866, there was a time when this was a non-issue. With move to NativeAOT,
UseLiveBuiltDotNetHost
was dropped, and this use-case seems to have been removed.Known Workarounds
None for now. I attempted to build runtime in two steps, to no avail:
Configuration
.NET 7.0.100-rtm.22519.39
Alpine Linux Edge
x64 to x86 crossbuild
Other information
No response
The text was updated successfully, but these errors were encountered: