-
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
Consolidate LocateNativeCompiler target #103375
Consolidate LocateNativeCompiler target #103375
Conversation
908e80a
to
be8d681
Compare
Opened #103409, as it's failing on other PRs as well. Rest of the failures are unrelated to PR changes. |
Thanks, this is an awesome improvement, but we need to get official builds stabilized first since we didn't have any for a week. Build work has a high chance of breaking stuff. I'll mark no-merge for now. |
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 once our official builds are unblocked. Thanks a lot!
@@ -23,67 +22,7 @@ | |||
<PackageReference Include="runtime.$(ToolsRID).Microsoft.DotNet.ILCompiler" Version="$(MicrosoftDotNetILCompilerVersion)" /> | |||
</ItemGroup> | |||
|
|||
<!-- Needed for the amd64 -> amd64 musl cross-build to pass the target flag. --> | |||
<Target Name="_FixIlcTargetTriple" |
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.
Do you know why this is no longer needed?
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 should be handled by
runtime/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Line 46 in b1f63db
<CrossCompileAbi Condition="$(CrossCompileRid.StartsWith('linux-musl-')) or $(CrossCompileRid.StartsWith('alpine-'))">musl</CrossCompileAbi> |
Failures are unrelated according to Build Analysis. I think it would be good to run outerloop nativeaot leg against this PR to rule out any latent surprises. |
be64d07
to
cb3e150
Compare
/azp run runtime-coreclr crossgen2 outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
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. Thanks!
@sbomer Could you please review this as well? Most of the changes are in the trimming tests.
d50b9b6
to
04f086a
Compare
<PropertyGroup> | ||
<!-- in net9.0 we can do this, but only on mobile apple platforms, not OSX --> | ||
<SharedLibraryInstallName>@rpath/$(MSBuildProjectName).dylib</SharedLibraryInstallName> | ||
</PropertyGroup> | ||
<ItemGroup Condition="'$(TargetsOSX)' == 'true'"> | ||
<LinkerArg Include="-Wl,-install_name,@rpath/$(MSBuildProjectName).dylib" /> | ||
</ItemGroup> |
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.
We generally need to specify the @rpath/
-prefixed name on macOS for libraries. Is that done somewhere else now? What is the output for otool -l
before and after?
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 that done somewhere else now?
Seems to me like an avoidable duplicate:
runtime/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Line 217 in 7b69459
<LinkerArg Include="-Wl,-install_name,"$(SharedLibraryInstallName)"" Condition="'$(_IsiOSLikePlatform)' == 'true' and '$(NativeLib)' == 'Shared'" /> |
Can we use it for all apple platforms? Or are there use-cases when we explicitly don't need it?
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.
Can we use it for all apple platforms? Or are there use-cases when we explicitly don't need it?
I'd say we can. We would need to check with Xamarin workloads to ensure that it doesn't break anything.
Note that generally Xamarin workloads have an SDK code on the consumption side where it fixes up the paths with install_name_tool
if they are wrong, so I don't expect it to break anything there. I am more concerned that the workload may also specify -install_name
on the library compilation side and it would collide if we add it in the NativeAOT linker args.
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.
With 9a97e5e the behavior is:
- cmdsize 72
- name bin/Release/net9.0/osx-arm64/native/helloworld.dylib (offset 24)
+ cmdsize 48
+ name @rpath/helloworld.dylib (offset 24)
- User can skip setting install_name with
SkipInstallName
- If user has
<LinkerArg Include="-Wl,-install_name,@rpath/TheirName" />
type of thing specified in their project, TheirName takes precedence with SkipInstallName=true
What do you think?
cDAC (the project being modified) is currently only used for testing in the repo, which is working, so I think we can live with it without waiting for next SDK update which won't be long (10.0 alpha1).
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.
cc @lambdageek
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
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Outdated
Show resolved
Hide resolved
…e.Unix.targets Co-authored-by: Jan Kotas <jkotas@microsoft.com>
No description provided.