-
Notifications
You must be signed in to change notification settings - Fork 347
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
Build component is executed twice when adding dependency with TryDependentFor #1000
Comments
Hey @Sam13 - I haven't traced the issue but would propose you look at the Nuke build project and at the implementation in the Nuke.Components package for the patterns used there. And how the interplay of I see it as the intention for your restore case is to:
If that interface isn't included in the Alternatively if it is more of a one off thing, think of your additional restore step as I am on Discord if you want to DM me and discuss this more. Not dismissing that this might be a bug - but pushing you towards the approach the library is using itself. |
Hello @ron-myers |
Also happens with Nuke v6.2.1 |
Usage Information
Nuke v6.1.2, .NET SDK 6.0.400, .NET 6, all OS
Description
Given the following Nuke build:
https://github.com/Sam13/nuke-build-components-dependencies-investigation/blob/5d17ee622887607c41f694d3a2f4f9a4f0984b09/build/Build.cs
I have generic IRestore and ICompile components which have two different implementations each.
Considered the rare use case for which I want to execute both implementations for one build component (e.g. IRestore) the restore build component is executed twice when having a TryDependentFor to the other build component.
Nuke summary output:
Removal of TryDependentFor https://github.com/Sam13/nuke-build-components-dependencies-investigation/blob/5d17ee622887607c41f694d3a2f4f9a4f0984b09/build/Build.cs#L23 fixes the problem.
Also other declaration of build component interface implementations will fix the problem (see commits 68d969e22843171b4073d5cb359300e3844a62fe, 999f1e1ef70d61d16860f92cf04ed9e05d3290c9).
Is this a bug or incorrect usage of build components?
Reproduction Steps
Execute https://raw.githubusercontent.com/Sam13/nuke-build-components-dependencies-investigation/5d17ee622887607c41f694d3a2f4f9a4f0984b09/build/Build.cs
Expected Behavior
Build component Restore only executed once
Actual Behavior
Build component Restore executed twice (different implementations)
Regression?
Don't know
Known Workarounds
https://github.com/Sam13/nuke-build-components-dependencies-investigation/blob/68d969e22843171b4073d5cb359300e3844a62fe/build/Build.cs
or
https://github.com/Sam13/nuke-build-components-dependencies-investigation/blob/999f1e1ef70d61d16860f92cf04ed9e05d3290c9/build/Build.cs
The text was updated successfully, but these errors were encountered: