Skip to content
Prev Previous commit
Next Next commit
Attempt to fix Cirrus CI
  • Loading branch information
AA-Turner committed Sep 8, 2023
commit 4f0b3a28a88d5343953c84b1601c1a8c3f48b796
2 changes: 2 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ freebsd_task:
- make -j$(sysctl -n hw.ncpu)
pythoninfo_script:
- cd build && make pythoninfo
bundle_ensurepip_script:

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.

Suggested change
bundle_ensurepip_script:
# Download wheels for the venv step
bundle_ensurepip_script:

Is this the reason for adding it here?

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.

Anything using venv or ensurepip during testing needs this provisioning step. If there's no uses, it'd be unnecessary.

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.

The actual reason to include it is that Cirrus CI failed without this and passed with it. I don't know why Free BSD requires the venv step though, as all other tests pass normally -- only documentation and hypothesis (which use venvs) seem to have an explicit venv step.

A

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.

@AA-Turner It's not because of venv but ensurepip itself. The call chain looks as follows:

  1. test.test_tools.test_freeze.TestFreeze.test_freeze_simple_script calls a CPython build preparation helper @ https://github.com/python/cpython/blob/cbb3a6f/Lib/test/test_tools/test_freeze.py#L28
  2. That, in turn, calls make install here https://github.com/python/cpython/blob/cbb3a6f/Tools/freeze/test/freeze.py#L184.
  3. make install calls ensurepip at https://github.com/python/cpython/blob/cbb3a6f/Makefile.pre.in#L1932-L1933 to provision it into the new Python install directory.
  4. ensurepip uses the bundled pip wheel to run bootstrapping so it attempts to unpack it and freaks out when there's no dist for it: https://github.com/python/cpython/blob/cbb3a6f/Lib/ensurepip/__init__.py#L176.

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.

why Free BSD requires

It's not that FreeBSD or Cirrus requires the test explicitly, it's rather that this test is skipped on most platforms via https://github.com/python/cpython/blob/cbb3a6f/Lib/test/test_tools/test_freeze.py#L11-L20.

- cd build && make download-ensurepip-wheels
test_script:
- cd build
# dtrace fails to build on FreeBSD - see gh-73263
Expand Down