Skip to content

Fix eigen wheel builds - #2160

Open
bryanwweber wants to merge 6 commits into
Cantera:mainfrom
bryanwweber:fix-eigen-wheel-builds
Open

Fix eigen wheel builds#2160
bryanwweber wants to merge 6 commits into
Cantera:mainfrom
bryanwweber:fix-eigen-wheel-builds

Conversation

@bryanwweber

Copy link
Copy Markdown
Member

Changes proposed in this pull request

  • Fixes wheel builds in Cantera/pypi-packages by exporting the imported Eigen symbol as a project-global in the CMake config. By default, imported symbols are not shared to sibling directories; when the ext_manager introduced a dependency on Eigen3::Eigen, the symbol couldn't actually be found.
  • Updates and pins a few build dependencies

AI Statement (required)

  • Limited use of generative AI.
    I asked Gemma (I think?) about the CMake garbage and it answered correctly

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • AI Statement is included
  • The pull request is ready for review

Comment thread interfaces/python_sdist/pyproject.toml.in
Comment thread interfaces/python_sdist/pyproject.toml.in
@bryanwweber
bryanwweber force-pushed the fix-eigen-wheel-builds branch from 2c8da7f to 153a795 Compare August 3, 2026 01:55
@speth

speth commented Aug 4, 2026

Copy link
Copy Markdown
Member

Any idea which update here is causing the Pyodide build to fail -- the making Eigen "global" according to CMake, or one of the dependency updates? Do we just need to simultaneously bump some of the Pyodide-related build dependencies?

@bryanwweber

Copy link
Copy Markdown
Member Author

I haven't been able to figure it out yet, but I also haven't tried very hard. I only got as far as reproducing the failure locally.

@bryanwweber
bryanwweber force-pushed the fix-eigen-wheel-builds branch from 153a795 to 1f9ec59 Compare August 5, 2026 12:59
@bryanwweber

Copy link
Copy Markdown
Member Author

I reverted the pyodide version changes in pixi.toml, but now I get a different error locally. Let's see if it's reproduced in CI.

FAILED: [code=1] _deps/fmt-build/CMakeFiles/fmt-module.dir/src/fmt.cc.o.ddi
"/var/home/bweber/.cache/.pyodide-xbuildenv-0.33.0/0.29.3/emsdk/upstream/emscripten/emscan-deps" -format=p1689 -- /tmp/cantera-pyodide-src-09y0kazt/cantera-4.0.0a2/.pyodide_build/pywasmcross_symlinks/c++  -I/tmp/tmpfh3tfvwu/build/_deps/fmt-src/include -O2 -g0 -fPIC -fwasm-exceptions -sSUPPORT_LONGJMP -O2 -g0 -fPIC -fwasm-exceptions -sSUPPORT_LONGJMP -O2 -g0 -fPIC -fwasm-exceptions -sSUPPORT_LONGJMP -O2 -g0 -fPIC -fwasm-exceptions -sSUPPORT_LONGJMP -O3 -DNDEBUG -std=gnu++20 -fPIC -x c++ /tmp/tmpfh3tfvwu/build/_deps/fmt-src/src/fmt.cc -c -o _deps/fmt-build/CMakeFiles/fmt-module.dir/src/fmt.cc.o -MT _deps/fmt-build/CMakeFiles/fmt-module.dir/src/fmt.cc.o.ddi -MD -MF _deps/fmt-build/CMakeFiles/fmt-module.dir/src/fmt.cc.o.ddi.d > _deps/fmt-build/CMakeFiles/fmt-module.dir/src/fmt.cc.o.ddi.tmp && mv _deps/fmt-build/CMakeFiles/fmt-module.dir/src/fmt.cc.o.ddi.tmp _deps/fmt-build/CMakeFiles/fmt-module.dir/src/fmt.cc.o.ddi
error: unknown argument: '-sSUPPORT_LONGJMP'

…Emscripten flags

Add CMAKE_CXX_SCAN_FOR_MODULES=OFF to the pyodide build CMAKE_ARGS. When
scikit-build-core 1.0.3+ runs with minimum-version enforcement, it attempts to
scan for C++ modules using emscan-deps in the Emscripten environment. This
scanning phase doesn't properly handle Emscripten compiler flags like
-sSUPPORT_LONGJMP, causing the build to fail.

Disabling module scanning for Pyodide builds is safe because Pyodide doesn't
require C++ module support, and CMake will fall back to traditional dependency
detection.
Add CMAKE_CXX_SCAN_FOR_MODULES to [tool.scikit-build.cmake.define] so that
scikit-build-core properly recognizes and passes through the environment variable.

This allows build_pyodide_wheel.py to set CMAKE_CXX_SCAN_FOR_MODULES=OFF in the
environment, which scikit-build-core will then configure and pass to CMake,
disabling the C++ module scanning that causes incompatible Emscripten flags.
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.15%. Comparing base (69c08c7) to head (e569566).
⚠️ Report is 36 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2160   +/-   ##
=======================================
  Coverage   78.15%   78.15%           
=======================================
  Files         453      453           
  Lines       55433    55433           
  Branches     9115     9115           
=======================================
+ Hits        43324    43326    +2     
+ Misses       9060     9059    -1     
+ Partials     3049     3048    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 this pull request may close these issues.

2 participants