-
-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ParseConfig can fail when adding to CPPDEFINES #4321
Comments
Attaching a minimal reproduction project, which reproduces the issue with 4.5.0 and 4.5.1: |
I'm seeing another hole here, I think - |
ok. Once we have a fix for both, we can roll a 4.5.2 |
Sigh, it looks like (without documenting it), |
@akien-mga - the patch proposed in the PR ended up being different, because of the new problem that one created. Would you be able to test the change from |
@mwichmann I confirm that #4322 (as of e58b9c3) fixes the bug for me, applied the diff manually on top of pip-installed 4.5.1. |
Not going to tackle this here, as want to keep this PR as a simple "hotfix", but don't actually see any reason why |
Could you please make a new release with this fix? This is affecting at least godot on Gentoo, and quite likely dxx-rebirth (I haven't confirmed whether it's the same cause). |
IRL issues causing delay. I'll try to get it out today sometime. |
4.5.2 released. |
Thank you! |
There's still a deque returned by env['CPPDEFINES'] in 4.5.2 after env.Append with an existing and added list, which can break SConstruct files. The documentation seems to suggest it should result in a list (7.2.10. Appending to the End of Values: the Append Method). Is this an intended change of behavior? Example that worked before 4.5.0 and breaks since 4.5.0: env = Environment()
env.Append(CPPDEFINES = ['A'])
env.Append(CPPDEFINES = ['B'])
defs = env['CPPDEFINES'] + ['X'] |
It was an intended change. What type it is is supposed to be internal, and works consistently internally, but there's not much to be done if the API methods for amending are not used - adding an object directly using Python syntax. May have to give up on deque (it was chosen because the Note that whatever that snip in the user guide says, the internal represntation was never guaranteed, and could change depending on what operations you performed. Using a different pathway of building up emv = Environment()
env.Append(CPPDEFINES={'A': None, 'B': None})
defs = env['CPPDEFINES'] + ['X'] would take an exception TypeError: unsupported operand type(s) for +: 'dict' and 'list' |
Regarding #4321 (comment) :
I think the Rebirth problem was caused by the same SCons change that broke ParseConfig, but the failure mode is different, and I think the change in a4ab466 would not help Rebirth. Rebirth had an expression of the form |
env['CPPDEFINES'] may return a deque object in scons 4.5.0+ (see SCons/scons#4321). Explicitly convert it to a list where needed. Tested with scons 4.4.0, 4.5.0, 4.5.1 and 4.5.2.
* fixes: SCons/scons#4321 which caused e.g. iotifity to fail in do_compile (From OE-Core rev: 5b022730053cdf62db57f497014ed85e2f7057b6) Signed-off-by: Martin Jansa <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
* fixes: SCons/scons#4321 which caused e.g. iotifity to fail in do_compile Signed-off-by: Martin Jansa <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
In scons 4.5+ env['CPPDEFINES'] can sometimes return a deque object. See SCons/scons#4321
In scons 4.5+ env['CPPDEFINES'] can sometimes return a deque object (see SCons/scons#4321). Convert it to a list where needed.
* fixes: SCons/scons#4321 which caused e.g. iotifity to fail in do_compile (From OE-Core rev: 5b022730053cdf62db57f497014ed85e2f7057b6) Signed-off-by: Martin Jansa <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
After the changes in
CPPDEFINES
handling for SCons 4.5, it is possible forParseConfig
to hit aTypeError
. Here is one traceback:For this condition to trigger,
CPPDEFINES
in that environment must have previously been converted into the internaldeque
type. The error actually happens inMergeFlags
, which tries to do various complicated things to simulate what theAppend
routine would do in adding. SinceAppend
and relatives now short-circuits that work in case the key isCPPDEFINES
, it seemsMergeFlags
should do the same.The text was updated successfully, but these errors were encountered: