-
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
Build managed part of crossgen2 as platform independent (AnyCPU) #33041
Conversation
Why not build everything as AnyCpu? ie delete https://github.com/dotnet/runtime/blob/master/src/coreclr/dir.common.props#L33 |
@jkotas this change by itself didn't seem to work, and I was not sure whether that was the correct approach, because for example System.Private.CoreLib build relies on Platform set equal to build arch. |
Set Platform for System.Private.CoreLib, and leave it to default to AnyCPU for everything else? |
@@ -7,6 +7,7 @@ | |||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems> | |||
<Platforms>x64;x86</Platforms> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of this should be needed once the default is AnyCPU.
1f9e6fc
to
a94a4ea
Compare
@jkotas there is a problem with the approach that sets Platform to AnyCPU for everything. Crossgen2 is built as an app targeting specific RID (e.g.
I've done the change that sets Platform to AnyCPU for everything (gbalykov@703ca05), however, this doesn't affect the resulting dlls, because they still target the specific platform. The same effect is from simple build command instead of publish:
Only if I remove On the other side, approach with setting PlatformTarget to AnyCPU works even with build for specific rid. What do you think? |
Hmmm, I have not realized that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I have not realized we can clean this up later if necessary.
After this change same crossgen2.dll can be launched on different architectures.
Related issue: #31793
cc @alpencolt @jkotas