-
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
Replace IlcHostArch with SDK-computed value #82645
Replace IlcHostArch with SDK-computed value #82645
Conversation
src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets
Outdated
Show resolved
Hide resolved
src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets
Show resolved
Hide resolved
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue Detailsnull
|
728efe2
to
bf36e14
Compare
54d2b7a
to
269de39
Compare
src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets
Outdated
Show resolved
Hide resolved
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets
Outdated
Show resolved
Hide resolved
src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets
Outdated
Show resolved
Hide resolved
src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets
Show resolved
Hide resolved
src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets
Outdated
Show resolved
Hide resolved
src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets
Outdated
Show resolved
Hide resolved
59dd15d
to
ae475ce
Compare
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.
LGTM. @agocke Any additional feedback?
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets
Outdated
Show resolved
Hide resolved
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets
Show resolved
Hide resolved
This reverts commit c9e910e.
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.
I would like @agocke to take a look as well.
Looking... |
<_indexOfHyphen>$(_targetOSPkg.IndexOf('-'))</_indexOfHyphen> | ||
<_targetOS Condition="'$(_indexOfHyphen)' > -1">$(_targetOSPkg.SubString(0, $(_indexOfHyphen)))</_targetOS> | ||
<_targetOS Condition="'$(_indexOfHyphen)' == -1">$(_targetOSPkg)</_targetOS> | ||
<_hostOS>$(NETCoreSdkPortableRuntimeIdentifier.SubString(0, $(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-'))))</_hostOS> |
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.
This is an 'internal' variable so I'm not really concerned with naming, but FWIW I don't think of linux-musl
as an OS by itself, I think of it as OSxLibc.
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.
Alpine to linux-musl is same as Android to linux-bionic; which is our existing convention:
Line 194 in eccbe90
<_portableOS Condition="'$(_runtimeOS)' == 'linux-musl' or $(_runtimeOS.StartsWith('alpine'))">linux-musl</_portableOS> |
<!-- Determine _targetArchitecture from RuntimeIdentifier --> | ||
<_targetArchitecture>$(RuntimeIdentifier.SubString($([MSBuild]::Add($(RuntimeIdentifier.LastIndexOf('-')), 1))))</_targetArchitecture> | ||
|
||
<RuntimeIlcPackageName>runtime.$(_targetOS)-$(_targetArchitecture).Microsoft.DotNet.ILCompiler</RuntimeIlcPackageName> | ||
<_hostPackageName>runtime.$(_hostOS)-$(_hostArchitecture).Microsoft.DotNet.ILCompiler</_hostPackageName> |
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.
On non-Windows, this is just runtime.$(NETCoreSdkPortableRuntimeIdentifier).Microsoft.DotNet.ILCompiler
, right?
Ideally, I'd like to avoid string-splitting the RIDs at all, so it would be nice if there were pre-existing variables for this.
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.
To me this is more readable in the context of next line:
_hostPackageName=_hostOS+_hostArchitecture
_targetPackageName=_targetOS+_targetArchitecture
src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets
Show resolved
Hide resolved
Text="Cross-OS native compilation is not supported." /> | ||
|
||
<Error Condition="'$(DisableUnsupportedError)' != 'true' and !($(RuntimeIdentifier.EndsWith('x64')) or $(RuntimeIdentifier.EndsWith('arm64')))" | ||
<Error Condition="'$(DisableUnsupportedError)' != 'true' and '$(_targetArchitecture)' != 'x64' and '$(_targetArchitecture)' != 'arm64'" |
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.
Is this line necessary. In fact, is it even reachable? Or do we fail during package restore since a linux-x86
runtime pack doesn't exist.
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.
Yes, we need to revisit these error cases / validations at some point, out of scope for this PR though.
Text="Native compilation does not support targeting $(RuntimeIdentifier) yet." /> | ||
|
||
<Error Condition="'$(DisableUnsupportedError)' != 'true' and !('$(IlcHostArch)' == 'x64' or '$(IlcHostArch)' == 'arm64')" | ||
<Error Condition="'$(DisableUnsupportedError)' != 'true' and !('$(_hostArchitecture)' == 'x64' or '$(_hostArchitecture)' == 'arm64')" |
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.
Also not sure what this is accomplishing. It seems like we should be able to run anywhere with a linker and a package definition.
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.
Similar to my complaint above these checks need to be revisited. They predate the .NET SDK integration with the PublishAot
property, and many of the checks are either outdated or outright useless. Unfortunately it requires some effort to fix and test all the combinations so I don't think it should block this PR [which just renames the variables within the existing checks].
LGTM. Continued uncomfortableness at parsing RIDs, which is something we've explicitly said not to do, but I don't see a better option in some of these cases. |
No description provided.