Discussion:
[Scons-users] Scons-users Digest, Vol 70, Issue 2
James Rinkevich
2017-10-01 18:55:07 UTC
Permalink
No you did not quite get that Bill
The elif clearly limits the type of s at this point to a duck type of
sequence
then l is initialized to an empty sequence type
then in the for loop for each element of s the function recursively is
called on the element returning a string which is appended to l
l is then discarded on the return of the join of s with a blank between
each. This assumes all the elements of s can be converted to a string type
for the join.
Thus l is unneeded and so is the for loop over s, which merely appends
everything to l.
Send Scons-users mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
https://pairlist4.pair.net/mailman/listinfo/scons-users
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Scons-users digest..."
1. Re: Surprising behavior with pipes (Andrew C. Morrow)
2. Module Scons.Util (James Rinkevich)
3. Re: Module Scons.Util (Bill Deegan)
4. Re: Surprising behavior with pipes (Tom Tanner)
----------------------------------------------------------------------
Message: 1
Date: Sun, 1 Oct 2017 11:46:15 -0400
Subject: Re: [Scons-users] Surprising behavior with pipes
<CA+Acj4e_LpfZv+E8jDcX5mokdBFmCsJzCMFJjC+
Content-Type: text/plain; charset="utf-8"
That does assume that SHELL is set to bash though, right? I'd be OK
limiting it to POSIX, but going so far as to mandate one particular shell
implementation feels pretty fragile.
I guess the right solution is to not use pipes, but instead redirect the
output to an intermediate target and then consume that, making a two step
process.
Somewhat unfortunate in my case as I really don't need the intermediate
state and would prefer to avoid the IO cost. Perhaps the intermediate could
be a tempfile of some sort. Basically, re-implement the pipe by hand.
When I have had to use pipelines in actions, I have had to set pipefail
"set -o pipefail; %s 2>&1 | ${ASAN_FILTER}" % (command)
I noticed to my surprise recently that an Action that uses a pipeline
https://github.com/mongodb/mongo/blob/master/site_scons/
site_tools/abilink.py#L66
I had a buggy version of abidw installed, and when it crashed with an
assertion, the SCons build did not terminate with an error. Instead
the partial output up to the crash was consumed by md5 and used as the
result.
Is there a way to ask SCons to enforce pipefail?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/
attachments/20171001/585fd4c5/attachment-0001.html>
------------------------------
Message: 2
Date: Sun, 1 Oct 2017 10:16:27 -0700
Subject: [Scons-users] Module Scons.Util
gmail.com>
Content-Type: text/plain; charset="utf-8"
in this function
def to_String_for_subst(s,
isinstance=isinstance, str=str,
to_String=to_String,
BaseStringTypes=BaseStringTypes,
SequenceTypes=SequenceTypes,
# Note that the test cases are sorted by order of probability.
return s
l = []
l.append(to_String_for_subst(e))
return ' '.join( s )
# s.data can only be either a unicode or a regular
# string. Please see the UserString initializer.
return s.data
return str(s)
the lines
l = []
l.append(to_String_for_subst(e))
have no effect and just waste time, perhaps someone intended the return
line to be
return ' '.join( l )
instead of
return ' '.join( s )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/
attachments/20171001/c074fcdd/attachment-0001.html>
------------------------------
Message: 3
Date: Sun, 1 Oct 2017 10:27:55 -0700
Subject: Re: [Scons-users] Module Scons.Util
<CAEyG4CF_aJp9y84BQEjUU96yWgXkz0Fn8qwN=P
Content-Type: text/plain; charset="utf-8"
I think you're mistaken.
If s is a UserString or not a Sequence or BaseStringTypes then it's
actually doing something.
return ''.join([to_String_for_subst(e) for e in s])
in this function
def to_String_for_subst(s,
isinstance=isinstance, str=str,
to_String=to_String,
BaseStringTypes=BaseStringTypes,
SequenceTypes=SequenceTypes,
# Note that the test cases are sorted by order of probability.
return s
l = []
l.append(to_String_for_subst(e))
return ' '.join( s )
# s.data can only be either a unicode or a regular
# string. Please see the UserString initializer.
return s.data
return str(s)
the lines
l = []
l.append(to_String_for_subst(e))
have no effect and just waste time, perhaps someone intended the return
line to be
return ' '.join( l )
instead of
return ' '.join( s )
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/
attachments/20171001/5bd1fbea/attachment-0001.html>
------------------------------
Message: 4
Date: Sun, 1 Oct 2017 18:44:57 +0100
Subject: Re: [Scons-users] Surprising behavior with pipes
Content-Type: text/plain; charset="utf-8"; Format="flowed"
I noticed to my surprise recently that an Action that uses a pipeline
https://github.com/mongodb/mongo/blob/master/site_scons/
site_tools/abilink.py#L66
I had a buggy version of abidw installed, and when it crashed with an
assertion, the SCons build did not terminate with an error. Instead
the partial output up to the crash was consumed by md5 and used as the
result.
Is there a way to ask SCons to enforce pipefail?
Or should I be approaching this in a different way and not attempting
to use pipelines in Actions?
Thanks,
Andrew
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
That rule does two of the worst things you could possibly do
1 - it uses a pipe
2 - it uses output redirection to a file.
It's sort of a pity scons fires things off to a shell to execute, as
both of the above can lead to unexpected failures and totally stuff your
build / cache
Firstly, if something in a pipeline fails, there's a good chance the
failure will just be eaten
Secondly, if your output redirection goes astray - well, no runtime
system I've come across checks the error return when closing STDOUT. And
yes, I have had had to recover the mess when disk space ran out, and the
build was considered successful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/
attachments/20171001/e6424805/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
------------------------------
End of Scons-users Digest, Vol 70, Issue 2
******************************************
Loading...