Skip to content

GH-38323: [CI][Python] Use system gdb on test-conda-python#38324

Merged
pitrou merged 3 commits into
apache:mainfrom
pitrou:gh38323-conda-system-gdb
Oct 19, 2023
Merged

GH-38323: [CI][Python] Use system gdb on test-conda-python#38324
pitrou merged 3 commits into
apache:mainfrom
pitrou:gh38323-conda-system-gdb

Conversation

@pitrou
Copy link
Copy Markdown
Member

@pitrou pitrou commented Oct 18, 2023

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.

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

We needn't install gdb from conda-forge, though, as the Python interpreter used for gdb is entirely independent from the Python interpreter under test.
@pitrou
Copy link
Copy Markdown
Member Author

pitrou commented Oct 18, 2023

@github-actions crossbow submit test-conda-python*

@github-actions github-actions Bot added the awaiting review Awaiting review label Oct 18, 2023
@github-actions

This comment was marked as outdated.

@pitrou
Copy link
Copy Markdown
Member Author

pitrou commented Oct 18, 2023

Hmm, things are not so simple. All builds pass except when the Python version under test is the same as the one that the system gdb is linked against, in which case the tests fail.

@pitrou

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown

Revision: cc0ad1f

Submitted crossbow builds: ursacomputing/crossbow @ actions-add7835c90

Task Status
test-conda-python-3.10 Github Actions
test-conda-python-3.10-cython2 Github Actions
test-conda-python-3.10-hdfs-2.9.2 Github Actions
test-conda-python-3.10-hdfs-3.2.1 Github Actions
test-conda-python-3.10-pandas-latest Github Actions
test-conda-python-3.10-pandas-nightly Github Actions
test-conda-python-3.10-spark-v3.5.0 Github Actions
test-conda-python-3.10-substrait Github Actions
test-conda-python-3.11 Github Actions
test-conda-python-3.11-dask-latest Github Actions
test-conda-python-3.11-dask-upstream_devel Github Actions
test-conda-python-3.11-hypothesis Github Actions
test-conda-python-3.11-pandas-upstream_devel Github Actions
test-conda-python-3.11-spark-master Github Actions
test-conda-python-3.12 Github Actions
test-conda-python-3.8 Github Actions
test-conda-python-3.8-pandas-1.0 Github Actions
test-conda-python-3.8-spark-v3.5.0 Github Actions
test-conda-python-3.9 Github Actions
test-conda-python-3.9-pandas-latest Github Actions

Comment thread ci/docker/conda-python.dockerfile Outdated
Comment on lines +26 to +30
# 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.
RUN mamba install -q -y \
--file arrow/ci/conda_env_python.txt \
gdb \
$([ "$python" == "3.10" ] && echo "gdb") \
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@kou Does this look ok?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will this be broken when we change the base Ubuntu version?

FROM ${arch}/ubuntu:22.04

Can we detect the Python version that is used by system GDB?
gdb --batch --eval-command 'python import sys; print(sys.version_info.major, sys.version_info.minor, sep=".")'?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmm, I'm not sure how to do that in a Dockerfile. Can you help me?

@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Oct 18, 2023
Copy link
Copy Markdown
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

All builds pass except when the Python version under test is the same as the one that the system gdb is linked against, in which case the tests fail.

Do you know why?


Could you update the description before we merge this?

Comment thread ci/docker/conda-python.dockerfile Outdated
Comment on lines +26 to +30
# 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.
RUN mamba install -q -y \
--file arrow/ci/conda_env_python.txt \
gdb \
$([ "$python" == "3.10" ] && echo "gdb") \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will this be broken when we change the base Ubuntu version?

FROM ${arch}/ubuntu:22.04

Can we detect the Python version that is used by system GDB?
gdb --batch --eval-command 'python import sys; print(sys.version_info.major, sys.version_info.minor, sep=".")'?

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Oct 19, 2023
@pitrou
Copy link
Copy Markdown
Member Author

pitrou commented Oct 19, 2023

Do you know why?

I honestly don't understand why. But it only happens when testing Python 3.10 (which is also the Python version installed under Ubuntu)...

Comment thread ci/docker/conda-python.dockerfile Outdated
RUN mamba install -q -y \
--file arrow/ci/conda_env_python.txt \
gdb \
$([ "$python" == "3.10" ] && echo "gdb") \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we try this?

Suggested change
$([ "$python" == "3.10" ] && echo "gdb") \
$([ "$python" = $(gdb --batch --eval-command 'python import sys; print(sys.version_info.major, sys.version_info.minor, sep=".")') ] && echo "gdb") \

@pitrou
Copy link
Copy Markdown
Member Author

pitrou commented Oct 19, 2023

@github-actions crossbow submit test-conda-python*

@github-actions github-actions Bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Oct 19, 2023
@github-actions
Copy link
Copy Markdown

Revision: 53a1887

Submitted crossbow builds: ursacomputing/crossbow @ actions-8f00837e89

Task Status
test-conda-python-3.10 Github Actions
test-conda-python-3.10-cython2 Github Actions
test-conda-python-3.10-hdfs-2.9.2 Github Actions
test-conda-python-3.10-hdfs-3.2.1 Github Actions
test-conda-python-3.10-pandas-latest Github Actions
test-conda-python-3.10-pandas-nightly Github Actions
test-conda-python-3.10-spark-v3.5.0 Github Actions
test-conda-python-3.10-substrait Github Actions
test-conda-python-3.11 Github Actions
test-conda-python-3.11-dask-latest Github Actions
test-conda-python-3.11-dask-upstream_devel Github Actions
test-conda-python-3.11-hypothesis Github Actions
test-conda-python-3.11-pandas-upstream_devel Github Actions
test-conda-python-3.11-spark-master Github Actions
test-conda-python-3.12 Github Actions
test-conda-python-3.8 Github Actions
test-conda-python-3.8-pandas-1.0 Github Actions
test-conda-python-3.8-spark-v3.5.0 Github Actions
test-conda-python-3.9 Github Actions
test-conda-python-3.9-pandas-latest Github Actions

@pitrou pitrou merged commit 883a439 into apache:main Oct 19, 2023
@pitrou pitrou removed the awaiting change review Awaiting change review label Oct 19, 2023
@pitrou pitrou deleted the gh38323-conda-system-gdb branch October 19, 2023 09:28
@conbench-apache-arrow
Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit 883a439.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them.

loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
…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>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI][Python] Image build failure on test-conda-python-3.12

2 participants