X2CommunityCore / X2ModBuildCommon

An improved XCOM 2 mod build system
MIT License
5 stars 5 forks source link

Switching between debug/not scripts causes make cmdlet failure #16

Closed Xymanek closed 3 years ago

Xymanek commented 3 years ago

Steps to reproduce:

1) Build mod in default/release (must be successful) 2) Attempt to build the mod in debug

Expected outcome: success Actual outcome:;

Compiling base game scripts...
Log: Executing Class UnrealEd.MakeCommandlet
No scripts need recompiling.

Success - 0 error(s), 0 warning(s) (0 Unique Errors, 0 Unique Warnings)

Execution of commandlet took:  0.69 seconds

Compiled base game scripts.
Compiling mod scripts...
Log: Executing Class UnrealEd.MakeCommandlet
--------------------Core - Debug--------------------
Package Core was compiled in release mode, recompiling in debug
Error, Failed to delete ..\..\XComGame\Script\Core.u
Error, Failed to delete ..\..\XComGame\Script\GFxUI.u
Error, Failed to delete ..\..\XComGame\Script\GameFramework.u
Error, Failed to delete ..\..\XComGame\Script\IpDrv.u
Error, Failed to delete ..\..\XComGame\Script\OnlineSubsystemSteamworks.u
Error, Failed to delete ..\..\XComGame\Script\XComGame.u

Warning/Error Summary
---------------------
Error, Failed to delete ..\..\XComGame\Script\Core.u
Error, Failed to delete ..\..\XComGame\Script\GFxUI.u
Error, Failed to delete ..\..\XComGame\Script\GameFramework.u
Error, Failed to delete ..\..\XComGame\Script\IpDrv.u
Error, Failed to delete ..\..\XComGame\Script\OnlineSubsystemSteamworks.u
Error, Failed to delete ..\..\XComGame\Script\XComGame.u

Failure - 6 error(s), 0 warning(s) (6 Unique Errors, 0 Unique Warnings)

Execution of commandlet took:  3.93 seconds

Failed compiling mod scripts

3) Build again in debug

Compiling base game scripts...
Log: Executing Class UnrealEd.MakeCommandlet
--------------------Core - Debug--------------------
Package Core was compiled in release mode, recompiling in debug
Analyzing...
Scripts successfully compiled - saving package 'C:\Steam\steamapps\common\XCOM 2 War of the Chosen SDK\binaries\Win64\..\..\XComGame\Script\Core.u'
--------------------Engine - Debug--------------------
Analyzing...
Scripts successfully compiled - saving package 'C:\Steam\steamapps\common\XCOM 2 War of the Chosen SDK\binaries\Win64\..\..\XComGame\Script\Engine.u'
--------------------GFxUI - Debug--------------------

It appears that on the first build invocation the base game scripts make doesn't see that the mode has changed for some reason.

Note that building first in debug and then switching to release produces the exact same result

cc @robojumper - I have no idea how the make cmdlet works

robojumper commented 3 years ago

Okay this one is pretty easy -- we just need to delete the *.u files when switching between debug and non-debug mode. Firaxis' ModBuddy plugin has a static variable to persist an enum that is one of "not built this session", "built in debug" and "built in non-debug" and deletes appropriately. We probably should persist the last build mode in a text file somewhere to achieve the same effect.