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

pyodide build failure #1966

Open
LecrisUT opened this issue Aug 12, 2024 · 3 comments
Open

pyodide build failure #1966

LecrisUT opened this issue Aug 12, 2024 · 3 comments

Comments

@LecrisUT
Copy link

Description

Sharing my experience enabling pyodide build for spglib. Not sure how to debug it though.

  + pytest /home/runner/work/spglib/spglib/test/functional/python
  Failed to load lib  /tmp/cibw-run-2g4v63rz/cp312-pyodide_wasm32/venv-test/lib/python3.12/site-packages/spglib/_spglib.so
  Error: Didn't expect to load any more file_packager files!
      at D.u.locateFile (/home/runner/.cache/cibuildwheel/.pyodide-xbuildenv-0.26.1/0.26.1/xbuildenv/pyodide-root/dist/pyodide.js:9:10008)
      at locateFile (/home/runner/.cache/cibuildwheel/.pyodide-xbuildenv-0.26.1/0.26.1/xbuildenv/pyodide-root/dist/pyodide.asm.js:10:774)
      at loadLibData (/home/runner/.cache/cibuildwheel/.pyodide-xbuildenv-0.26.1/0.26.1/xbuildenv/pyodide-root/dist/pyodide.asm.js:10:153821)
      at getExports (/home/runner/.cache/cibuildwheel/.pyodide-xbuildenv-0.26.1/0.26.1/xbuildenv/pyodide-root/dist/pyodide.asm.js:10:154250)
      at loadDynamicLibrary (/home/runner/.cache/cibuildwheel/.pyodide-xbuildenv-0.26.1/0.26.1/xbuildenv/pyodide-root/dist/pyodide.asm.js:10:154598)
      at /home/runner/.cache/cibuildwheel/.pyodide-xbuildenv-0.26.1/0.26.1/xbuildenv/pyodide-root/dist/pyodide.asm.js:10:151157

Build log

https://github.com/spglib/spglib/actions/runs/10356874250/job/28667846634

CI config

No response

@henryiii
Copy link
Contributor

PermissionError: [Errno 2] Permission denied: '/home/runner/work/spglib/spglib/pytest-cache-files-sodvmnvb/README.md'

You need to turn off the pytest cache for Pyodide or just ignore the warning if you have warnings as errors.

I often have this, too:

[tool.pytest.ini_options]
filterwarnings = [
  "error",
  "default:could not create cache path:pytest.PytestCacheWarning",
]

[[tool.cibuildwheel.overrides]]
select = "*pyodide*"
inherit.environment = "append"
environment.CFLAGS = "-fexceptions"
environment.LDFLAGS = "-fexceptions"
build-frontend = {name = "build", args = ["--exports", "whole_archive"]}

(Next release of pybind11 might stop requiring the -fexceptions to be added. Other frameworks may or may not need it.)

@LecrisUT
Copy link
Author

Weird it did not get picked up :/. I guess otherwise Failed to load lib is a red-herring?

@agriyakhetarpal
Copy link

If you don't want to filter the warnings and to turn off the pytest cache during the testing step, you can do pytest -p no:cacheprovider <...>

lagru added a commit to scikit-image/scikit-image that referenced this issue Sep 15, 2024
…sting (#7525)

This PR follows up on changes made in gh-7350. Here's a small, point-wise summary noting the changes here:

- It updates the Emscripten/Pyodide CI job added in gh-7350 and removes the workaround JavaScript-based test suite file, since we fixed the `s_cmp` OpenBLAS unresolved symbol coming from SciPy upstream, having updated SciPy in-tree in Pyodide (see pyodide/pyodide#4719, pyodide/pyodide#5012, pyodide/pyodide#5031, and more). This should make the testing slightly cleaner than before, and the test suite now runs till the end without any Pyodide fatal errors being reported.
The [Pyodide xbuildenv](https://github.com/pyodide/pyodide/releases/tag/0.27.0a2) can now be used to set up a virtual environment in which the tests can be run in the same way they were before.
The [`pyodide-build` tool](https://github.com/pyodide/pyodide-build) has been unvendored from the Pyodide repository and now infers the Pyodide version from the releases, downloading the relevant files from the GitHub release. Hence, the `PYODIDE_VERSION` environment variable is no longer required.
- There were some tests that have been failing on 32-bit platforms, which were last discussed quite a while ago: #3091. They surprisingly passed in a WASM 32-bit environment here without issues, which is great. I have updated the skipping conditions to accommodate this.
- There's a known problem with the pytest bytecode generation when running the tests with the xbuildenv interpreter – I disabled the pytest internal cache plugin to fix that, but ignoring the warning (pypa/cibuildwheel#1966 (comment)) works equally as well. Please let me know if there is a preference. :)

Additional context

- Pyodide CI support was first discussed in gh-7265.
- At the time of writing, Pyodide 0.27alpha2 is used in the CI job; once 0.27 stable comes out (should be soon) and `cibuildwheel` updates to it, that (plus this PR) will help unblock another PR that I had opened a while back: gh-7440. I can rebase that PR when ready.
- pyodide/pyodide#4871 (comment)

---

Co-authored-by: Lars Grüter <[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

No branches or pull requests

3 participants