dotnet / source-build

A repository to track efforts to produce a source tarball of the .NET Core SDK and all its components
MIT License
265 stars 132 forks source link

Undetected prebuilt at repo level when using pinned package version #3566

Open mthalman opened 1 year ago

mthalman commented 1 year ago

The scenario described in https://github.com/dotnet/source-build/issues/3557 demonstrates that it's possible for product repos to define their Version.props files in such a way that can cause prebuilts to go undetected until the full source-build.

This happens when a dependency is defined in Version.Details.xml and a custom property is defined in Version.props (with the same version as Version.Details) that projects reference for the package version. This will cause the repo build to be prebuilt clean because the package comes from the referenced source-build intermediates. But in the full source-build, the dependency may have a higher version than is referenced in the repo. But because the repo is pinned to the version defined in its Version.props file, a prebuilt occurs.

For example, aspnet defines a dependency on Microsoft.CodeAnalysis.Common 4.7.0-x. It defines a custom property with that version that projects use for the version of their project reference. Because it's a custom property, source-build can't naturally override that. During aspnet's build, it loads 4.7.0-x which comes from roslyn's SB intermediate and thus is not detected as a prebuilt. But during the full source-build, roslyn produces 4.8.0-x while aspnetcore still loads 4.7.0-x. This causes the prebuilt. This is described at https://github.com/dotnet/source-build/issues/3557#issuecomment-1649870868.

We should investigate whether there are ways to catch this at the repo level.

dotnet-issue-labeler[bot] commented 1 year ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.