This is an automated email from the ASF dual-hosted git repository.

apitrou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 883a439076 GH-38323: [CI][Python] Use system gdb on test-conda-python 
(#38324)
883a439076 is described below

commit 883a439076233f3f2836f281614ebe01601ccab9
Author: Antoine Pitrou <[email protected]>
AuthorDate: Thu Oct 19 11:28:42 2023 +0200

    GH-38323: [CI][Python] Use system gdb on test-conda-python (#38324)
    
    ### Rationale for this change
    
    gdb on conda-forge frequently conflicts with the newest Python version 
(example for Python 3.12: 
https://github.com/conda-forge/gdb-feedstock/issues/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: #38323
    
    Authored-by: Antoine Pitrou <[email protected]>
    Signed-off-by: Antoine Pitrou <[email protected]>
---
 ci/docker/conda-python.dockerfile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ci/docker/conda-python.dockerfile 
b/ci/docker/conda-python.dockerfile
index ca0ceee5f9..5d37c53386 100644
--- a/ci/docker/conda-python.dockerfile
+++ b/ci/docker/conda-python.dockerfile
@@ -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

Reply via email to