Skip to content

Commit 8ae399b

Browse files
committed
Fix: Python build dependencies installation
Improve wheel and cython dependency management in gpMgmt/bin/Makefile to handle Ubuntu 24.04's PEP 668 restrictions while maintaining compatibility with Rocky Linux and older Ubuntu versions. Changes: - Split wheel and cython dependency checks into separate commands - Add fallback to --break-system-packages flag for Ubuntu 24.04+ - Only install dependencies if not already present in the system - Maintain backward compatibility with existing build environments This resolves build failures on Ubuntu 24.04 where pip install --user is restricted by default, while preserving the existing behavior on Rocky Linux 8/9 and Ubuntu 20.04/22.04 systems.
1 parent 5bb33f7 commit 8ae399b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

gpMgmt/bin/Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,19 @@ download-python-deps:
111111
else \
112112
echo "PyGreSQL-$(PYGRESQL_VERSION).tar.gz already exists, skipping download"; \
113113
fi
114-
# Install wheel and cython for PyYAML building
115-
pip3 install --user wheel "cython<3.0.0"
114+
# Install wheel and cython for PyYAML building (only if not exists)
115+
@if python3 -c "import wheel" >/dev/null 2>&1; then \
116+
echo "wheel already exists, skipping installation"; \
117+
else \
118+
echo "Installing wheel..."; \
119+
pip3 install --user wheel 2>/dev/null || pip3 install --user --break-system-packages wheel; \
120+
fi
121+
@if python3 -c "import cython" >/dev/null 2>&1; then \
122+
echo "cython already exists, skipping installation"; \
123+
else \
124+
echo "Installing cython..."; \
125+
pip3 install --user "cython<3.0.0" 2>/dev/null || pip3 install --user --break-system-packages "cython<3.0.0"; \
126+
fi
116127

117128
#
118129
# PyGreSQL

0 commit comments

Comments
 (0)