-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
gh-133059: fix Tools/build/deepfreeze.py
nsmallposints
#139906
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
base: main
Are you sure you want to change the base?
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Tools/build/deepfreeze.py
nsmallposintsTools/build/deepfreeze.py
nsmallposints
Tools/build/consts_getter.py
Outdated
import os | ||
|
||
SCRIPT_NAME = 'Tools/build/consts_getter.py' | ||
__file__ = os.path.abspath(__file__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you redefine __file__
?
Tools/build/consts_getter.py
Outdated
|
||
SCRIPT_NAME = 'Tools/build/consts_getter.py' | ||
__file__ = os.path.abspath(__file__) | ||
ROOT = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about builds that are performed in a different folder? It is possible to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these constants were stolen from Tools/build/generate_global_objects.py
, so in this case I think it will be more than enough not to override __file__
and just specify a valid path to Include's
Tools/build/consts_getter.py
Outdated
@@ -0,0 +1,22 @@ | |||
import os | |||
|
|||
SCRIPT_NAME = 'Tools/build/consts_getter.py' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this case, I think it's not. it's only used in scripts that generate .c files to put a comment on top to indicate that those file were generated by this particular script
will remove
In
Tools/build/deepfreeze.py
nsmallposints was still 256.Although
deepfreeze
is no longer used (#116919), this script still needs to be kept and be actual until it is completely removed.This PR steals the parser of those numbers from
Tools/build/generate_global_objects.py
and puts it in a new script, so getting constants can be unified.