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

In docs.yml, "Build C++ WASM" fails with ninja not found #3329

Open
jpivarski opened this issue Dec 5, 2024 · 2 comments · May be fixed by #3333
Open

In docs.yml, "Build C++ WASM" fails with ninja not found #3329

jpivarski opened this issue Dec 5, 2024 · 2 comments · May be fixed by #3333
Labels
bug The problem described is something that must be fixed tests More or better tests are needed

Comments

@jpivarski
Copy link
Member

For example, in this: https://github.com/scikit-hep/awkward/actions/runs/12188354714/job/34002123054

The failing log is:

Run # pyodide-build doesn't work out of the box with pipx
  # pyodide-build doesn't work out of the box with pipx
  CFLAGS=-fexceptions LDFLAGS=-fexceptions pyodide build --exports whole_archive
  shell: /usr/bin/bash -e {0}
  env:
    X86_64_PYTHON_VERSION: 3.11.0
    SOURCE_DATE_EPOCH: 1668811[2](https://github.com/scikit-hep/awkward/actions/runs/12188354714/job/34002123054#step:9:2)11
    pythonLocation: /opt/hostedtoolcache/Python/3.11.2/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/[3](https://github.com/scikit-hep/awkward/actions/runs/12188354714/job/34002123054#step:9:3).11.2/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.2/x6[4](https://github.com/scikit-hep/awkward/actions/runs/12188354714/job/34002123054#step:9:4)
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.2/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.2/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.2/x64/lib
    PATH: /home/runner/work/_temp/[5](https://github.com/scikit-hep/awkward/actions/runs/12188354714/job/34002123054#step:9:5)5485d84-5b5a-4[6](https://github.com/scikit-hep/awkward/actions/runs/12188354714/job/34002123054#step:9:6)3f-b5b9-a3a3e161e9e8/emsdk-main:/home/runner/work/_temp/55485d84-5b5a-463f-b5b9-a3a3e161e9e8/emsdk-main/upstream/emscripten:/opt/hostedtoolcache/Python/3.11.2/x64/bin:/opt/hostedtoolcache/Python/3.11.2/x64:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
    EMSDK: /home/runner/work/_temp/55485d84-5b5a-463f-b5b9-a3a3e161e9e8/emsdk-main
    EMSDK_NODE: /home/runner/work/_temp/55485d84-5b5a-463f-b5b9-a3a3e161e9e8/emsdk-main/node/20.18.0_64bit/bin/node
  
*** scikit-build-core 0.10.[7](https://github.com/scikit-hep/awkward/actions/runs/12188354714/job/34002123054#step:9:7) using CMake 3.31.1 (wheel)
*** Configuring CMake...
configure: cmake -DCMAKE_C_COMPILER=/tmp/tmpkwce4mjl/cc -DCMAKE_CXX_COMPILER=/tmp/tmpkwce4mjl/c++ -DCMAKE_AR=/tmp/tmpkwce4mjl/ar -DCMAKE_C_COMPILER_AR=/tmp/tmpkwce4mjl/ar -DCMAKE_CXX_COMPILER_AR=/tmp/tmpkwce4mjl/ar --fresh -S. -Bbuild/cpython-311 -DCMAKE_BUILD_TYPE:STRING=Release -Cbuild/cpython-311/CMakeInit.txt -DCMAKE_INSTALL_PREFIX=/tmp/tmpn02_aikz/wheel/platlib -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_CROSSCOMPILING_EMULATOR=/home/runner/work/_temp/554[8](https://github.com/scikit-hep/awkward/actions/runs/12188354714/job/34002123054#step:9:8)5d84-5b5a-463f-b5b9-a3a3e161e9e8/emsdk-main/node/20.18.0_64bit/bin/node
loading initial cache file build/cpython-311/CMakeInit.txt
CMake Error at CMakeLists.txt:6 (project):
  Running
   'ninja' '--version'
  failed with:
   no such file or directory
-- Configuring incomplete, errors occurred!
emcmake: error: 'cmake -DCMAKE_C_COMPILER=/tmp/tmpkwce4mjl/cc -DCMAKE_CXX_COMPILER=/tmp/tmpkwce4mjl/c++ -DCMAKE_AR=/tmp/tmpkwce4mjl/ar -DCMAKE_C_COMPILER_AR=/tmp/tmpkwce4mjl/ar -DCMAKE_CXX_COMPILER_AR=/tmp/tmpkwce4mjl/ar --fresh -S. -Bbuild/cpython-311 -DCMAKE_BUILD_TYPE:STRING=Release -Cbuild/cpython-311/CMakeInit.txt -DCMAKE_INSTALL_PREFIX=/tmp/tmpn02_aikz/wheel/platlib -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_CROSSCOMPILING_EMULATOR=/home/runner/work/_temp/55485d84-5b5a-463f-b5b[9](https://github.com/scikit-hep/awkward/actions/runs/12188354714/job/34002123054#step:9:9)-a3a3e161e9e8/emsdk-main/node/20.18.0_64bit/bin/node' failed (returned 1)
*** CMake configuration failed
* Creating virtualenv isolated environment...
* Installing packages in isolated environment... (pybind11, scikit-build-core>=0.[10](https://github.com/scikit-hep/awkward/actions/runs/12188354714/job/34002123054#step:9:10))
* Getting dependencies for wheel...
* Installing packages in isolated environment... (ninja>=1.5)
* Building wheel...
ERROR Backend subproccess exited when trying to invoke build_wheel
Error: Process completed with exit code 1.

and it was configured somewhere in

awkward-cpp-wasm:
name: Build C++ WASM
runs-on: ubuntu-22.04
needs: [pyodide-python-version]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "${{ needs.pyodide-python-version.outputs.python-version }}"
- name: Generate build files
run: pipx run nox -s prepare -- --headers --signatures
- name: Cache wheel
id: cache-awkward-cpp-wasm-wheel
uses: actions/cache@v4
with:
path: ./awkward-cpp/dist
key: ${{ runner.os }}-"${{ needs.pyodide-python-version.outputs.python-version }}-awkward-cpp-wasm-${{ hashFiles('awkward-cpp/**') }}
- name: Install dependencies
if: steps.cache-awkward-cpp-wasm-wheel.outputs.cache-hit != 'true'
run: python3 -m pip install -r docs/requirements-wasm.txt
- name: Determine EMSDK version
if: steps.cache-awkward-cpp-wasm-wheel.outputs.cache-hit != 'true'
id: compute-emsdk-version
run: |
# Prepare xbuild environment (side-effect)
pyodide config list
# Save EMSDK version
EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)
echo "emsdk-version=$EMSCRIPTEN_VERSION" >> $GITHUB_OUTPUT
working-directory: awkward-cpp
- name: Install EMSDK
uses: mymindstorm/setup-emsdk@v14
if: steps.cache-awkward-cpp-wasm-wheel.outputs.cache-hit != 'true'
with:
version: ${{ steps.compute-emsdk-version.outputs.emsdk-version }}
- name: Build wheel
if: steps.cache-awkward-cpp-wasm-wheel.outputs.cache-hit != 'true'
id: build-awkward-cpp-wasm-wheel
run: |
# pyodide-build doesn't work out of the box with pipx
CFLAGS=-fexceptions LDFLAGS=-fexceptions pyodide build --exports whole_archive
working-directory: awkward-cpp
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: awkward-cpp-wasm
path: awkward-cpp/dist/awkward*wasm32.whl

I think it's failing specifically on

CFLAGS=-fexceptions LDFLAGS=-fexceptions pyodide build --exports whole_archive

so pyodide build. Is this a change in Pyodide? Does it now need Ninja to be installed, and would that be easy to add?

@jpivarski jpivarski added bug The problem described is something that must be fixed tests More or better tests are needed labels Dec 5, 2024
@agoose77
Copy link
Collaborator

agoose77 commented Dec 6, 2024

@jpivarski Ninja should be added by scikit-build-core, unless it's not available on the platform.

However, this machinery was added so that we can deploy the latest version of Awkward Array in docs, with a JupyterLite distribution.

It looks like you removed that functionality, and I just loaded the /lite API path and found it doesn't work. So, if you're not interested in this functionality and shipping JupyterLite, then the quickest fix is just remove any logic pertaining to building of WASM wheels in CI!

@jpivarski
Copy link
Member Author

That's right! I thought this was here as a test of WASM-building, but that's #3270. In that case, I'll just remove this block. Thanks!

@jpivarski jpivarski linked a pull request Dec 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The problem described is something that must be fixed tests More or better tests are needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants