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

Windows PyPy fails to find an interpreter #267

Open
henryiii opened this issue May 13, 2024 · 11 comments
Open

Windows PyPy fails to find an interpreter #267

henryiii opened this issue May 13, 2024 · 11 comments

Comments

@henryiii
Copy link

Windows 64-bit PyPy fails to find an interpreter - Linux and macOS (both archs) are fine. Example: tox-dev/pyproject-fmt-rust#11

It works with cibuildwheel, so I think it's an issue with the action.

@messense
Copy link
Member

Can you try install them via setup-python action before calling this action?

@henryiii
Copy link
Author

Yes, I tried that previously, but I can repeat it in the PR, just a sec.

@messense
Copy link
Member

Probably something has changed in github actions tool cache for PyPy.

maturin-action/src/index.ts

Lines 769 to 779 in b49dce4

async function addToolCachePythonVersionsToPath(): Promise<void> {
const allPythonVersions = tc.findAllVersions('python')
for (const ver of allPythonVersions) {
const installDir = tc.find('Python', ver)
if (installDir) {
core.info(`Python version ${ver} was found in the local cache`)
core.addPath(installDir)
core.addPath(path.join(installDir, 'bin'))
}
}
}

@messense
Copy link
Member

In the meantime you can try enable generate-import-lib feature of pyo3.

See https://pyo3.rs/v0.21.2/features.html?highlight=generate-import-lib#generate-import-lib

@henryiii
Copy link
Author

@henryiii
Copy link
Author

Assuming this the right way to enable it:

[dependencies]
pyo3 = { version = "0.21.2", features = ["abi3-py38", "generate-import-lib"] }

This cause Maturin to simply ignore the pypy jobs completely and only produce the main wheel. The jobs "passes", but only one wheel is produced. Interestingly, the unix jobs still seem fine and produce PyPy wheels.

@messense
Copy link
Member

Interesting, might be a bug in maturin, I'll take a look when I have the time.

@henryiii
Copy link
Author

Is there a way for me to see the core.info printouts? I'm still not seeing it with the recent update.

@messense
Copy link
Member

core.info should be visible by default, so it's simply didn't run.

https://github.com/tox-dev/pyproject-fmt-rust/actions/runs/9068434736/job/24915732974?pr=11#step:3:34 this one does have the output.

@rominf
Copy link

rominf commented Jul 9, 2024

I can confirm that the issue is still actual. Unfortunately, specifying the interpreter manually via --interpreter does not help either. I thought it was an issue with the setup-python GitHub Action, so I created two PRs in my fork of setup-python:

As you might see, link.exe fails to find python*.lib on Windows with PyPy interpreter requested and setting LIB helps maturin to build the extension. However, I tend to believe that the issue is better solved in maturin or the maturin GitHub Action.

I am open to providing more information or filling another issue if needed.

rominf added a commit to rominf/rpds that referenced this issue Jul 10, 2024
Consistently use the following Python versions everywhere in CI:
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
- 3.13
- pypy3.9
- pypy3.10

The heels for Python 3.13 are beneficial for dependent packages such as
`jsonschema`.

Note that PyPy3.8 was dropped since the PyPy website
(https://www.pypy.org/) states they currently support Python versions
3.10, 3.9, and 2.7.

To build extension for PyPy on Windows, "generate-import-lib" in
`Cargo.toml` is needed:
PyO3/maturin-action#267 (comment)
rominf added a commit to rominf/rpds that referenced this issue Jul 10, 2024
Consistently use the following Python versions everywhere in CI:
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
- 3.13
- pypy3.9
- pypy3.10

The heels for Python 3.13 are beneficial for dependent packages such as
`jsonschema`.

Note that PyPy3.8 was dropped since the PyPy website
(https://www.pypy.org/) states they currently support Python versions
3.10, 3.9, and 2.7.

To build extension for PyPy on Windows, "generate-import-lib" in
`Cargo.toml` is needed:
PyO3/maturin-action#267 (comment)
rominf added a commit to rominf/rpds that referenced this issue Jul 10, 2024
Consistently use the following Python versions everywhere in CI:
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
- 3.13
- pypy3.9
- pypy3.10

The heels for Python 3.13 are beneficial for dependent packages such as
`jsonschema`.

Note that PyPy3.8 was dropped since the PyPy website
(https://www.pypy.org/) states they currently support Python versions
3.10, 3.9, and 2.7.

To build extension for PyPy on Windows, "generate-import-lib" in
`Cargo.toml` is needed:
PyO3/maturin-action#267 (comment)
rominf added a commit to rominf/rpds that referenced this issue Jul 10, 2024
Consistently use the following Python versions everywhere in CI:
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
- 3.13
- pypy3.9
- pypy3.10

The heels for Python 3.13 are beneficial for dependent packages such as
`jsonschema`.

Note that PyPy3.8 was dropped since the PyPy website
(https://www.pypy.org/) states they currently support Python versions
3.10, 3.9, and 2.7.

To build extension for PyPy on Windows, "generate-import-lib" in
`Cargo.toml` is needed:
PyO3/maturin-action#267 (comment)
rominf added a commit to rominf/rpds that referenced this issue Jul 10, 2024
To ensure consistently, use the following Python versions everywhere in
CI:
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
- 3.13
- pypy3.9
- pypy3.10

The wheels for Python 3.13 are beneficial for dependent packages such as
`jsonschema`.

Note that PyPy3.8 was dropped since the PyPy website
(https://www.pypy.org/) states they currently support Python versions
3.10, 3.9, and 2.7.

To build the extension for PyPy on Windows, "generate-import-lib" in
`Cargo.toml` is needed, as per this GitHub issue:
PyO3/maturin-action#267 (comment)
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

No branches or pull requests

3 participants