Uh oh!
There was an error while loading. Please reload this page.
Pass TargetRid and SourceBuildNonPortable to the native scripts - #74504
Conversation
ghost
commented
Aug 24, 2022
Tagging subscribers to this area: @hoyosjs Issue DetailsThe native build script uses the portablebuild argument when calculating the distro rid.
|
tmds
commented
Aug 25, 2022
This PR passes the TargetRid and PortableBuild arguments to the native scripts. I've simplified corehost managed and native now both use __DistroRid to determine the output directory. |
b887874 to
45c616bComparetmds
commented
Aug 26, 2022
This is now working. When I run the Using This PR is up for review. |
ericstj
commented
Aug 26, 2022
Looks like this is trying to publish crossgen2 as a self-contained application. I would imagine it needs #69455 and then needs to set |
tmds
commented
Aug 28, 2022
am11
left a comment
There was a problem hiding this comment.
Few suggestions, otherwise looks good.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
tmds
commented
Aug 31, 2022
@am11 thanks for reviewing! I've addressed your feedback. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
tmds
commented
Sep 13, 2022
Is this good to merge? |
tmds
commented
Sep 20, 2022
@dotnet/runtime-infrastructure is this good to merge? |
tmds
commented
Sep 26, 2022
Can you merge this? This enables building runtime repo for source-build on platforms where the target rid is not yet known in the rid graph. |
ViktorHofer
commented
Sep 26, 2022
Thanks for the work so far Tom. Unfortunately as already I mentioned, I'm not the right person to sign-off this change and I just asked the CLR team again to take a look. |
trylek
left a comment
There was a problem hiding this comment.
I apologize, I'm not really an expert in this area. To my limited knowledge the change looks good but I'm reluctant to approve it, I'd definitely suggest finding a reviewer who's more familiar with source build.
tmds
commented
Sep 27, 2022
If the @MichaelSimons can you review/approve from source-build perspective? I've just extended |
ViktorHofer
commented
Sep 27, 2022
@am11@MichalStrehovsky can you please take a look? Am11 hope that's OK to ask you for a review but if I remember correctly, you made the original changes around RuntimeOS/TargetArch/TargetRid/... and have the most expertise in that area. |
| <!-- BaseOS is an expected known rid in the graph that TargetRid is compatible with. | ||
| It's used to add TargetRid in the graph if the parent can't be detected. --> | ||
| <BaseOS>$(RuntimeOS)</BaseOS> |
There was a problem hiding this comment.
TargetRid, RuntimeOS, and BaseOS should ripple down from source-build.
TargetRid names what is built.. The build will add this rid to graph. If it can't find a parent (for example, alpine.4.15-x64 finds alpine-x64 as the parent) then BaseOS is used as a parent. For example, if Orange Linux is a musl based version of Linux, BaseOS should be linux-musl.
RuntimeOS is the rid of the prebuilt SDK and artifacts that get used during the build. source-build/installer should set this to match the bootstrap SDK's NETCoreSdkRuntimeIdentifier.
MichalStrehovsky
commented
Sep 27, 2022
I can only be authoritative for the diff in src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj. But this is an area that went through like 5 different values in the past year (used to be defined as __DistroRid, then ToolsRid, then Crossgen2PackageRid, then OutputRid, and now with this change PackageRid). I don't know what any of those mean. As long as the CI passes and we're still generating ARM64 bits when crossbuilding ARM64 from x64 (which would not be covered by the CI), that particular diff LGTM. |
| <PropertyGroup> | ||
| <OutputPath>$(RuntimeBinDir)ilc/</OutputPath> | ||
| <RuntimeIdentifier>$(OutputRid)</RuntimeIdentifier> | ||
| <RuntimeIdentifier>$(PackageRID)</RuntimeIdentifier> |
There was a problem hiding this comment.
@MichalStrehovsky I think this may be breaking to the cross-compilation scenario.OutputRid is linux-arm64 and PackageRID is linux-x64.
I see there is ILCompiler.csproj, and ILCompiler_crossarch.csproj.
This first, I guess, is used for creating a NuGet package (host: arm64 -> target: arm64)?
I think the latter is the one that is used on the build host (host: x64 -> target: arm64)?
Is that right?
I don't understand when/how ILCompiler gets packed. Where does this happen?
There was a problem hiding this comment.
It gets packed by a special project file pkgproj src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj, which is ultimately using $(OutputRid) (via properties inheritance).
This change is correct. The reason we haven't gotten any complaints before is because we are not (yet) cross-compiling ILCompiler in a way that HostOS and TargetOS differ (the first part of RID...).
There was a problem hiding this comment.
@am11 does Microsoft.DotNet.ILCompiler.pkgproj consume files built by ILCompiler.csproj?
If so, for what rid were these files built? OutputRid or PackageRID?
There was a problem hiding this comment.
Microsoft.DotNet.ILCompiler.pkgprojconsume files built byILCompiler.csproj
It collects the files from various location and packs them together in a zip (.nupkg) file. In this case, PackageRID is only used to restore the packages when building the managed assembly (we don't have proeprocessor conditions based on RuntimeIdentifier, it's all MSIL or #if TARGET_{OS_or_ARCH} in the code). OutputRid is used in pkgprojs or passed to cmake to decide which bits to build and pack.
There was a problem hiding this comment.
Sounds like we won't break anything then.
From what you said, I wonder: does ILCompiler.csproj need a RuntimeIdentifier?
There was a problem hiding this comment.
does
ILCompiler.csprojneed aRuntimeIdentifier?
Good question. As I understood it; RuntimeIdentifer during the restore step is used to decide which runtime.{rid}.xyz for a given package to restore, if the package has native assets. Here, ILCompiler.props has multiple PackageReference and ProjectReference, it is likely that the resolved dependency graph of this project (under obj directory) has such package-with-native-assets which is requiring the RuntimeIdentifier to be specified.
am11
commented
Sep 27, 2022
@ViktorHofer, I approved this PR three weeks ago. :) |
MichaelSimons
left a comment
There was a problem hiding this comment.
I approve from a source-build perspective.
jkoritzinsky
left a comment
There was a problem hiding this comment.
LGTM. I've also approved the Arcade PR
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
tmds
commented
Sep 28, 2022
@ViktorHofer or someone else, can you merge this please? |
ViktorHofer
commented
Sep 28, 2022
Unrelated, but there was a segfault when invoking msbuild: Unfortunately I couldn't find a dump in the artifacts payload. Configuration: |
Fixes#74577.
cc @MichaelSimons@omajid