Skip to content

[bazel] emsdk >=5.0.2 fails in cmake rule (foreign_rules_cc) #1689

@nick-dodonov

Description

@nick-dodonov

Building cmake rule fails because provided EMSDK_PYTHON (introduced in 5464280) is relative to execution_root,
but cmake can implicitly change current directory in builds (especially during try_compile steps to CMakeFiles/CMakeScratch).

So in usual cmake builds there are failed:

  1. "Detecting C compiler ABI info" step
  2. "Check for working C compiler" step

Full log: emdsk-5-cmake-bug.log
Important part:

/private/var/tmp/_bazel/1b4150e0bd5fb01fec2f73043048bd2e/execroot/_main/external/emsdk+/emscripten_toolchain/emcc.sh: line 5: exec: /private/var/tmp/_bazel/1b4150e0bd5fb01fec2f73043048bd2e/execroot/_main/bazel-out/wasm-dbg-wasm-ST-87cf4af9f873/bin/external/sdl3+/sdl3_cmake_base.build_tmpdir/CMakeFiles/CMakeScratch/TryCompile-ZttFNR/external/rules_python++python+python_3_11_aarch64-apple-darwin/bin/python3: cannot execute: No such file or directory

Because: EMSDK_PYTHON=external/rules_python++python+python_3_11_aarch64-apple-darwin/bin/python3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions