Skip to content

Commit

Permalink
Makefile.uk: Ensure consistent Python binary name
Browse files Browse the repository at this point in the history
Previously Makefile.uk used `python` and `python3` interchangeably which
caused unexpected issues on misconfigured systems where these two do not
point to the same binary.
This change fixes this oversight by using `python` everywhere.

Signed-off-by: Andrei Tatar <[email protected]>
Reviewed-by: Stefan Jumarea <[email protected]>
Reviewed-by: Radu Nichita <[email protected]>
Approved-by: Razvan Deaconescu <[email protected]>
GitHub-Closes: #22
  • Loading branch information
andreittr authored and razvand committed Oct 16, 2023
1 parent 15428fa commit 14e77dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile.uk
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ PYTHON_ROOTFS = $(APP_BASE)/$(path)
$(PYTHON_ROOTFS)/.keep: $(LIBPYTHON3_BUILD)/.origin
@test $(LIBPYTHON3_VERSION) = `python -V | cut -d' ' -f2 | cut -d. -f1,2` || \
(echo -e "WARNING: creating virtualenv with wrong python version, pip might not work correctly\nPress return to continue" && read)
python3 -m venv $(PYTHON_ROOTFS)
python -m venv $(PYTHON_ROOTFS)
find "$(PYTHON_ROOTFS)" -type d -name '__pycache__' | xargs rm -rf
touch $@

Expand All @@ -516,7 +516,7 @@ $(PYTHON_ROOTFS)/.done: $(PYTHON_ROOTFS)/.configured
$(PYTHON_ROOTFS)/.compiled: python-rootfs
test $(LIBPYTHON3_VERSION) = `python -V | cut -d' ' -f2 | cut -d. -f1,2` || \
(echo "ERROR: local Python version is not $(LIBPYTHON3_VERSION), cannot compile .py files" && false)
python3 -m compileall -x 'lib2to3/|test/bad' "$(PYTHON_ROOTFS)/lib"
python -m compileall -x 'lib2to3/|test/bad' "$(PYTHON_ROOTFS)/lib"
touch $@

.PHONY: python-rootfs
Expand Down

0 comments on commit 14e77dd

Please sign in to comment.