-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add more packages to Version.Details for source-build #8940
Conversation
I think the problem is msbuild/src/Tasks/Microsoft.Build.Tasks.csproj Lines 1016 to 1018 in dfa7f02
We no longer support that build configuration (it's for pre-unification Mono, not the current mono runtime). Would it be helpful to sourcebuild if we scrubbed that + the |
Yeah, me neither. It looks like it's only set if the build config is |
Aha. msbuild/src/Build/Microsoft.Build.csproj Lines 38 to 39 in 08c135d
But SRM is a transitive dependency of Then in
So SRM is the new, consistent, sourcebuilt version. But |
@mthalman I appologize - but I'm bit lost :-)
|
@JanKrivanek yes, the Mono thing was a red herring I think. It looks like what must be listed is "any transitive dependency that is also listed as a direct dependency in some other project". |
Contributes to dotnet/source-build#3528
Context
When attempting to run an MSBuild command from an SDK that was source-built using the Mono runtime, the following exception occurs:
This is a regression caused by the change in dotnet/installer#16637. That change allowed the msbuild repo to compile against the package versions that it defines rather than source-build overriding the package version with the current source-built version. For example, the msbuild repo will target System.Reflection.MetadataLoadContext.7.0.0:
msbuild/eng/Versions.props
Line 38 in 83ac8d9
Prior to the change in dotnet/installer#16637, source-build would have overridden that version and forced the msbuild repo to use the version of
System.Reflection.MetadataLoadContext
that was just produced during its build. But after the change, the 7.0.0 version is being referenced. The referencing of a 7.0.0 version doesn't cause prebuilts because that version is defined in SBRP.Referencing a 7.0.0 version is fine as long as it's only a build-time dependency and not runtime. A runtime dependency will cause an attempt to load that 7.0.0 version which will not exist for an 8.0 source-built SDK. That's exactly what happens here with this error. There must be some code path specific to Mono that causes a code path which depends on
System.Reflection.MetadataLoadContext
.Changes Made
Added the following packages to Version.Details.xml:
System.Collections.Immutable.7.0.0
System.Reflection.Metadata.7.0.0
System.Reflection.MetadataLoadContext.7.0.0
Their presence in this file will cause source-build to override the corresponding
Version
property (e.g.SystemReflectionMetadataLoadContextVersion
) so that it uses the "live" version (the version just produced by source-build in the current build). Even though the dependency only exists onSystem.Reflection.MetadataLoadContext
, the other two packages need to be listed as well since those are transitive dependencies. Not listing them would cause package downgrade errors since a newer version ofSystem.Reflection.MetadataLoadContext
would be referenced with older versions of the other assemblies.I've also updated the comments in this file so that they are applied to each package. This avoids ambiguity as to which packages the original comment applied to.