cake-build / cake

:cake: Cake (C# Make) is a cross platform build automation system.
https://cakebuild.net
MIT License
3.84k stars 722 forks source link

GH4278: Update Spectre.Console to 0.48.0 #4279

Open devlead opened 7 months ago

devlead commented 7 months ago
devlead commented 7 months ago

It would seem Spectre.Console 0.48.0 has a breaking change with settings like

https://github.com/cake-build/cake/blob/ed612029b92f5da2b6cbdfe295c62e6b99a2963d/src/Cake/Commands/DefaultCommandSettings.cs#L55-L57

This test fails

https://github.com/cake-build/cake/blob/ed612029b92f5da2b6cbdfe295c62e6b99a2963d/src/Cake.Tests/Unit/ProgramTests.cs#L101-L104

only the last --ver works.

image

not investigated the root cause fully.

devlead commented 7 months ago

Found the issue Spectre.Console.Cli no longer allows default commands to have a --version parameter, which Cake relied on to have it's own custom version command.

https://github.com/spectreconsole/spectre.console/commit/131b37fff858f8d5dd483ff369bb3d43a07c1e08#diff-d38c9fa48d9c39f8eec58957b2333d13943f2cbe1adee26f30325e527a56f600L26-R41

Will see if I can find away around that, can't use the default Spectre version command as it will produce a version string that will break Cake cli contract. Overriding command settings ApplicationVersion and removing cake version feature should probably achieve the same result for end user.

devlead commented 7 months ago

As it's by design breaking change in Spectre.Console.Cli, I just added a workaround to opt-out of this behavior for Cake.Tool.