Skip to content

bpo-45886: Allow overriding freeze command for cross compiling (GH-29735) - #29735

Merged
tiran merged 1 commit into
python:mainfrom
tiran:oot_freeze
Nov 24, 2021
Merged

tiran merged 1 commit into
python:mainfrom
tiran:oot_freeze

Conversation

@tiran

@tiran tiran commented Nov 23, 2021 •

Copy link
Copy Markdown
Member
../../configure -C --host=aarch64-linux-gnu-gcc --build=x86_64-pc-linux-gnu
make FREEZE_MODULE=../x86_64/Program/_freeze_module

Signed-off-by: Christian Heimes christian@python.org

https://bugs.python.org/issue45886

```
../../configure -C --host=aarch64-linux-gnu-gcc --build=x86_64-pc-linux-gnu
make FREEZE_MODULE=../x86_64/Program/_freeze_module
```

Signed-off-by: Christian Heimes <christian@python.org>
@tiran

tiran commented Nov 23, 2021

Copy link
Copy Markdown
Member Author
$ rm Python/frozen_modules/*.h
$ make regen-deepfreeze FREEZE_MODULE=builddep/origin/Programs/_freeze_module
builddep/origin/Programs/_freeze_module importlib._bootstrap ./Lib/importlib/_bootstrap.py Python/frozen_modules/importlib._bootstrap.h
builddep/origin/Programs/_freeze_module importlib._bootstrap_external ./Lib/importlib/_bootstrap_external.py Python/frozen_modules/importlib._bootstrap_external.h
builddep/origin/Programs/_freeze_module zipimport ./Lib/zipimport.py Python/frozen_modules/zipimport.h
...

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Comment thread Makefile.pre.in
# END: freezing modules

Tools/scripts/freeze_modules.py: Programs/_freeze_module
Tools/scripts/freeze_modules.py: $(FREEZE_MODULE)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess when Make sees a reference to something outside the tree it's just going to take it at face value, assuming it exists at all? What's the failure mode if that file doesn't exist?

@tiran tiran Nov 23, 2021 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our Makefile does not specify a build rule for the target $(FREEZE_MODULE). There is only a build rule for Programs/_freeze_module. If FREEZE_MODULE points to a different, non-existing file then make complains and stops:

$ make regen-deepfreeze  FREEZE_MODULE=builddep/origin/Programs/invalid
make: *** No rule to make target 'builddep/origin/Programs/invalid', needed by 'Python/frozen_modules/importlib._bootstrap.h'.  Stop.
@tiran tiran changed the title bpo-45886: Allow overriding freeze command for cross compiling Nov 24, 2021
@tiran
tiran merged commit dd8ce9e into python:main Nov 24, 2021
@tiran
tiran deleted the oot_freeze branch November 24, 2021 07:07
remykarem pushed a commit to remykarem/cpython that referenced this pull request Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants