Skip to content

Conversation

@lbussell
Copy link
Member

@lbussell lbussell commented Jan 20, 2022

Addresses dotnet/roslyn#57342

When building roslyn in a bootstrapped source-build scenario (i.e. building with a version of the SDK that has been previously source-built), any projects with <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> fail to build.

This PR works around that by using the SourceBuiltSdkResolver to override references to Microsoft.NET.Sdk.WindowsDesktop. The references will now point to a new EmptySdk in the source tarball's tools-local/ directory. This SDK stubs out the usual build, pack, restore, etc. targets so that these Roslyn projects don't get built during source-build.

A new patch is also added, since even though these projects won't be built, we still need
to condition out some targets and imports that won't be around during
source-build or that are missing due to overriding the WindowsDesktop SDK.

The patch is no longer needed, since the RepositoryEngineeringDir variable can be defined in the empty sdk to prevent file not found errors when loading some props/targets files.

@lbussell lbussell requested a review from a team as a code owner January 20, 2022 18:56
@lbussell lbussell marked this pull request as draft January 20, 2022 18:56
@lbussell
Copy link
Member Author

@lbussell lbussell marked this pull request as ready for review January 25, 2022 17:15
@MichaelSimons
Copy link
Member

@lbussell - Thoughts on starting the process to backport the new patch. Once approved, update the patch here as necessary and then merge.

Copy link
Member

@MichaelSimons MichaelSimons left a comment

Choose a reason for hiding this comment

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

:shipit:

@lbussell
Copy link
Member Author

lbussell commented Feb 3, 2022

Will merge once the bootstrap here passes.

@lbussell
Copy link
Member Author

lbussell commented Feb 7, 2022

The only failure is due to artifact upload with multiple attempts, the build and bootstrap passes all tests. Merging.

@lbussell lbussell merged commit 7d14092 into dotnet:release/6.0.1xx Feb 7, 2022
MichaelSimons added a commit that referenced this pull request Mar 5, 2022
* Update .vsts-ci.yml

* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220205.1 (#13179)

[release/6.0.1xx] Update dependencies from dotnet/source-build-reference-packages

* Override Microsoft.Net.Sdk.WindowsDesktop references during source-build in Roslyn (#13093)

* override SDK for Microsoft.Net.Sdk.WindowsDesktop references in roslyn

* add new EmptySdk in the source build tarball

* remove roslyn solution filter patch

* Update dependencies from https://github.com/dotnet/arcade build 20220207.2 (#13186)

Microsoft.DotNet.CMake.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
 From Version 6.0.0-beta.22102.3 -> To Version 6.0.0-beta.22107.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* [release/6.0.1xx] Windows SDK projection update

* Update asp.net templates (#13193)

* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220210.1 (#13215)

[release/6.0.1xx] Update dependencies from dotnet/source-build-reference-packages

* Add test to compare msft and sb sdk contents (#13153)

* Update to SDK and previously-source-built 6.0.102. (#13221)

* Add CentOS Stream 9 container to CI matrix (#12955)

* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220215.1 (#13229)

[release/6.0.1xx] Update dependencies from dotnet/source-build-reference-packages

* Gather additional smoke test prereqs (#13233)

* Remove bootstrapping for CI builds now that we use CentOS7 previously-source-built (#13232)

* Update Version.Details.xml

* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220303.2

Microsoft.SourceBuild.Intermediate.source-build-reference-packages
 From Version 6.0.0-servicing.22151.1 -> To Version 6.0.0-servicing.22153.2

Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Logan Bussell <[email protected]>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Sean Reeser <[email protected]>
Co-authored-by: Manodasan Wignarajah <[email protected]>
Co-authored-by: William Godbe <[email protected]>
Co-authored-by: vseanreesermsft <[email protected]>
Co-authored-by: Michael Simons <[email protected]>
Co-authored-by: Chris Rummel <[email protected]>
Co-authored-by: Omair Majid <[email protected]>
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.

2 participants