Skip to content
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

Prefer OutputRid over PackageRID for output artifacts. #76871

Merged
merged 3 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@
<MicrosoftNetCoreAppRefPackRefDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRefPackDir)', 'ref', '$(NetCoreAppCurrent)'))</MicrosoftNetCoreAppRefPackRefDir>
<MicrosoftNetCoreAppRefPackDataDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRefPackDir)', 'data'))</MicrosoftNetCoreAppRefPackDataDir>

<MicrosoftNetCoreAppRuntimePackDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'microsoft.netcore.app.runtime.$(PackageRID)', '$(LibrariesConfiguration)'))</MicrosoftNetCoreAppRuntimePackDir>
<MicrosoftNetCoreAppRuntimePackRidDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackDir)', 'runtimes', '$(PackageRID)'))</MicrosoftNetCoreAppRuntimePackRidDir>
<MicrosoftNetCoreAppRuntimePackDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'microsoft.netcore.app.runtime.$(OutputRid)', '$(LibrariesConfiguration)'))</MicrosoftNetCoreAppRuntimePackDir>
<MicrosoftNetCoreAppRuntimePackRidDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackDir)', 'runtimes', '$(OutputRid)'))</MicrosoftNetCoreAppRuntimePackRidDir>
<MicrosoftNetCoreAppRuntimePackRidLibTfmDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackRidDir)', 'lib', '$(NetCoreAppCurrent)'))</MicrosoftNetCoreAppRuntimePackRidLibTfmDir>
<MicrosoftNetCoreAppRuntimePackNativeDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackRidDir)', 'native'))</MicrosoftNetCoreAppRuntimePackNativeDir>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion eng/testing/tests.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<AndroidTestRunnerDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'AndroidTestRunner', '$(Configuration)', '$(NetCoreAppCurrent)'))</AndroidTestRunnerDir>
<WasmTestRunnerDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'WasmTestRunner', '$(Configuration)', '$(NetCoreAppCurrent)'))</WasmTestRunnerDir>

<RuntimeIdentifier>$(PackageRID)</RuntimeIdentifier>
<RuntimeIdentifier>$(OutputRid)</RuntimeIdentifier>
<SelfContained>true</SelfContained>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion eng/testing/tests.singlefile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<BundleDir>$([MSBuild]::NormalizeDirectory('$(OutDir)', 'publish'))</BundleDir>
<RunScriptOutputPath>$([MSBuild]::NormalizePath('$(BundleDir)', '$(RunScriptOutputName)'))</RunScriptOutputPath>
<RuntimeIdentifier>$(PackageRID)</RuntimeIdentifier>
<RuntimeIdentifier>$(OutputRid)</RuntimeIdentifier>

<RunScriptCommand Condition="'$(TargetOS)' == 'windows'">$(AssemblyName).exe</RunScriptCommand>
<RunScriptCommand Condition="'$(TargetOS)' != 'windows'">chmod +rwx $(AssemblyName) &amp;&amp; ./$(AssemblyName)</RunScriptCommand>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<PackageRid>linux-x64</PackageRid>
<PackageRid Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">win-x64</PackageRid>
<OutputRid>linux-x64</OutputRid>
<OutputRid Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">win-x64</OutputRid>

<!-- Stress projects have their own global.json, the directory above that also has it is the repository root. -->
<RepositoryRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/</RepositoryRoot>
Expand All @@ -12,6 +12,6 @@
<NetCoreAppCurrentVersion>7.0</NetCoreAppCurrentVersion>
<MicrosoftNetCoreAppFrameworkName>Microsoft.NETCore.App</MicrosoftNetCoreAppFrameworkName>
<MicrosoftNetCoreAppRefPackDir Condition="'$(MicrosoftNetCoreAppRefPackDir)' == ''" >$(RepositoryRoot)artifacts/bin/microsoft.netcore.app.ref/</MicrosoftNetCoreAppRefPackDir>
<MicrosoftNetCoreAppRuntimePackDir Condition="'$(MicrosoftNetCoreAppRuntimePackDir)' == ''">$(RepositoryRoot)artifacts/bin/microsoft.netcore.app.runtime.$(PackageRid)/$(Configuration)/</MicrosoftNetCoreAppRuntimePackDir>
<MicrosoftNetCoreAppRuntimePackDir Condition="'$(MicrosoftNetCoreAppRuntimePackDir)' == ''">$(RepositoryRoot)artifacts/bin/microsoft.netcore.app.runtime.$(OutputRid)/$(Configuration)/</MicrosoftNetCoreAppRuntimePackDir>
tmds marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<PackageRid>linux-x64</PackageRid>
<PackageRid Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">win-x64</PackageRid>
<OutputRid>linux-x64</OutputRid>
<OutputRid Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">win-x64</OutputRid>

<!-- Stress projects have their own global.json, the directory above that also has it is the repository root. -->
<RepositoryRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/</RepositoryRoot>
Expand All @@ -12,6 +12,6 @@
<NetCoreAppCurrentVersion>7.0</NetCoreAppCurrentVersion>
<MicrosoftNetCoreAppFrameworkName>Microsoft.NETCore.App</MicrosoftNetCoreAppFrameworkName>
<MicrosoftNetCoreAppRefPackDir Condition="'$(MicrosoftNetCoreAppRefPackDir)' == ''" >$(RepositoryRoot)artifacts/bin/microsoft.netcore.app.ref/</MicrosoftNetCoreAppRefPackDir>
<MicrosoftNetCoreAppRuntimePackDir Condition="'$(MicrosoftNetCoreAppRuntimePackDir)' == ''">$(RepositoryRoot)artifacts/bin/microsoft.netcore.app.runtime.$(PackageRid)/$(Configuration)/</MicrosoftNetCoreAppRuntimePackDir>
<MicrosoftNetCoreAppRuntimePackDir Condition="'$(MicrosoftNetCoreAppRuntimePackDir)' == ''">$(RepositoryRoot)artifacts/bin/microsoft.netcore.app.runtime.$(OutputRid)/$(Configuration)/</MicrosoftNetCoreAppRuntimePackDir>
tmds marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/libraries/oob.proj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
DependsOnTargets="GetTrimOOBAssembliesInputs;PrepareForAssembliesTrim"
Inputs="$(ILLinkTasksAssembly);@(OOBAssemblyToTrim);@(OOBAssemblyReference);@(OOBLibrarySuppressionsXml)"
Outputs="$(OOBAssembliesMarkerFile)">
<Message Text="$(MSBuildProjectName) -> Trimming $(PackageRID) out-of-band assemblies with ILLinker..." Importance="high" />
<Message Text="$(MSBuildProjectName) -> Trimming $(OutputRid) out-of-band assemblies with ILLinker..." Importance="high" />

<PropertyGroup>
<OOBILLinkArgs>$(ILLinkArgs)</OOBILLinkArgs>
Expand Down
10 changes: 5 additions & 5 deletions src/libraries/pretest.proj
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@
Outputs="$(MicrosoftNetCoreAppRuntimePackDir)data\PlatformManifest.txt"
Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
<GenerateFileVersionProps Files="@(SharedFrameworkRuntimeFile)"
PackageId="$(MicrosoftNetCoreAppFrameworkName).Runtime.$(PackageRID)"
PackageId="$(MicrosoftNetCoreAppFrameworkName).Runtime.$(OutputRid)"
Copy link
Member

Choose a reason for hiding this comment

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

This changes the non-shipping "fake" runtime pack id. Do we also make changes to the actual shipping runtime pack sfxproj? I'm suprised that there aren't any changes to the sfxprojs.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't aware there's a fake runtime pack id, and a shipping runtime pack id.
Do these represent different builds?

I assume the sfxprojs pick up the MicrosoftNetCoreAppRuntimePack* properties?

Copy link
Member

Choose a reason for hiding this comment

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

No, both use the same assets underneath but the composition of them is different (predates the repository consolidation).

I assume the sfxprojs pick up the MicrosoftNetCoreAppRuntimePack* properties?

Unsure about that. Please double check. You should be able to build the sfxprojs via the packs subset.

PackageVersion="$(ProductVersion)"
PlatformManifestFile="$(MicrosoftNetCoreAppRuntimePackDir)data\PlatformManifest.txt"
PreferredPackages="$(MicrosoftNetCoreAppFrameworkName).Runtime.$(PackageRID)"
PreferredPackages="$(MicrosoftNetCoreAppFrameworkName).Runtime.$(OutputRid)"
PermitDllAndExeFilesLackingFileVersion="true" />
</Target>

Expand Down Expand Up @@ -95,16 +95,16 @@
<!-- Shared framework deps file generation. Produces a test shared-framework deps file. -->
<GenerateTestSharedFrameworkDepsFile SharedFrameworkDirectory="$(NetCoreAppCurrentTestHostSharedFrameworkPath)"
RuntimeGraphFiles="$(BundledRuntimeIdentifierGraphFile)"
TargetRuntimeIdentifier="$(PackageRID)" />
TargetRuntimeIdentifier="$(OutputRid)" />
</Target>

<Target Name="GetRuntimePackFiles">
<ItemGroup>
<RuntimePackLibFile Include="$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)*.*">
<TargetPath>runtimes/$(PackageRID)/lib/$(NetCoreAppCurrent)</TargetPath>
<TargetPath>runtimes/$(OutputRid)/lib/$(NetCoreAppCurrent)</TargetPath>
</RuntimePackLibFile>
<RuntimePackNativeFile Include="$(MicrosoftNetCoreAppRuntimePackNativeDir)*.*">
<TargetPath>runtimes/$(PackageRID)/native</TargetPath>
<TargetPath>runtimes/$(OutputRid)/native</TargetPath>
<IsNative>true</IsNative>
</RuntimePackNativeFile>
<!-- Clear the IsNative flag on System.Private.CoreLib given that it is present in native dir but it is actually managed -->
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/sfx.proj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
Condition="'$(RefOnly)' != 'true'"
Inputs="@(SharedFrameworkAssembly);@(SharedFrameworkSuppressionsXml);$(ILLinkTasksAssembly)"
Outputs="$(SharedFrameworkAssembliesMarkerFile)">
<Message Text="$(MSBuildProjectName) -> Trimming $(PackageRID) shared framework assemblies with ILLinker..." Importance="high" />
<Message Text="$(MSBuildProjectName) -> Trimming $(OutputRid) shared framework assemblies with ILLinker..." Importance="high" />

<PropertyGroup>
<SharedFrameworkILLinkArgs>$(ILLinkArgs)</SharedFrameworkILLinkArgs>
Expand Down