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

Unable to run pants 2.25.0.dev0 due to "No interpreter compatible with the requested constraints was found:" error #424

Closed
huonw opened this issue Nov 21, 2024 · 1 comment · Fixed by #426
Assignees
Labels
bug Something isn't working

Comments

@huonw
Copy link
Contributor

huonw commented Nov 21, 2024

Describe the bug

Running pants 2.25.0.dev0 upgrades the version of Python used, but this doesn't seem to have worked completely, actually attempting to run Pants gives an error like:

Failed to find compatible interpreter on path /Users/huon/Library/Caches/nce/7af7058f7c268b4d87ed7e08c2c7844ef8460863b3e679db3afdce8bb1eedfae/cpython-3.11.9+20240415-aarch64-apple-darwin-install_only.tar.gz/python/bin/python3.11.

Examined the following interpreters:
1.) /Users/huon/Library/Caches/nce/7af7058f7c268b4d87ed7e08c2c7844ef8460863b3e679db3afdce8bb1eedfae/cpython-3.11.9+20240415-aarch64-apple-darwin-install_only.tar.gz/python/bin/python3.11 CPython==3.11.9

No interpreter compatible with the requested constraints was found:

  Version matches CPython<3.10,>=3.8
Error: Failed to establish atomic directory /Users/huon/Library/Caches/nce/6faa4322d1df41d032e4938795c6f2c262ab92bb642a9bac1101cb7d1631f9c1/locks/install-b4ff91a6f4dedb37b388e53c0e15b581f82e68706a77a04f1d9940d3e97e0da1. Population of work directory failed: Boot binding command failed: exit status: 1

Isolates your Pants from the elements.

Please select from the following boot commands:

<default> (when SCIE_BOOT is not set in the environment)  Detects the current Pants installation and launches it.
bootstrap-tools                                           Introspection tools for the Pants bootstrap process.
update                                                    Update scie-pants.

You can select a boot command by setting the SCIE_BOOT environment variable.

(Filed here not scie-pants because I'm guessing this might be some metadata in the Pants wheel? It seems like the interpreter is configured correctly.)

Reproducer: run PANTS_VERSION=2.25.0.dev0 pants version

Pants version
2.25.0.dev0

OS

macOS, Linux

Additional info
N/A

@huonw huonw added the bug Something isn't working label Nov 21, 2024
@jsirois
Copy link
Contributor

jsirois commented Nov 22, 2024

It is scie pants:

:; cat pants.toml
[GLOBAL]
pants_version = "2.25.0.dev0"

:; rm -rf ~/.cache/nce

:; pants -V
Failed to find compatible interpreter on path /home/jsirois/.cache/nce/78b1c16a9fd032997ba92a60f46a64f795cd18ff335659dfdf6096df277b24d5/cpython-3.11.9+20240415-x86_64-unknown-linux-gnu-install_only.tar.gz/python/bin/python3.11.

Examined the following interpreters:
1.) /home/jsirois/.cache/nce/78b1c16a9fd032997ba92a60f46a64f795cd18ff335659dfdf6096df277b24d5/cpython-3.11.9+20240415-x86_64-unknown-linux-gnu-install_only.tar.gz/python/bin/python3.11 CPython==3.11.9

No interpreter compatible with the requested constraints was found:

  Version matches CPython<3.10,>=3.8
Error: Failed to establish atomic directory /home/jsirois/.cache/nce/ab1acf935c4cc43338c604ae7d0f6aa2419f2415d94eb9cae381601dbba70a61/locks/install-1a18643b1d644d7f05d871e7195adf2a0e39ff54c541dc7244e179f27e4abec2. Population of work directory failed: Boot binding command failed: exit status: 1

Isolates your Pants from the elements.

Please select from the following boot commands:

<default> (when SCIE_BOOT is not set in the environment)  Detects the current Pants installation and launches it.
bootstrap-tools                                           Introspection tools for the Pants bootstrap process.
update                                                    Update scie-pants.

You can select a boot command by setting the SCIE_BOOT environment variable.

:; find ~/.cache/nce -name PEX-INFO
/home/jsirois/.cache/nce/ab1acf935c4cc43338c604ae7d0f6aa2419f2415d94eb9cae381601dbba70a61/bindings/pex_root/unzipped_pexes/10065e08ffb3b880c0f2fc1126cc528a64b9e10b/PEX-INFO
/home/jsirois/.cache/nce/ab1acf935c4cc43338c604ae7d0f6aa2419f2415d94eb9cae381601dbba70a61/bindings/pex_root/venvs/10065e08ffb3b880c0f2fc1126cc528a64b9e10b/11835c97e384aef7b44d8e916cb91f7c6dfdf545/PEX-INFO

:; jq . /home/jsirois/.cache/nce/ab1acf935c4cc43338c604ae7d0f6aa2419f2415d94eb9cae381601dbba70a61/bindings/pex_root/unzipped_pexes/10065e08ffb3b880c0f2fc1126cc528a64b9e10b/PEX-INFO
{
  "bootstrap_hash": "8f600f1c1bbdbe4056c27842fb8c45729041a1e3",
  "build_properties": {
    "pex_version": "2.3.0"
  },
  "code_hash": "bfa20557bd995e4a79f9660c56dee6c65e0788fa",
  "deps_are_wheel_files": false,
  "distributions": {
    "ansicolors-1.1.8-py2.py3-none-any.whl": "18687c11ecd3f2ee80dffbcbfd248ea50309fa65a2df1d805c6bf1cec8b1f33d",
    "conscript-0.1.7-py2.py3-none-any.whl": "233712065a191d9811d54529a758b4e1e8589185f54e983e0437da0beb733b36",
    "packaging-23.2-py3-none-any.whl": "a5443f7cfed354abce1899afd02f4c076b007eee6c22cf8bb1b7a57702a78812",
    "tomlkit-0.12.3-py3-none-any.whl": "0b785fc14299dba56e55c36edb5b5ff565eb44eb7c3728dc8172e7514a51d50e"
  },
  "emit_warnings": false,
  "entry_point": "conscript.main:main",
  "excluded": [],
  "ignore_errors": false,
  "includes_tools": true,
  "inherit_path": "false",
  "inject_args": [],
  "inject_env": {},
  "interpreter_constraints": [
    "CPython<3.10,>=3.8"
  ],
  "max_install_jobs": 1,
  "pex_hash": "10065e08ffb3b880c0f2fc1126cc528a64b9e10b",
  "pex_path": "",
  "pex_paths": [],
  "requirements": [
    "ansicolors",
    "conscript",
    "packaging",
    "tomlkit"
  ],
  "strip_pex_env": true,
  "venv": true,
  "venv_bin_path": "prepend",
  "venv_copies": false,
  "venv_hermetic_scripts": true,
  "venv_site_packages_copies": false
}

And over there: https://github.com/search?q=repo%3Apantsbuild%2Fscie-pants%20%3E%3D3.8%2C%3C3.10%22&type=code

@huonw huonw transferred this issue from pantsbuild/pants Nov 25, 2024
@huonw huonw self-assigned this Nov 25, 2024
huonw added a commit that referenced this issue Nov 25, 2024
As preparation for #424, this just updates all of the Python
dependencies of tools.pex to their latest versions.

This is a separate PR to #426 so that we can bisect and more easily tell
the difference between "problem caused by dependency upgrade" vs.
"problem caused by ICs change", if there are problems.
huonw added a commit that referenced this issue Nov 27, 2024
Fixes #424 

This makes a few adjustments to support running Pants 2.25.0.dev0 and
newer, which run using Python 3.11
(pantsbuild/pants#21528), iterating on #351.
Particularly:

- expanding tools.pex's interpreter constraints to include 3.11 (and
also 3.10, which seems fine)
- add a test (NB. Pants 2.25 cannot run on macOS older than 13 / 14,
depending on platform, so this test is conditional:
pantsbuild/pants#21655)
- hardcoding that 2.25.0.dev0 uses Python 3.11, to use the optimised
"hit the exact URL first time" codepath, instead of having to try all
Python versions:
https://github.com/pantsbuild/scie-pants/blob/d50bd33fd67e944384c9548811a66c1cb03113a5/tools/src/scie_pants/pants_version.py#L239-L252

This thus preps scie-pants release 0.12.1 too, which I'll tag once
merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants