-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Fix toolset package failing to build from clean state in VS #78251
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -13,12 +13,13 @@ | |||
|
||||
This package is primarily intended as a method for rapidly shipping hotfixes to customers. Using it as a long term solution for providing newer compilers on older MSBuild installations is explicitly not supported. That can and will break on a regular basis. | ||||
|
||||
The supported mechanism for providing new compilers in a build enviroment is updating to the newer .NET SDK or Visual Studio Build Tools SKU. | ||||
The supported mechanism for providing new compilers in a build environment is updating to the newer .NET SDK or Visual Studio Build Tools SKU. | ||||
|
||||
This package requires either MSBuild 16.3 and .NET Desktop 4.7.2+ or .NET Core 2.1+ | ||||
|
||||
$(RoslynPackageDescriptionDetails) | ||||
</PackageDescription> | ||||
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);_GetFiles</TargetsForTfmSpecificContentInPackage> | ||||
<!-- Remove NU5128 once https://github.com/NuGet/Home/issues/8583 is fixed --> | ||||
<NoWarn>$(NoWarn);NU5100;NU5128</NoWarn> | ||||
|
||||
|
@@ -61,10 +62,12 @@ | |||
<TfmSpecificPackageFile Include="@(_FileWithPath)" PackagePath="%(_FileWithPath.TargetPath)" /> | ||||
</ItemGroup> | ||||
|
||||
<!-- Used for debugging parts of the toolset (e.g., build tasks). --> | ||||
<!-- Used for debugging parts of the toolset (e.g., build tasks). | ||||
Doesn't work in VS (where `<ProjectReference Targets="Publish" />` doesn't have any effect), hence we set `ContinueOnError="true"`. --> | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. D'oh I forgot to delete this comment. |
||||
<Copy SourceFiles="@(_FileWithPath)" | ||||
DestinationFiles="$(BaseOutputPath)$(Configuration)\%(_FileWithPath.TargetPath)" | ||||
SkipUnchangedFiles="true" /> | ||||
SkipUnchangedFiles="true" | ||||
ContinueOnError="true" /> | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we instead condition on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah we don't want this running in design time builds either. That AfterTargets="Build" really needs to go since that's still going to cause issues here. I'm going to make another push to this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It's easier to delete it than it is to convince ourselves it's correct in all situations. 😄 The problem is there's enough special types of builds that do strange things with project references that it's just not really safe to make the assumption. For example, you can also do a command line build passing a property to not build dependencies, and I'm not sure what that would do. So yes, we could add a condition to remove DesignTimeBuilds, but if we just delete the AfterTargets="Build" we don't have to do anything in the first place. Less is more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is one potential workflow change if you did like the ability to just do a build and see the files; that said we're adding I/O for copies for the 99.9% of the time people don't need that. If we wanted to refactor this a bit we could have an explicit target do the copy and you can do that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not just that I like the workflow, I've added it so it can be used for debugging, e.g.: Line 103 in 489d016
That being said, there could probably be a property to opt in to it when needed. |
||||
</Target> | ||||
|
||||
<Import Project="..\DesktopCompilerArtifacts.targets" Condition="'$(TargetFramework)' == 'net472'" /> | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that there was any doubt, but I did a
git blame
and yeah this was my fault.