Skip to content

Conversation

@elinor-fung
Copy link
Member

Update generated BundledVersions props to include a list of known RID platforms. This will be used by dotnet/sdk#32970.

Comment on lines 329 to 330
<_KnownRuntimeIdentiferPlatforms Include="any;freebsd;illumos;linux;linux-bionic;linux-musl;osx;solaris;unix;win" />
<_KnownRuntimeIdentiferPlatforms Include="android;aot;browser;ios;iossimulator;maccatalyst;tvos;tvossimulator" />
Copy link
Member

Choose a reason for hiding this comment

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

Do we expect this list to change over time? If the list might change for later .NET versions, it might be better to process KnownFrameworkReference / KnownRuntimePack items for the correct target framework to extract the platforms from the RuntimePackRuntimeIdentifiers metadata.

Copy link
Member Author

Choose a reason for hiding this comment

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

It could if we add a new base/portable platform. Would it make sense to keep only the ones without packs (for example, unix) here and do the processing of KnownFrameworkReference / KnownRuntimePack for the corresponding target framework in Microsoft.NET.Sdk.targets when needed then?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to process the KnownFrameworkReference/KnownRuntimePack matching $(TargetFramework). Generated text looks like:

<_KnownRuntimeIdentifersForTfm Include="@(KnownRuntimePack->WithMetadataValue('TargetFramework', $(TargetFramework))->Metadata('RuntimePackRuntimeIdentifiers'))" />
<_KnownRuntimeIdentifersForTfm Include="@(KnownFrameworkReference->WithMetadataValue('TargetFramework', $(TargetFramework))->Metadata('RuntimePackRuntimeIdentifiers'))" />
<_KnownRuntimeIdentifersForTfmWithPlatform Include="@(_KnownRuntimeIdentifersForTfm->ClearMetadata()->Distinct())">
  <Platform Condition="$([System.String]::new('%(Identity)').LastIndexOf('-')) == -1">%(Identity)</Platform>
  <Platform Condition="$([System.String]::new('%(Identity)').LastIndexOf('-')) != -1">$([System.String]::new('%(Identity)').Substring(0, $([System.String]::new('%(Identity)').LastIndexOf('-'))))</Platform>
</_KnownRuntimeIdentifersForTfmWithPlatform>

<_KnownRuntimeIdentiferPlatforms Include="any;aot;freebsd;illumos;solaris;unix" />
<_KnownRuntimeIdentiferPlatforms Include="@(_KnownRuntimeIdentifersForTfmWithPlatform->Metadata('Platform')->ClearMetadata()->Distinct())" Exclude="rhel.6;tizen.4.0.0;tizen.5.0.0" />

Is there a better way to do this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved the processing of the runtime packs to the SDK and kept the ones that don't have associated packs here. There's also the exclusion of the few platforms that have packs that we don't consider portable - since this can generate it only if those aren't the same platform as whatever is being used for a non-portable source-build.

…ntimeIdentifierPlatforms for current target framework
@marcpopMSFT marcpopMSFT requested a review from dsplaisted June 7, 2023 18:39
Copy link
Member

@dsplaisted dsplaisted left a comment

Choose a reason for hiding this comment

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

Looks good.

Comment on lines +329 to +332
<_ExcludedKnownRuntimeIdentiferPlatforms Include="rhel.6;tizen.4.0.0;tizen.5.0.0" Condition="'$(DotNetBuildFromSource)' != 'true'" />
<_ExcludedKnownRuntimeIdentiferPlatforms Include="rhel.6" Condition="'$(DotNetBuildFromSource)' == 'true' and !$(ProductMonikerRid.StartsWith('rhel.6-'))" />
<_ExcludedKnownRuntimeIdentiferPlatforms Include="tizen.4.0.0" Condition="'$(DotNetBuildFromSource)' == 'true' and !$(ProductMonikerRid.StartsWith('tizen.4.0.0-'))" />
<_ExcludedKnownRuntimeIdentiferPlatforms Include="tizen.5.0.0" Condition="'$(DotNetBuildFromSource)' == 'true' and !$(ProductMonikerRid.StartsWith('tizen.5.0.0-'))" />
Copy link
Member

Choose a reason for hiding this comment

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

I don't really understand this part. Is there a reason that the list can't be the same whether we're building from source or not? And should the RID parsing in ProcessFrameworkReferences be removing the versions from the platforms so we don't have to do it here?

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 basically wanted to exclude those three non-portable RIDs (that we have runtime packs for) except if we are building from source and the non-portable RID (without the architecture) being used by source build matches one of them. We could also do it in the SDK based on NETCoreSdkRuntimeIdentifier, but I figured since we had all the information at generation time I'd add the logic in the generation and keep the actual SDK logic simpler.

I think we need to keep the versions. For example, if it is a non-portable source build for rhel.8, we want rhel.8 to be considered as known (and not warn), but rhel or rhel.9 should not be known (and should warn).

<WindowsDesktop50RuntimePackRids Include="@(WindowsDesktop31RuntimePackRids);win-arm64" />
<WindowsDesktopRuntimePackRids Include="@(WindowsDesktop50RuntimePackRids)" />

<_KnownRuntimeIdentiferPlatforms Include="any;aot;freebsd;illumos;solaris;unix" />
Copy link
Member

Choose a reason for hiding this comment

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

@elinor-fung first time I see an aot RID, is there an issue/design for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants