Skip to content

Enable x86 AOT compilation for components build - #105909

Merged
MichalStrehovsky merged 3 commits into
dotnet:mainfrom
am11:patch-9
Aug 5, 2024
Merged

Enable x86 AOT compilation for components build#105909
MichalStrehovsky merged 3 commits into
dotnet:mainfrom
am11:patch-9

Conversation

@am11

@am11 am11 commented Aug 3, 2024

Copy link
Copy Markdown
Member

Now that global.json is pointing to p6 (which has an SDK fix for win-x86), lets try enabling it.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Aug 3, 2024
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

@am11

am11 commented Aug 3, 2024

Copy link
Copy Markdown
Member Author
...
  Generating native code
  ILCompiler -> D:\a\_work\1\s\artifacts\bin\coreclr\windows.x86.Checked\ilc-published\
...

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good.

I think there is a separate question whether we should be building win-x86 ilc and crossgen2 binaries at all. I have tried to compile hello world using win-x86 ilc from .NET 9 P6 SDK and the build insists on cross-compiling using win-x64 ilc ("Add a PackageReference for 'runtime.win-x64.Microsoft.DotNet.ILCompiler' to allow cross-compilation for x86"). cc @filipnavara

@filipnavara

Copy link
Copy Markdown
Member

I have tried to compile hello world using win-x86 ilc from .NET 9 P6 SDK and the build insists on cross-compiling using win-x64 ilc ("Add a PackageReference for 'runtime.win-x64.Microsoft.DotNet.ILCompiler' to allow cross-compilation for x86").

That’s somewhat unexpected. It was possible to use for building the tests last time I tried. It was not necessarily a good experience since it was prone to run out of virtual memory on any bigger inputs.

@jkotas

jkotas commented Aug 3, 2024

Copy link
Copy Markdown
Member

We use custom setup for tests, so I can believe that it is possible to use it for tests. I was looking at it from the user point of view. As far as I can tell, there is no way for regular user project files to use the win-x86 ilc binary.

@am11
am11 requested a review from MichalStrehovsky as a code owner August 3, 2024 17:53
@am11

am11 commented Aug 3, 2024

Copy link
Copy Markdown
Member Author

@jkotas, second commit fixes the publishing issue you described; when dotnet.exe or ilc.exe is x86, running (emulating) on x64 or arm64 machine. x86 dotnet.exe or ilc.exe on x86 windows were working fine with p6, so it wasn't widespread.

@MichalStrehovsky MichalStrehovsky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MichalStrehovsky

Copy link
Copy Markdown
Member

@agocke, are you okay with merging this? I noticed your #105826 and this takes a dependency on preview 6. I don't have context on the other PR.

@agocke

agocke commented Aug 5, 2024

Copy link
Copy Markdown
Member

There were a couple issues popping up that seemed to be caused by low frequency bugs in the preview 6 SDK. I was evaluating if we could roll it back, while monitoring the build. Overall, I don’t think we should roll back. The issues most commonly blocking the build don’t seem to be ones that would be fixed by a rollback, and we’re close to p7. I think it’s fine to merge this.

@MichalStrehovsky
MichalStrehovsky merged commit 283d5f3 into dotnet:main Aug 5, 2024
@MichalStrehovsky

Copy link
Copy Markdown
Member

There were a couple issues popping up that seemed to be caused by low frequency bugs in the preview 6 SDK. I was evaluating if we could roll it back, while monitoring the build. Overall, I don’t think we should roll back. The issues most commonly blocking the build don’t seem to be ones that would be fixed by a rollback, and we’re close to p7. I think it’s fine to merge this.

Thank you! Merging!

@am11
am11 deleted the patch-9 branch August 5, 2024 17:47
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-x86 area-NativeAOT-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants