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

3.11 builds failing with v2.8.1 on manylinux2010 images #1187

Closed
godlygeek opened this issue Jul 20, 2022 · 12 comments · Fixed by #1298
Closed

3.11 builds failing with v2.8.1 on manylinux2010 images #1187

godlygeek opened this issue Jul 20, 2022 · 12 comments · Fixed by #1298

Comments

@godlygeek
Copy link

Description

With:

        cibw_python: [ "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*"]

and

        env:
          CIBW_PRERELEASE_PYTHONS: True

I'm seeing this error:

Setting up build environment...
  
      + /opt/python/cp38-cp38/bin/python -c 'import sys, json, os; json.dump(os.environ.copy(), sys.stdout)'
      + which python
  cibuildwheel: python available on PATH doesn't match our installed instance. If you have modified PATH, ensure that you don't overwrite cibuildwheel's entry or insert python above it.
  Error: Process completed with exit code 1.

This didn't occur with 2.8.0 - I suspect it's somehow related to this changelog entry:

🛠 The GitHub Action will ensure a compatible version of Python is installed on the runner (#1114)

I'm also seeing

Run actions/setup-python@v4
  with:
    python-version: 3.7 - 3.10
    update-environment: false
    token: ***
  env:
    CIBW_BUILD: cp311-*
    CIBW_ARCHS_LINUX: x86_64
    CIBW_MANYLINUX_X86_64_IMAGE: manylinux[20](https://github.com/bloomberg/memray/runs/7420878603?check_suite_focus=true#step:3:21)10
    CIBW_MANYLINUX_I686_IMAGE: manylinux2010
    CIBW_PRERELEASE_PYTHONS: true
    CIBW_TEST_EXTRAS: test
    CIBW_TEST_COMMAND: pytest {package}/tests

in the build log - perhaps that "python-version: 3.7 - 3.10" is the problem?

Build log

https://github.com/bloomberg/memray/runs/7421778954?check_suite_focus=true

CI config

https://github.com/bloomberg/memray/blob/f9bfaacea95c9c565189da2eeb121a3303c11c71/.github/workflows/build_wheels.yml

@henryiii
Copy link
Contributor

That’s not what that range means. It uses one version from that, and the outer host setting shouldn’t matter. I wish we printed the details of the mismatch. We are using 3.11b4 now. Don’t see how that would change this either, though. Am traveling and can’t check quite yet.

@henryiii
Copy link
Contributor

Why is it using /opt/python/cp38-cp38/bin/python? Host is 3.10 and target is 3.11. Don’t get where 3.8 is sneaking in.

@godlygeek
Copy link
Author

I'm past my depth in debugging this, but if there's anything I can run to help you make sense of it, I'd be happy to. I've added a type -a python to before-all and it prints out:

  python is /opt/python/cp38-cp38/bin/python
  python is /usr/bin/python

but I'm not sure where the /opt/python/cp38-cp38/bin/python is coming from...

Likewise, printing $PATH is showing me

  PATH=/opt/python/cp38-cp38/bin:/opt/rh/devtoolset-8/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

This could be something I've got misconfigured, but v2.8.1 is failing in a way that v2.8.0 didn't...

@mayeut
Copy link
Member

mayeut commented Jul 20, 2022

manylinux2010 does not have CPython 3.11
support for this image will be dropped before ABI stability of CPython 3.11 thus the beta has been dropped on this image to prevent building 3.11 with a Python that will never be ABI stable on that image.
You'll have to use manylinux2014 image to build CPython 3.11

@godlygeek
Copy link
Author

Oof. OK... Well, that's not good news for me, since I do still need RHEL 6 compatibility, but at least that answers what changed.

Thanks for helping me look into this.

@joerick joerick changed the title 3.11 builds failing with v2.8.1 3.11 builds failing with v2.8.1 on manylinux2010 images Jul 20, 2022
@joerick
Copy link
Contributor

joerick commented Jul 20, 2022

Thanks for the debugging. We could use a better error message for this then. @mayeut I'm guessing manylinux1 also won't get Python 3.11?

@henryiii
Copy link
Contributor

henryiii commented Jul 20, 2022

We need to detect this then, rather than grabbing a random Python. :)

manylinux1 is “dead”, it’s just still being built while CI doesn’t break, so it’s not getting anything new. Not sure you can build 3.11 on CentOS 5.

You can use an override to build 3.11 with manylinux2014. In fact, IIRC, NumPy switched to 2014 for 3.10, since anyone on 3.10 should be on a 2014 compatible platform. Doesn’t help to have higher compatibility than your dependencies.

@mayeut
Copy link
Member

mayeut commented Jul 21, 2022

I'm guessing manylinux1 also won't get Python 3.11?

Correct. The manylinux1 image does not even have Python 3.10

We need to detect this then, rather than grabbing a random Python. :)

It's correctly detected. The error message "cibuildwheel: python available on PATH doesn't match our installed instance. If you have modified PATH, ensure that you don't overwrite cibuildwheel's entry or insert python above it." relates to that (could be clearer by checking the path added to PATH exists in the first place).

The /opt/python/cp38-cp38/bin/python python mentioned is the one used as a build driver inside the container (counterpart to the host python running cibuildwheel).

@joerick
Copy link
Contributor

joerick commented Jul 21, 2022

Yep, it is detected, it's just the error message is confusing because that message is assuming that the user has fiddled with PATH to break it, not that it never existed in the image.

We can probably add a different message, like if not python_bin.exists(): raise Exception(f'Python {python_configuration.version} doesn't exist in image {image}'). And even perhaps a fail-fast before the builds start.

@joerick
Copy link
Contributor

joerick commented Jul 21, 2022

The /opt/python/cp38-cp38/bin/python python mentioned is the one used as a build driver inside the container (counterpart to the host python running cibuildwheel).

I don't recall adding this to PATH in cibuildwheel. Perhaps it's added in manylinux?

@mayeut
Copy link
Member

mayeut commented Jul 30, 2022

Perhaps it's added in manylinux?

The only python in the PATH in manylinux images is the system one (when it exists, on some images the system python is python3)

I probably wasn't clear enough about /opt/python/cp38-cp38/bin/python.

The /opt/python/cp38-cp38/bin/python python mentioned is the one used as a build driver inside the container (counterpart to the host python running cibuildwheel).

It's almost always used by cibuildwheel with the full file path:

UTILITY_PYTHON = "/opt/python/cp38-cp38/bin/python"

except for before_all step:
if before_all_options.before_all:
log.step("Running before_all...")
env = container.get_environment()
env["PATH"] = f'/opt/python/cp38-cp38/bin:{env["PATH"]}'
env["PIP_DISABLE_PIP_VERSION_CHECK"] = "1"
env = before_all_options.environment.as_dictionary(
env, executor=container.environment_executor
)

@joerick
Copy link
Contributor

joerick commented Jul 30, 2022

ahh.. gotcha. So the cp38 in PATH thing really is a red herring. It's only a result of trying to investigate this using before-all.

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 a pull request may close this issue.

4 participants