Rename python -> python3 (closes #1144) (#1187)

When we removed the com suffix from ape binaries, we broke the build for
ape's python for any case-insensitive file system, i.e. Windows and XNU,
because there is a third_party/python/Python that gets mirrored in the o
directory with the python object files and clashes with the binary name.
This patch hacks around this by renaming the binary to "python3" so that
it no longer clashes with that directory.
This commit is contained in:
Jōshin 2024-05-24 10:56:33 -07:00 committed by GitHub
parent 0b59f01b43
commit 0768807935
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 16 deletions

View file

@ -7,7 +7,7 @@ THIRD_PARTY_PYTHON_ARTIFACTS = \
THIRD_PARTY_PYTHON_STAGE1_A \
THIRD_PARTY_PYTHON_STAGE2_A \
THIRD_PARTY_PYTHON_PYTEST_A \
THIRD_PARTY_PYTHON_PYTHON \
THIRD_PARTY_PYTHON_PYTHON3 \
THIRD_PARTY_PYTHON_FREEZE
THIRD_PARTY_PYTHON_BINS = \
@ -17,7 +17,7 @@ THIRD_PARTY_PYTHON_BINS = \
THIRD_PARTY_PYTHON_COMS = \
o/$(MODE)/third_party/python/Parser/asdl_c \
o/$(MODE)/third_party/python/pystone \
o/$(MODE)/third_party/python/python \
o/$(MODE)/third_party/python/python3 \
o/$(MODE)/third_party/python/freeze \
o/$(MODE)/third_party/python/pycomp \
o/$(MODE)/third_party/python/pyobj \
@ -29,7 +29,7 @@ THIRD_PARTY_PYTHON_CHECKS = \
$(THIRD_PARTY_PYTHON_STAGE2_A).pkg \
$(THIRD_PARTY_PYTHON_PYTEST_A).pkg \
$(THIRD_PARTY_PYTHON_HDRS:%=o/$(MODE)/%.ok) \
o/$(MODE)/third_party/python/python.pkg \
o/$(MODE)/third_party/python/python3.pkg \
o/$(MODE)/third_party/python/freeze.pkg
# TODO: Deal with aarch64 under qemu not making execve() easy.
@ -3980,12 +3980,12 @@ THIRD_PARTY_PYTHON_SRCS = \
################################################################################
# PYTHON
THIRD_PARTY_PYTHON_PYTHON_SRCS = third_party/python/python.c
THIRD_PARTY_PYTHON_PYTHON_OBJS = o/$(MODE)/third_party/python/python.o
THIRD_PARTY_PYTHON_PYTHON_COMS = o/$(MODE)/third_party/python/python
THIRD_PARTY_PYTHON_PYTHON_BINS = $(THIRD_PARTY_PYTHON_PYTHON_COMS) $(THIRD_PARTY_PYTHON_PYTHON_COMS:%=%.dbg)
THIRD_PARTY_PYTHON_PYTHON_DEPS = $(call uniq,$(foreach x,$(THIRD_PARTY_PYTHON_PYTHON_DIRECTDEPS),$($(x))))
THIRD_PARTY_PYTHON_PYTHON_DIRECTDEPS = \
THIRD_PARTY_PYTHON_PYTHON3_SRCS = third_party/python/python3.c
THIRD_PARTY_PYTHON_PYTHON3_OBJS = o/$(MODE)/third_party/python/python3.o
THIRD_PARTY_PYTHON_PYTHON3_COMS = o/$(MODE)/third_party/python/python3
THIRD_PARTY_PYTHON_PYTHON3_BINS = $(THIRD_PARTY_PYTHON_PYTHON3_COMS) $(THIRD_PARTY_PYTHON_PYTHON3_COMS:%=%.dbg)
THIRD_PARTY_PYTHON_PYTHON3_DEPS = $(call uniq,$(foreach x,$(THIRD_PARTY_PYTHON_PYTHON3_DIRECTDEPS),$($(x))))
THIRD_PARTY_PYTHON_PYTHON3_DIRECTDEPS = \
LIBC_CALLS \
LIBC_FMT \
LIBC_INTRIN \
@ -4005,14 +4005,14 @@ THIRD_PARTY_PYTHON_PYTHON_DIRECTDEPS = \
THIRD_PARTY_XED \
TOOL_ARGS
o/$(MODE)/third_party/python/python.pkg: \
$(THIRD_PARTY_PYTHON_PYTHON_OBJS) \
$(foreach x,$(THIRD_PARTY_PYTHON_PYTHON_DIRECTDEPS),$($(x)_A).pkg)
o/$(MODE)/third_party/python/python3.pkg: \
$(THIRD_PARTY_PYTHON_PYTHON3_OBJS) \
$(foreach x,$(THIRD_PARTY_PYTHON_PYTHON3_DIRECTDEPS),$($(x)_A).pkg)
o/$(MODE)/third_party/python/python.dbg: \
o/$(MODE)/third_party/python/python.pkg \
$(THIRD_PARTY_PYTHON_PYTHON_DEPS) \
$(THIRD_PARTY_PYTHON_PYTHON_OBJS) \
o/$(MODE)/third_party/python/python3.dbg: \
o/$(MODE)/third_party/python/python3.pkg \
$(THIRD_PARTY_PYTHON_PYTHON3_DEPS) \
$(THIRD_PARTY_PYTHON_PYTHON3_OBJS) \
$(CRT) \
$(APE_NO_MODIFY_SELF)
@$(APELINK)