[Scons-users] Recursive directories, and the ignoring of filenames.
Bill Deegan
bill at baddogconsulting.com
Fri Aug 3 14:20:42 EDT 2018
On Fri, Aug 3, 2018 at 11:03 AM, Alistair Buxton <a.j.buxton at gmail.com>
wrote:
> On 3 August 2018 at 18:51, Matthew Marinets
> <Matthew.Marinets at kardium.com> wrote:
> > I can't reproduce your bug then.
> >
> > Using Python 3.6.5;
> > scons -v:
> > script: v3.0.1.74b2c53bc42290e911b334a6b44f187da698a668,
> 2017/11/14 13:16:53, by bdbaddog on hpmicrodog
> > engine: v3.0.1.74b2c53bc42290e911b334a6b44f187da698a668,
> 2017/11/14 13:16:53, by bdbaddog on hpmicrodog
> > engine path: ['C:\\Program Files\\Python36\\scons-3.0.1\\SCons']
> >
> >
> > I made a Command() builder that Globs all .c files in the src/
> directory, and copies them to the build/ directory:
> >
> > sources = Glob(pattern = str(src) + '/*.c')
> > env.Command(target = [build.File(x.name) for x in sources],
> source = sources, action = 'cp $SOURCES $TARGET.dir')
> >
> > First I ran it with src contents:
> > src/a.c
> > src/b.c
> > src/asdf.c
> >
> > All files were copied, as expected. Running SCons again, the build was
> not executed as all targets were up to date.
>
> The build was re-run because the new name you gave to the file changed
> the sorting order. I explained this in the initial report:
>
Also you could run into an issue where your command line length exceeds the
shell maximum.
That said you can exclude parts of your command line from the action
signature by wrapping them in "$(" and "$)" (start and end of sequence in
build string to ignore).
(Also in the manpage)
>
> On 3 August 2018 at 00:45, Alistair Buxton <a.j.buxton at gmail.com> wrote:
>
> > renames. It can also not if the renaming causes dependencies to be
> > listed in a different order (ie if you renamed a.txt instead of b.txt,
> > and the files had different contents).
>
> If you renamed asdf.c to asdfa.c, then the build would still have
> re-run, because you put the name of every file into the action string,
> and scons will detect that that the action string has changed. I
> explained this in my initial follow up email:
>
Here's what you said in your initial email
"All files under /some/path will be inserted into the image. Therefore,
if any file or subdirectory is renamed, the image needs to be rebuilt,"
So in the case above, rebuilding is correct?
>
> > In this case you would instead say:
> >
> > env.Command('listing.txt', Glob('*.txt'), 'ls ${SOURCES} > ${TARGET}')
> >
> > and scons would identify that the build needs to be re-done because
> > the action string changed.
>
> and the above was in reference to a reproduction of the issue which
> involves no directories at all:
>
> > env.Command('listing.txt', Glob('*.txt'), 'ls *.txt > ${TARGET}')
>
> Please actually read the whole report before jumping to conclusions.
>
I seem to have to keep reminding you that being courteous to those trying
to HELP you is considered good form.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180803/a0eb240c/attachment.html>
More information about the Scons-users
mailing list