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

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

Merged

Conversation

lbussell
Copy link

@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
Copy link
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
Author

lbussell commented Feb 3, 2022

Will merge once the bootstrap here passes.

@lbussell
Copy link
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 <loganbussell@microsoft.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Sean Reeser <v-seanreeser@microsoft.com>
Co-authored-by: Manodasan Wignarajah <mawign@microsoft.com>
Co-authored-by: William Godbe <wigodbe@microsoft.com>
Co-authored-by: vseanreesermsft <78103370+vseanreesermsft@users.noreply.github.com>
Co-authored-by: Michael Simons <msimons@microsoft.com>
Co-authored-by: Chris Rummel <crummel@microsoft.com>
Co-authored-by: Omair Majid <omajid@redhat.com>
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