cake-build/cake

Implicit bootstrapping of modules

gep13 opened this issue ยท 12 comments

gep13 commented

Currently, when using Cake Modules, if it first necessary to do something like the following:

.\build.ps1 --bootstrap

To force Cake to first check and download any Modules that are included within the Cake Script, and then you run the build as normal:

.\build.ps1

This is a minor change to the default bootstrapper to make this happen, however, it would be very nice, if possible, that Cake implicitly did this check and download for any modules added to the Cake, so that it is a single execution of Cake.

gep13 commented

@cake-build/cake-team switching this to a breaking change, since we are removing the --bootstrap option, from what I can see.

@gep13 @cake-build/cake-team Not sure if I would call it a breaking change. --bootstrap parameter will not throw or return an error, and bootstrapping will still be performed so scripts will continue to work as expected.

This isn't a breaking change, just tried to build Cake with cake using 1.0.0-GH-2833-0001 in a clean repo, and it runs

& "$CakeExePath" ./build.cake --bootstrap
if ($LASTEXITCODE -eq 0)
{
    & "$CakeExePath" ./build.cake $args
}
exit $LASTEXITCODE
gep13 commented

@devlead did it run the build twice?

If so, if it isn't a breaking change, then it should be a breaking change.

@devlead did it run the build twice?

If so, if it isn't a breaking change, then it should be a breaking change.

@gep13 It only ran the build once, so no change in behavior.

gep13 commented

so this:

& "$CakeExePath" ./build.cake --bootstrap

Is a no-op? If the bootstrap option is being removed, how is it doing this? If I misread the PR when I had a brief look at it, I apologise.

Ah no your correct, but that should be corrected in the PR imho, I'll give that feedback on PR.

As a side note, the same would be true for cake-build/cake-action. Existing workflows can still pass the cake-bootstrap parameter and it just wouldn't be passed on to the Cake executable.

Wouldn't it make sense for --bootstrap to continue to be a known (but hidden) parameter that does a no-op, to avoid existing build pipelines to run the cake build process twice? The same goes for cake-build/cake-action.

& "$CakeExePath" ./build.cake --bootstrap
# Does nothing, displays an info message explaining --bootstrap is no longer needed
# Returns 0 in exit code to let the script to continue
if ($LASTEXITCODE -eq 0)
{
    & "$CakeExePath" ./build.cake $args
}
exit $LASTEXITCODE

It's not a noop in the current PR or works as previously. So no breaking change there.

Only difference is that it'll also run implicitly without extra step when you execute scripts unless you opt out.

Only difference is that it'll also run implicitly without extra step when you execute scripts unless you opt out.

Got it. Thanks. So only the bootstrap process would run twice in the scenario above.

๐ŸŽ‰ This issue has been resolved in version v1.0.0 ๐ŸŽ‰

The release is available on:

Your GitReleaseManager bot ๐Ÿ“ฆ๐Ÿš€