[Scons-users] Hierarchical builds not possible (TAR/RPM packaging)

Werner Reisberger wr at pure.ch
Wed Jan 5 03:39:38 EST 2022


On 2022-01-04 23:02, Bill Deegan wrote:
> In general we advise against using chdir...
> 
> Probably you'd be better served to do the following
> 
> 		env = Environment(TARFLAGS = '-vc -z -Cbuild')
> 
> env.Tar('base.tar.gz', [ 'etc/', 'bin/' ])
> 
> And remove the
> 
> env.SConscriptChdir(1)

This fails too because when calling SCons this way it will change the 
source list to

    [ 'build/etc/', 'build/bin/' ]

Therefore I am getting this error:

>>> scons: Building targets ...
>>> tar -vczCbuild -f build/base.tar.gz build/etc build/bin
>>> tar: build/etc: Cannot stat: No such file or directory
>>> tar: build/bin: Cannot stat: No such file or directory

I can get rid of the "build/" in front by adding "--transform 
's,^build/,,' to the tar flags but this seems to me like an ugly hack 
and is only working with gnu tar.

BTW: You advise against using SConscriptChdir(1) but this isn't working 
anyway. I couldn't see any effect using this call with any parameters.

I also think that the statement on the SCons man page (in the 
SConscriptChdir chapter) is wrong:

>>> By default, scons changes its working directory to the directory in 
>>> which each subsidiary SConscript file lives.

According to the tests I did the below quoted statement on the SCons 
user page is right.

I regard man pages as reference for the usage of a tool. They should be 
as clear and error free as possible.

--Werner


> On Mon, Jan 3, 2022 at 11:52 PM Werner Reisberger <wr at pure.ch> wrote:


>>        By default, scons changes its working directory to the
>> directory
>> in which each subsidiary SConscript file lives.



More information about the Scons-users mailing list