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

Microsoft.Bcl.TimeProvider 8.0.1 contains incorrect linker substitution resources #109163

Open
filipnavara opened this issue Oct 23, 2024 · 6 comments
Labels
area-System.DateTime linkable-framework Issues associated with delivering a linker friendly framework
Milestone

Comments

@filipnavara
Copy link
Member

Microsoft.IdentityModel.Tokens recently added a dependency on Microsoft.Bcl.TimeProvider 8.0.1 which uncovered a publishing error. The package contains Microsoft.Bcl.TimeProvider.dll for .NET 8 that contains an ILLink.Substitutions.xml resource with the following content:

<linker>
  <assembly fullname="Microsoft.Bcl.TimeProvider" feature="System.Resources.UseSystemResourceKeys" featurevalue="true">
    <!-- System.Resources.UseSystemResourceKeys removes resource strings and instead uses the resource key as the exception message -->
    <resource name="FxResources.Microsoft.Bcl.TimeProvider.SR.resources" action="remove" />
    <type fullname="System.SR">
      <method signature="System.Boolean UsingResourceKeys()" body="stub" value="true" />
    </type>
  </assembly>
</linker>

There are, however, no other resources in the .dll and the script generates the following errors during publish:

resource ILLink.Substitutions.xml in Microsoft.Bcl.TimeProvider, Version=8.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51(5,6): error IL2008: Microsoft.Bcl.TimeProvider: Could not resolve type 'System.SR'. [/Users/teamcity/actions-runner/_work/emclient/emclient/MailClient/MailClient.csproj::TargetFramework=net8.0-macos]
resource ILLink.Substitutions.xml in Microsoft.Bcl.TimeProvider, Version=8.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51(4,6): error IL2040: Microsoft.Bcl.TimeProvider: Could not find embedded resource 'FxResources.Microsoft.Bcl.TimeProvider.SR.resources' to remove in assembly 'Microsoft.Bcl.TimeProvider'. [/Users/teamcity/actions-

This affects all the net8.0-macos / net8.0-ios builds because they run ILLink as part of the build process.

It seems that the 9.0.0-rc.2.24473.5 version of the package doesn't suffer from this authoring issue. Is it safe to migrate to the new version? What's the guidance for bumping the NuGet version number in transitive references? Should I suggest the Azure AD team (https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet) to bump the dependency to the 9.0.0-rc2 version? /cc @FuPingFranco

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Oct 23, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-resources
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-datetime
See info in area-owners.md if you want to be subscribed.

@Clockwork-Muse
Copy link
Contributor

... They shouldn't need that package for .NET 8+, since that's the compat package to enable System.TimeProvider on previous versions. Probably Microsoft.IdentityModel.Tokens should condition the dependency.

@filipnavara
Copy link
Member Author

Good point :-) I didn't realize they ship net8.0 and net9.0 assets.

@tarekgh
Copy link
Member

tarekgh commented Oct 24, 2024

I think it would be a good idea to set the property GenerateResourcesSubstitutions to false to avoid executing the target GenerateResourcesSubstitutionFile and insert the link file in the resources. In .NET we always type forwarding and down-levels doesn't need it anyway

@tarekgh tarekgh added this to the Future milestone Oct 24, 2024
@tarekgh tarekgh added linkable-framework Issues associated with delivering a linker friendly framework and removed untriaged New issue has not been triaged by the area owner labels Oct 24, 2024
Copy link
Contributor

Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.DateTime linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

No branches or pull requests

3 participants