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

Exclude WPF projects from source-build #5180

Merged
merged 1 commit into from May 31, 2023
Merged

Conversation

mthalman
Copy link
Contributor

Bug

Fixes: dotnet/source-build#3467

Regression? Last working version: Break caused by #5167

Description

The changes in #5167 updated projects to use SDK-style projects which caused them to be recognized by .NET's source-build infrastructure. Source-build attempted to build these projects and some of them ended up failing because they are defined as WPF projects which uses the Windows Desktop SDK. That fails in source-build because it only supports targeting for Linux.

This is fixed by updating the build system to exclude these two WPF projects from source-build. This follows the same pattern that is used by other .NET repos which are based on Arcade. But since the NuGet.Client repo doesn't use Arcade, a custom solution had to be implemented. Much of this implementation was taken directly from Arcade and adjusted to work in this repo. First, the relevant WPF-based projects are updated to set ExcludeFromSourceBuild to true. The build logic then works by checking whether .NET source-build is enabled (DotNetBuildFromSource) and whether the project is excluded from source-build. If so, it overrides all the necessary MSBuild targets of the project so that it results in a no-op. This effectively causes the projects to be skipped from source-build.

PR Checklist

  • PR has a meaningful title

  • PR has a linked issue.

  • Described changes

  • Tests

    • Automated tests added
    • OR
    • Test exception
    • OR
    • N/A
  • Documentation

    • Documentation PR or issue filled
    • OR
    • N/A

@mthalman mthalman requested a review from a team as a code owner May 23, 2023 21:19
@ghost ghost added the Community PRs created by someone not in the NuGet team label May 23, 2023
@mthalman
Copy link
Contributor Author

cc @MichaelSimons for review

@jeffkl jeffkl self-assigned this May 30, 2023
@jeffkl jeffkl merged commit 5335409 into NuGet:dev May 31, 2023
39 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community PRs created by someone not in the NuGet team
Projects
None yet
3 participants