Repository navigation
Do not compile SConscripts with the future flags of SCons modules - #4924
Merged
Merged
Conversation
SConscript.py, Main.py and Variables/__init__.py use "from __future__ import annotations", and the compile()/exec() calls that run SConscripts, site_init.py and variables files inherited it. Annotations in those files became strings, which stopped dataclasses from recognising InitVar fields. Pass dont_inherit=True. Signed-off-by: Adam Matthews <52178922+adamsthws@users.noreply.github.com>
Contributor
Author
|
For context, this was found while testing fixes for Sonoff-OTA, an over-the-air Sonoff S60 to Tasmota converter. The related pull requests in other projects, and how each was tested, are collected in docs/upstream-contributions.md. |
Collaborator
|
That's a nice catch - sorry we broke you :-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SCons 4.11 added
from __future__ import annotationstoSConscript.py,Main.pyandVariables/__init__.py. Thecompile()/exec()calls there that run SConscripts,site_init.pyand variables files inherit that flag, so annotations in user scripts became strings. Among other things,dataclassesthen no longer recognisesInitVarfields, which broke LibreTiny builds under PlatformIO 6.2.0:This passes
dont_inherit=Trueat those call sites (including-f -). Variables files now also get their own filename in tracebacks instead of<string>.New test
test/SConscript/future-flags.pyfails onmasterand passes with this change.Contributor Checklist:
CHANGES.txtandRELEASE.txt(and read theREADME.rst).(not applicable: no documented behaviour changes)
...