Skip to content

Commit

Permalink
apacheGH-38323: [CI][Python] Use system gdb on test-conda-python (apa…
Browse files Browse the repository at this point in the history
…che#38324)

### Rationale for this change

gdb on conda-forge frequently conflicts with the newest Python version (example for Python 3.12: conda-forge/gdb-feedstock#66)

### What changes are included in this PR?

Use the system-provided gdb instead of trying to install it from conda-forge.

This works because the Python interpreter used for gdb is entirely independent from the Python interpreter under test, and gdb itself can debug any binary, regardless of binutils version.

However, there is a complication: if the system Python version and the conda-forge Python version are the same, then for some reason `pyarrow/tests/test_gdb.py` would fail with the system gdb. In that case we still install the conda-forge gdb.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.

* Closes: apache#38323

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
  • Loading branch information
pitrou authored and Jeremy Aguilon committed Oct 23, 2023
1 parent a2eae17 commit 79bdfad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ci/docker/conda-python.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ FROM ${repo}:${arch}-conda-cpp
ARG python=3.8
COPY ci/conda_env_python.txt \
/arrow/ci/
# If the Python version being tested is the same as the Python used by the system gdb,
# we need to install the conda-forge gdb instead (GH-38323).
RUN mamba install -q -y \
--file arrow/ci/conda_env_python.txt \
gdb \
$([ "$python" == $(gdb --batch --eval-command 'python import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') ] && echo "gdb") \
python=${python} \
nomkl && \
mamba clean --all
Expand Down

0 comments on commit 79bdfad

Please sign in to comment.