Skip to content

Fix clean and rebuild targets#33758

Merged
Anipik merged 1 commit into
dotnet:masterfrom
Anipik:fixClean
Mar 24, 2020
Merged

Fix clean and rebuild targets#33758
Anipik merged 1 commit into
dotnet:masterfrom
Anipik:fixClean

Conversation

@Anipik

@Anipik Anipik commented Mar 19, 2020

Copy link
Copy Markdown
Contributor

Fixes #33721

The failure here was that we were automatically adding ProjectReference if the src builds for X tfm and we dont have corresponding ref.

And we were hitting the error because some of the src tfms dont have a comapatible configs in the ref csproj, rather they depend on restore to resolve those ref assemblies.

Clean target behavior:- it will run for all tfms of the source project

@ericstj

ericstj commented Mar 19, 2020

Copy link
Copy Markdown
Member

Looks like this broke all configurations build.

F:\workspace\_work\1\s\.packages\microsoft.dotnet.apicompat\5.0.0-beta.20168.1\build\Microsoft.DotNet.ApiCompat.targets(49,5): error : ResolvedMatchingContract item must be specified to run API compat. [F:\workspace\_work\1\s\src\libraries\Microsoft.Extensions.DependencyInjection\src\Microsoft.Extensions.DependencyInjection.csproj]
##[error].packages\microsoft.dotnet.apicompat\5.0.0-beta.20168.1\build\Microsoft.DotNet.ApiCompat.targets(49,5): error : ResolvedMatchingContract item must be specified to run API compat.

This is the first src project that builds that needs to run API compat. I believe this is because we don't binplace for every configuration.

@Anipik

Anipik commented Mar 19, 2020

Copy link
Copy Markdown
Contributor Author

The ref assembly for only this project Microsoft.Extensions.DependencyInjection.csproj is not getting built or something is deleting it

@ericstj

ericstj commented Mar 19, 2020

Copy link
Copy Markdown
Member

Hmm, sounds like you're right. This build is happening very late after ref/src during pkg build. I think this is because the pkgproj exists, but these projects are excluded from ref.builds/src.builds. The place to look for the problem is

<ItemGroup>
<PortedExtensionsProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Caching.Abstractions\**\*csproj" />
<PortedExtensionsProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Configuration\**\*csproj" />
<PortedExtensionsProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Configuration.Abstractions\**\*csproj" />
<PortedExtensionsProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Configuration.Binder\**\*csproj" />
<PortedExtensionsProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Configuration.CommandLine\**\*csproj" />
<PortedExtensionsProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Configuration.EnvironmentVariables\**\*csproj" />
<PortedExtensionsProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.DependencyInjection.Abstractions\**\*csproj" />
<PortedExtensionsProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.FileProviders.*\**\*csproj" />
<PortedExtensionsProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.FileSystemGlobbing\**\*csproj" />
<PortedExtensionsProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Hosting.Abstractions\**\*csproj" />
<PortedExtensionsProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Logging.Abstractions\**\*csproj" />
<PortedExtensionsProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Options.*\**\*csproj" />
<PortedExtensionsProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Primitives\**\*csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)*\ref\**\Microsoft.Extensions.*proj" Exclude="@(PortedExtensionsProject)" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)*\src\**\Microsoft.Extensions.*proj" Exclude="@(PortedExtensionsProject)" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)*\tests\Microsoft.Extensions.*.Tests.csproj" Exclude="@(PortedExtensionsProject)" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)*\tests\FunctionalTests\Microsoft.Extensions.Configuration.Functional.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)*\tests\Common\test\Microsoft.Extensions.Logging.Testing.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)*\tests\FunctionalTests\Microsoft.Extensions.Hosting.Functional.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)*\tests\TestApp\Microsoft.Extensions.Hosting.TestApp.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)*\tests\UnitTests\Microsoft.Extensions.Hosting.Unit.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)*\tests\Common\Microsoft.Extensions.Logging.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Common\tests\Extensions\**\*.csproj" />
</ItemGroup>
. /cc @maryamariyan

@Anipik

Anipik commented Mar 19, 2020

Copy link
Copy Markdown
Contributor Author

We are missing the DependencyInjection Project in the list

Comment thread src/libraries/Directory.Build.props Outdated
@ericstj

ericstj commented Mar 19, 2020

Copy link
Copy Markdown
Member

Or maybe pkgproj exists and package.builds isn't honoring exclusion. @maryamariyan is DI ready to build (ref/src/test/pkg)?

@maryamariyan

maryamariyan commented Mar 19, 2020

Copy link
Copy Markdown
Contributor

NO. DI build is OK but not tests. Tests is why I disabled it

@maryamariyan

Copy link
Copy Markdown
Contributor

here: #33816

@Anipik

Anipik commented Mar 19, 2020

Copy link
Copy Markdown
Contributor Author

NO. DI build is OK but not tests. Tests is why I disabled it

we can build src and ref and skip the tests in order to unblock here. @maryamariyan what is causing the dependency Injection src project to build ? is it the package builds ?

@ericstj

ericstj commented Mar 20, 2020

Copy link
Copy Markdown
Member

what is causing the dependency Injection src project to build ? is it the package builds ?

Yeah, the existence of pkgproj will cause that. We didn't exclude pkgproj from the *.builds file. If you wanted to make progress on this you could rename the pkgproj then let @maryamariyan rename it back, or just wait for her fix. I'd prefer the latter since this isn't blocking anything.

@Anipik Anipik merged commit 535d957 into dotnet:master Mar 24, 2020
@Anipik Anipik deleted the fixClean branch March 24, 2020 14:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to build System.Runtime.WindowsRuntime

5 participants