-
Notifications
You must be signed in to change notification settings - Fork 249
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
GeneratePackageOnBuild should not set NoBuild. #7801
Comments
This is difficult to do in 5.0...and we are busy driving towards ZBB for that. Would love to have somebody dig into this in the next few weeks. |
I hit some related issues while messing with the 3.0.0 SDK. The plan is the fix the issues for 3.0 only, correct? We're nearing escrow for 5.1, and if this is 3.0 only then there's no need to try to argue for it in 5.1 escrow |
That's correct, only 3.0 and landing in P6 would be fine. |
@peterhuene The first NuGet insertion into CLI/SDK that has 5.2.0 in the version will have this change. I'll try to remember to ping you when that happens :) |
NuGet/Home#7801 since nuget no longer sets NoBuild on GeneratePackageOnBuild we need to do similar logic to get the previous state.
NuGet/Home#7801 since nuget no longer sets NoBuild on GeneratePackageOnBuild we need to do similar logic to get the previous state.
* Fix GeneratePackageOnBuild with PackAsTool both on NuGet/Home#7801 since nuget no longer sets NoBuild on GeneratePackageOnBuild we need to do similar logic to get the previous state.
* Fix GeneratePackageOnBuild with PackAsTool both on NuGet/Home#7801 since nuget no longer sets NoBuild on GeneratePackageOnBuild we need to do similar logic to get the previous state.
* Fix GeneratePackageOnBuild with PackAsTool both on NuGet/Home#7801 since nuget no longer sets NoBuild on GeneratePackageOnBuild we need to do similar logic to get the previous state.
What I did is essentially write a different dependency graph in GeneratePackageOnBuild = true to avoid circular dependency . Original bug. I added the https://github.com/dotnet/sdk/pull/3255/files and essentially regressed NuGet/Home#7801. Instead of the logic is in nuget, it is in SDK now. Publish should not skip Build if GeneratePackageOnBuild is true. Or it will mean no build even use Publish verb. But revert 3255 means, dotnet#2114 will be back. The solution is to break Pack’s dependency on Build in GeneratePackageOnBuild. But it still need Publish. So I need to let Pack depend directly on no build version of publish. > Why cannot directly use “_PublishNoBuildAlternative”? We want to exclude Build step regardless NoBuild flag is true or not. > Will it work this time? It will, since I have GeneratePackageOnBuild + PackAsTool + Publish/Build/Pack all combinations covered in tests. Although I did discover GeneratePackageOnBuild+Pack dotnet#3471 does not work. But it was there since 2.0. And without nuget help, we cannot easily fix it.
What I did is essentially write a different dependency graph in GeneratePackageOnBuild = true to avoid circular dependency . Original bug. I added the https://github.com/dotnet/sdk/pull/3255/files and essentially regressed NuGet/Home#7801. Instead of the logic is in nuget, it is in SDK now. Publish should not skip Build if GeneratePackageOnBuild is true. Or it will mean no build even use Publish verb. But revert 3255 means, dotnet#2114 will be back. The solution is to break Pack’s dependency on Build in GeneratePackageOnBuild. But it still need Publish. So I need to let Pack depend directly on no build version of publish. > Why cannot directly use “_PublishNoBuildAlternative”? We want to exclude Build step regardless NoBuild flag is true or not.
What I did is essentially write a different dependency graph in GeneratePackageOnBuild = true to avoid circular dependency . Original bug. I added the https://github.com/dotnet/sdk/pull/3255/files and essentially regressed NuGet/Home#7801. Instead of the logic is in nuget, it is in SDK now. Publish should not skip Build if GeneratePackageOnBuild is true. Or it will mean no build even use Publish verb. But revert 3255 means, dotnet#2114 will be back. The solution is to break Pack’s dependency on Build in GeneratePackageOnBuild. But it still need Publish. So I need to let Pack depend directly on no build version of publish. > Why cannot directly use “_PublishNoBuildAlternative”? We want to exclude Build step regardless NoBuild flag is true or not.
What I did is essentially write a different dependency graph in GeneratePackageOnBuild = true to avoid circular dependency . Original bug. I added the https://github.com/dotnet/sdk/pull/3255/files and essentially regressed NuGet/Home#7801. Instead of the logic is in nuget, it is in SDK now. Publish should not skip Build if GeneratePackageOnBuild is true. Or it will mean no build even use Publish verb. But revert 3255 means, dotnet#2114 will be back. The solution is to break Pack’s dependency on Build in GeneratePackageOnBuild. But it still need Publish. So I need to let Pack depend directly on no build version of publish. > Why cannot directly use “_PublishNoBuildAlternative”? We want to exclude Build step regardless NoBuild flag is true or not.
What I did is essentially write a different dependency graph in GeneratePackageOnBuild = true to avoid circular dependency . Original bug. I added the https://github.com/dotnet/sdk/pull/3255/files and essentially regressed NuGet/Home#7801. Instead of the logic is in nuget, it is in SDK now. Publish should not skip Build if GeneratePackageOnBuild is true. Or it will mean no build even use Publish verb. But revert 3255 means, dotnet#2114 will be back. The solution is to break Pack’s dependency on Build in GeneratePackageOnBuild. But it still need Publish. So I need to let Pack depend directly on no build version of publish. > Why cannot directly use “_PublishNoBuildAlternative”? We want to exclude Build step regardless NoBuild flag is true or not.
What I did is essentially write a different dependency graph in GeneratePackageOnBuild = true to avoid circular dependency . Original bug. I added the https://github.com/dotnet/sdk/pull/3255/files and essentially regressed NuGet/Home#7801. Instead of the logic is in nuget, it is in SDK now. Publish should not skip Build if GeneratePackageOnBuild is true. Or it will mean no build even use Publish verb. But revert 3255 means, #2114 will be back. The solution is to break Pack’s dependency on Build in GeneratePackageOnBuild. But it still need Publish. So I need to let Pack depend directly on no build version of publish. > Why cannot directly use “_PublishNoBuildAlternative”? We want to exclude Build step regardless NoBuild flag is true or not.
Details about Problem
See dotnet/cli#9656 and dotnet/cli#9581 for some additional context.
We have two problems in the .NET Core SDK for 3.0:
GeneratePackageOnBuild
in a project file fails to publish with a simpledotnet publish
if the project hasn't already been built. The root of the problem is that the publish targets also useNoBuild
to support the--no-build
option and expect the property to signify this. However, the pack targets are settingNoBuild
to true whenGeneratePackageOnBuild
is also true (see this line in the pack targets). This inadvertently turnsdotnet publish
intodotnet publish --no-build
whenGeneratePackageOnBuild
is true.--no-build
was specified (for publish in this case, but should also apply to pack). This would prevent unintentional changes to the build output files that are about to be packed or published when--no-build
is specified.We'd like to solve both issues, but doing so requires a change to both the .NET Core SDK and the pack targets.
On the SDK side, we're adding a check to see if
CoreBuild
gets invoked withNoBuild
set to true and we error in that case. This will catch bugs that inadvertently cause a build withNoBuild
set (dotnet/cli#9581). However, becauseNoBuild
gets set whenGeneratePackageOnBuild
is true, we have to skip the check whenGeneratePackageOnBuild
is true, for now at least.On the NuGet side, would it be possible to stop turning on
NoBuild
whenGeneratePackageOnBuild
is true and instead condition settingGenerateNuspecDependsOn
based onGeneratePackageOnBuild
?That is to say remove the set of
NoBuild
entirely (see source link above) and conditionGenerateNuspecDependsOn
like this:As far as I can determine, that should be a backwards compatible change on your side, while fixing dotnet/cli#9656.
Environment information
The text was updated successfully, but these errors were encountered: