Skip to content

Don't rebuild default targets without --force#15

Open
idbrii wants to merge 1 commit intopfirsich:masterfrom
idbrii:fix-rebuild-default-targets
Open

Don't rebuild default targets without --force#15
idbrii wants to merge 1 commit intopfirsich:masterfrom
idbrii:fix-rebuild-default-targets

Conversation

@idbrii
Copy link
Contributor

@idbrii idbrii commented Mar 31, 2021

Fix makelove will rebuild default targets.

prepare_build_directory aborts the build if we're rebuilding targets
(unless forced). It checked input targets and not default targets, so it
wouldn't abort for any targets that are only built as defaults.

Now we get the full target list first before doing any checks.

Fix `makelove` will rebuild default targets.

prepare_build_directory aborts the build if we're rebuilding targets
(unless forced). It checked input targets and not default targets, so it
wouldn't abort for any targets that are only built as defaults.

Now we get the full target list first before doing any checks.
@pfirsich
Copy link
Owner

I'm so sorry, but I am not sure if I understand the issue correctly. You are doing versioned builds right? And if you try to rebuild a version + target combination that has already been built, without passing --force, it should error out. But if you don't pass a target explicitly, it will not error out, but instead silently rebuild the default targets, right? And you think (I probably agree), that it should error out as well, unless --force is passed?

@idbrii
Copy link
Contributor Author

idbrii commented Sep 4, 2021

Yeah, that's right. Example:

Before

$ makelove --version-name 1.0.1751380
Loading config from default path 'makelove.toml'
Found conf.lua
Assuming default löve version '11.3'
Building version '1.0.1751380'
Building targets: win32
Assembling game directory..
Created build\1.0.1751380\love\game.love
>> Building target win32
No love binaries specified for target win32
Love binaries already present in 'C:\blah\makelove\Cache\love-binaries\11.3\win32'
Target win32 complete

Versioned build overwritten!

After fix-rebuild-default-targets

$ makelove --version-name 1.0.1751380
Loading config from default path 'makelove.toml'
Found conf.lua
Assuming default löve version '11.3'
Building version '1.0.1751380'
Cannot rebuild an already built version + target combination. Remove it manually first or pass --force to overwrite it

$ makelove --version-name 1.0.1751380 --force
Loading config from default path 'makelove.toml'
Found conf.lua
Assuming default löve version '11.3'
Building version '1.0.1751380'
Building targets: win32
Assembling game directory..
Created build\1.0.1751380\love\committhebad.love
>> Building target win32
No love binaries specified for target win32
Love binaries already present in 'C:\blah\makelove\Cache\love-binaries\11.3\win32'
Target win32 complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants