Skip to content

Commit eb45497

Browse files
committed
Fixes #149 -- Isolate the path to the bare minimum. This removes the potential influence of Homebrew, user-provided Python installs, etc.
1 parent 9548669 commit eb45497

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ MACHINE_SIMPLE-arm64_32=arm
106106
# The architecture of the machine doing the build
107107
HOST_ARCH=$(shell uname -m)
108108

109+
# Force the path to be minimal. This ensures that anything in the user environment
110+
# (in particular, homebrew and user-provided Python installs) aren't inadvertently
111+
# linked into the support package.
112+
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
113+
109114
# Build for all operating systems
110115
all: $(OS_LIST)
111116

@@ -131,9 +136,15 @@ downloads: \
131136

132137
update-patch:
133138
# Generate a diff from the clone of the python/cpython Github repository
134-
# Requireds patchutils (installable via `brew install patchutils`)
139+
# Requires patchutils (installable via `brew install patchutils`); this
140+
# also means we need to re-introduce homebrew to the path for the filterdiff
141+
# call
135142
if [ -z "$(PYTHON_REPO_DIR)" ]; then echo "\n\nPYTHON_REPO_DIR must be set to the root of your Python github checkout\n\n"; fi
136-
cd $(PYTHON_REPO_DIR) && git diff -D v$(PYTHON_VERSION) $(PYTHON_VER) | filterdiff -X $(PROJECT_DIR)/patch/Python/diff.exclude -p 1 --clean > $(PROJECT_DIR)/patch/Python/Python.patch
143+
cd $(PYTHON_REPO_DIR) && \
144+
git diff -D v$(PYTHON_VERSION) $(PYTHON_VER) \
145+
| PATH="/usr/local/bin:/opt/homebrew/bin:$(PATH)" filterdiff \
146+
-X $(PROJECT_DIR)/patch/Python/diff.exclude -p 1 --clean \
147+
> $(PROJECT_DIR)/patch/Python/Python.patch
137148

138149
###########################################################################
139150
# Setup: BZip2

0 commit comments

Comments
 (0)