-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-45020: Make "make all" output less noisy. #28554
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
Closed
ericsnowcurrently
wants to merge
5
commits into
python:main
from
ericsnowcurrently:frozen-modules-less-build-noise-3
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2fbef5c
Don't write the generated files if they haven't changed.
ericsnowcurrently 18016f8
Make "make all" less noisy..
ericsnowcurrently 857f380
Make the recipes a little easier to read.
ericsnowcurrently ee13e18
Show the frozen file if it is missing (but others aren't).
ericsnowcurrently 5caaacc
Use a common make recipe for all the frozen modules.
ericsnowcurrently File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -772,58 +772,112 @@ FROZEN_FILES_OUT = \ | |
Python/frozen_modules/__hello__.h | ||
# End FROZEN_FILES_OUT | ||
|
||
Programs/_freeze_module.o: Programs/_freeze_module.c Makefile | ||
|
||
Programs/_freeze_module: Programs/_freeze_module.o $(LIBRARY_OBJS_OMIT_FROZEN) | ||
$(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_module.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) | ||
|
||
# BEGIN: freezing modules | ||
|
||
Python/frozen_modules/importlib._bootstrap.h: Programs/_freeze_module Lib/importlib/_bootstrap.py | ||
Programs/_freeze_module importlib._bootstrap $(srcdir)/Lib/importlib/_bootstrap.py $(srcdir)/Python/frozen_modules/importlib._bootstrap.h | ||
# the 3.0 release (6046c5e0298c25515ea58abc8ab87f7413e3f743) | ||
OLD_TIMESTAMP=200812031729.10 | ||
|
||
Python/frozen_modules/importlib._bootstrap_external.h: Programs/_freeze_module Lib/importlib/_bootstrap_external.py | ||
Programs/_freeze_module importlib._bootstrap_external $(srcdir)/Lib/importlib/_bootstrap_external.py $(srcdir)/Python/frozen_modules/importlib._bootstrap_external.h | ||
FROZEN_DATA=Python/frozen_modules | ||
FROZEN_READY=$(FROZEN_DATA)/ready-stamp | ||
FROZEN_GENERATED=$(FROZEN_DATA)/generated-stamp | ||
|
||
Python/frozen_modules/zipimport.h: Programs/_freeze_module Lib/zipimport.py | ||
Programs/_freeze_module zipimport $(srcdir)/Lib/zipimport.py $(srcdir)/Python/frozen_modules/zipimport.h | ||
.PHONY: clean-frozen | ||
clean-frozen: | ||
rm -rf $(FROZEN_DATA)/*-stamp | ||
# rm -f $(FROZEN_DATA)/*.h | ||
# rm -f $(FROZEN_FILES_OUT) | ||
|
||
Python/frozen_modules/abc.h: Programs/_freeze_module Lib/abc.py | ||
Programs/_freeze_module abc $(srcdir)/Lib/abc.py $(srcdir)/Python/frozen_modules/abc.h | ||
.FORCE: | ||
|
||
Python/frozen_modules/codecs.h: Programs/_freeze_module Lib/codecs.py | ||
Programs/_freeze_module codecs $(srcdir)/Lib/codecs.py $(srcdir)/Python/frozen_modules/codecs.h | ||
|
||
Python/frozen_modules/io.h: Programs/_freeze_module Lib/io.py | ||
Programs/_freeze_module io $(srcdir)/Lib/io.py $(srcdir)/Python/frozen_modules/io.h | ||
|
||
Python/frozen_modules/_collections_abc.h: Programs/_freeze_module Lib/_collections_abc.py | ||
Programs/_freeze_module _collections_abc $(srcdir)/Lib/_collections_abc.py $(srcdir)/Python/frozen_modules/_collections_abc.h | ||
|
||
Python/frozen_modules/_sitebuiltins.h: Programs/_freeze_module Lib/_sitebuiltins.py | ||
Programs/_freeze_module _sitebuiltins $(srcdir)/Lib/_sitebuiltins.py $(srcdir)/Python/frozen_modules/_sitebuiltins.h | ||
|
||
Python/frozen_modules/genericpath.h: Programs/_freeze_module Lib/genericpath.py | ||
Programs/_freeze_module genericpath $(srcdir)/Lib/genericpath.py $(srcdir)/Python/frozen_modules/genericpath.h | ||
|
||
Python/frozen_modules/ntpath.h: Programs/_freeze_module Lib/ntpath.py | ||
Programs/_freeze_module ntpath $(srcdir)/Lib/ntpath.py $(srcdir)/Python/frozen_modules/ntpath.h | ||
# This should always run before any frozen module .h rules. | ||
# It gets all the frozen-related stamp files in the proper state. | ||
# | ||
# This file is created by this rule, with an old timestamp. | ||
# It is deleted as soon as the state of the files changes. | ||
$(FROZEN_READY): .FORCE | ||
@mkdir -p $(FROZEN_DATA) | ||
@touch -t $(OLD_TIMESTAMP) $@ | ||
@rm -rf $(FROZEN_GENERATED) | ||
|
||
# This records that one or more frozen module .h files was built. It also | ||
# prints an informative header when the first frozen module is handled. | ||
# It is run at the beginning of the recipe for each frozen module .h file. | ||
# Note that the rule for each module will print a progress marker on | ||
# the same line as the others. | ||
.PHONY: .generating-frozen-module | ||
.generating-frozen-module: | ||
@if ( mkdir $(FROZEN_GENERATED) ) 2> /dev/null; then \ | ||
chmod 555 $(FROZEN_GENERATED); \ | ||
echo "=== Re-generating the frozen modules. ==="; \ | ||
echo "(For verbose output, run make regen-frozen.)"; \ | ||
else \ | ||
touch $(FROZEN_GENERATED); \ | ||
fi | ||
@rm -f $(FROZEN_READY) | ||
|
||
Python/frozen_modules/posixpath.h: Programs/_freeze_module Lib/posixpath.py | ||
Programs/_freeze_module posixpath $(srcdir)/Lib/posixpath.py $(srcdir)/Python/frozen_modules/posixpath.h | ||
# This should always run after all frozen module .h rules finish. | ||
# If at least one frozen module rules actually ran then this rule | ||
# finishes printing the line where the progress markers were printed. | ||
# This rule also removes all the other frozen-related stamp files. | ||
# | ||
# This file is created by the .generating-frozen-module rule if at least | ||
# one of the frozen module rules is run. Otherwise it is created here, | ||
# with an old timestamp. It is always an empty directory. | ||
# timestamp. It is updated to "now" in each frozem module .h rule | ||
# if the module was actually updated. | ||
$(FROZEN_GENERATED): $(FROZEN_FILES_OUT) .FORCE | ||
@if test -e $(FROZEN_GENERATED); then \ | ||
echo ""; \ | ||
else \ | ||
touch $@; \ | ||
chmod 555 $(FROZEN_GENERATED); \ | ||
fi | ||
@touch -t $(OLD_TIMESTAMP) $@ | ||
@rm -f $(FROZEN_READY) | ||
|
||
Python/frozen_modules/os.h: Programs/_freeze_module Lib/os.py | ||
Programs/_freeze_module os $(srcdir)/Lib/os.py $(srcdir)/Python/frozen_modules/os.h | ||
Programs/_freeze_module.o: Programs/_freeze_module.c Makefile | ||
|
||
Python/frozen_modules/site.h: Programs/_freeze_module Lib/site.py | ||
Programs/_freeze_module site $(srcdir)/Lib/site.py $(srcdir)/Python/frozen_modules/site.h | ||
Programs/_freeze_module: Programs/_freeze_module.o $(LIBRARY_OBJS_OMIT_FROZEN) $(FROZEN_READY) | ||
$(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_module.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) | ||
|
||
Python/frozen_modules/stat.h: Programs/_freeze_module Lib/stat.py | ||
Programs/_freeze_module stat $(srcdir)/Lib/stat.py $(srcdir)/Python/frozen_modules/stat.h | ||
have_frozen_files=$(wildcard $(FROZEN_FILES_OUT)) | ||
|
||
Python/frozen_modules/__hello__.h: Programs/_freeze_module Lib/__hello__.py | ||
Programs/_freeze_module __hello__ $(srcdir)/Lib/__hello__.py $(srcdir)/Python/frozen_modules/__hello__.h | ||
$(FROZEN_DATA)/%.h: Programs/_freeze_module | ||
$(eval exists = $(wildcard $@)) | ||
$(eval pyfile = Lib/$(subst .,/,$(*F)).py) | ||
$(eval pyfilefull = $(srcdir)/$(pyfile)) | ||
@if ( mkdir $(FROZEN_GENERATED) ) 2> /dev/null; then \ | ||
chmod 555 $(FROZEN_GENERATED); \ | ||
echo "=== Re-generating the frozen modules. ==="; \ | ||
echo "(For verbose output, run make regen-frozen.)"; \ | ||
else \ | ||
touch $(FROZEN_GENERATED); \ | ||
fi | ||
@rm -f $(FROZEN_READY) | ||
@Programs/_freeze_module $(*F) "$(pyfilefull)" [email protected] | ||
@if $(UPDATE_FILE) --create --exitcode $@ [email protected]; then \ | ||
if test $@ -ot Python/frozen.o; then touch -r Python/frozen.o $@; fi; \ | ||
if test $@ -ot "$(pyfilefull)"; then touch -r "$(pyfilefull)" $@; fi; \ | ||
fi | ||
@if test -n "$(exists)" && test -n "$(findstring $(pyfile),$?)"; then echo -n " $(@F) "; \ | ||
elif test -z "$(have_frozen_files)"; then echo -n "."; \ | ||
elif test -z "$(exists)"; then echo -n " $(@F) "; \ | ||
else echo -n "."; fi | ||
|
||
# BEGIN: freezing modules | ||
Python/frozen_modules/importlib._bootstrap.h: $(srcdir)/Lib/importlib/_bootstrap.py | ||
Python/frozen_modules/importlib._bootstrap_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py | ||
Python/frozen_modules/zipimport.h: $(srcdir)/Lib/zipimport.py | ||
Python/frozen_modules/abc.h: $(srcdir)/Lib/abc.py | ||
Python/frozen_modules/codecs.h: $(srcdir)/Lib/codecs.py | ||
Python/frozen_modules/io.h: $(srcdir)/Lib/io.py | ||
Python/frozen_modules/_collections_abc.h: $(srcdir)/Lib/_collections_abc.py | ||
Python/frozen_modules/_sitebuiltins.h: $(srcdir)/Lib/_sitebuiltins.py | ||
Python/frozen_modules/genericpath.h: $(srcdir)/Lib/genericpath.py | ||
Python/frozen_modules/ntpath.h: $(srcdir)/Lib/ntpath.py | ||
Python/frozen_modules/posixpath.h: $(srcdir)/Lib/posixpath.py | ||
Python/frozen_modules/os.h: $(srcdir)/Lib/os.py | ||
Python/frozen_modules/site.h: $(srcdir)/Lib/site.py | ||
Python/frozen_modules/stat.h: $(srcdir)/Lib/stat.py | ||
Python/frozen_modules/__hello__.h: $(srcdir)/Lib/__hello__.py | ||
# END: freezing modules | ||
|
||
Tools/scripts/freeze_modules.py: Programs/_freeze_module | ||
|
@@ -1062,7 +1116,7 @@ regen-opcode-targets: | |
Python/ceval.o: $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/ceval_gil.h \ | ||
$(srcdir)/Python/condvar.h | ||
|
||
Python/frozen.o: $(FROZEN_FILES_OUT) | ||
Python/frozen.o: $(FROZEN_FILES_OUT) $(FROZEN_GENERATED) | ||
|
||
# Generate DTrace probe macros, then rename them (PYTHON_ -> PyDTrace_) to | ||
# follow our naming conventions. dtrace(1) uses the output filename to generate | ||
|
@@ -1988,6 +2042,7 @@ clean-retain-profile: pycremoval | |
-find build -type f -a ! -name '*.gc??' -exec rm -f {} ';' | ||
-rm -f Include/pydtrace_probes.h | ||
-rm -f profile-gen-stamp | ||
-rm -rf $(FROZEN_DATA)/*-stamp | ||
|
||
profile-removal: | ||
find . -name '*.gc??' -exec rm -f {} ';' | ||
|
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
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.
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.
FWIW, the commands in the block below this line give me the creeps (== I've never seen such make syntax before :-).
But perhaps we can define a pattern rule that tells how to generate a frozen .h file from a Lib .py file? That won't change the output volume, but it will simplify the Makefile.