Scons help: Partial builds

Scons help: Partial builds

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Scons help: Partial builds

Post by ILMTitan »

Wasn't sure if I should put this in the compiling spring thread or not. I have been using MSVS7 to develop, but I'm moving to a new computer (one I hope can run a certain unnamed game). I'm trying to get everything working on Eclipse CDT with Scons Builder plugin. I've had some troubles, but I can now run a file I get from a scons full build built by Eclipse. The problem is when I save a file. The builder runs a command with the following output:

Code: Select all

E:\Python24\scons.bat -u platform=win32 configuration=debug rts/Game/ConsoleHistory.cpp . 

Code: Select all

scons: Entering directory `E:\eclipse\workspace\Spring'
scons: Reading SConscript files ...
make: Nothing to be done for `all'.
Succes building streflop!
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated BuildDir targets: rts\Game\ConsoleHistory.cpp rts\Game\ConsoleHistory.cpp
scons: building terminated because of errors.
scons: *** Source `rts\Game\ConsoleHistory.cpp' not found, needed by target `build\rts\Game\ConsoleHistory.o'.  Stop.
Running the same command outside of Eclipse gives the same results. Removing the . causes the build to complete successfully, but I don't think it is producing spring.exe at that point. Does someone more familiar with scons see the problem? Is the command itself valid?
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

I just broke a file by removing a semi-colin, did a full build, replaced the semi-colon, and did a partial build. I got this output:

Code: Select all

E:\Python24\scons.bat -u --implicit-cache platform=win32 configuration=debug build/rts/Game rts/Game/CameraController.cpp . 

Code: Select all

scons: Entering directory `E:\eclipse\workspace\Spring'
scons: Reading SConscript files ...
make: Nothing to be done for `all'.
Succes building streflop!
scons: done reading SConscript files.
scons: Building targets ...
g++ -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -mfpmath=387 -mthreads -DNDEBUG -D_REENTRANT -D_SZ_ONE_DIRECTORY -DDIRECT_CONTROL_ALLOWED -DSTREFLOP_X87 -Irts -Irts\System -Ilua\luabind -Ilua\lua\include -Imingwlibs\include -IE:\mingw\include -Imingwlibs\include\freetype2 -IE:\mingw\include\freetype2 -Imingwlibs\include\SDL -IE:\mingw\include\SDL -Imingwlibs\include\python2.4 -IE:\mingw\include\python2.4 -c -o build\rts\Game\CameraController.o rts\Game\CameraController.cpp
scons: building associated BuildDir targets: rts\Game\CameraController.cpp rts\Game\CameraController.cpp
scons: done building targets.

scons: *** Dependency cycle: rts\Game\CameraController.cpp -> rts\Game -> rts -> .
File "E:\Python24\scons\SCons\Taskmaster.py", line 292, in _find_next_ready_node
I don't know if it is related or not, but seems like something that may be more fixable.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Can't you modify the way it calls scons in Eclipse CDT?
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

Not really. The Scons plugin is not exactly fully mature. I can change the platform and configuration, and I can add targets before the default target, but without downloading the source and rebuilding the plugin itself (which may be an option), I can't remove any of the build targets.
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

I guess the question I really want answered (for now) is whether the command should be a generally valid scons command.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

The problem with scons is that it doesn't have "generally valid" or "generally invalid" commands. Because it's python script one can implement stuff as he sees fit, and this doesn't have to be identical to how other projects do it...

(This contrary to e.g. make, where it's pretty much convention to have "all", "clean", "distclean", "install" etc. targets.)
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

I am a terrible hack.
By Aliasing every build target not in the default build targets to spring, builds now work perfectly. I don't intend on checking that in. Added to the end of Sconstruct.

Code: Select all

for s in BUILD_TARGETS:
	if s not in DEFAULT_TARGETS:
		Alias(s, spring)
Post Reply

Return to “Engine”