Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Oct 19, 2023

Conversation

pitrou
Copy link
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
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
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

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 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
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
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
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
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 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
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
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)...

RUN mamba install -q -y \
--file arrow/ci/conda_env_python.txt \
gdb \
$([ "$python" == "3.10" ] && echo "gdb") \
Copy link
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
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

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

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.

JerAguilon pushed a commit to JerAguilon/arrow that referenced this pull request Oct 23, 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 <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
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 <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
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 <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
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