Re: Hierarchical builds not possible (TAR/RPM packaging)

Werner Reisberger <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <[email protected]>
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 <[email protected]> wrote:


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

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.