Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions gpMgmt/bin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,19 @@ download-python-deps:
else \
echo "PyGreSQL-$(PYGRESQL_VERSION).tar.gz already exists, skipping download"; \
fi
# Install wheel and cython for PyYAML building
pip3 install --user wheel "cython<3.0.0"
# Install wheel and cython for PyYAML building (only if not exists)
@if python3 -c "import wheel" >/dev/null 2>&1; then \
echo "wheel already exists, skipping installation"; \
else \
echo "Installing wheel..."; \
pip3 install --user wheel 2>/dev/null || pip3 install --user --break-system-packages wheel; \
Copy link
Contributor

Choose a reason for hiding this comment

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

--break-system-packages may hide possible problems.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is any possible approach recommended?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @gfphoenix78, thanks for raising this — the concern is valid.

We plan to update the docs ([cloudberry-site#337](apache/cloudberry-site#337)) to recommend installing the required Python dependencies before building, so in most cases this step will be skipped entirely.

In the Makefile, pip3 install --user --break-system-packages is intentionally used only as a fallback, and only when the standard --user installation is blocked on Ubuntu 24.04 due to PEP 668. The dependencies involved here (wheel, cython) are build-time only and are installed into the user site, not the system Python environment.

That said, we agree this is not ideal long-term. A cleaner approach would be to isolate build-time Python dependencies (e.g. via a dedicated venv), which we can consider as a follow-up improvement. This change focuses on unblocking the Ubuntu 24.04 build while keeping backward compatibility with existing environments.

fi
@if python3 -c "import cython" >/dev/null 2>&1; then \
echo "cython already exists, skipping installation"; \
else \
echo "Installing cython..."; \
pip3 install --user "cython<3.0.0" 2>/dev/null || pip3 install --user --break-system-packages "cython<3.0.0"; \
fi

#
# PyGreSQL
Expand Down
Loading