Skip to content

[bazel] [rules_foreign_cc] ModuleNotFoundError: No module named 'tools' #1420

Open
@allsey87

Description

@allsey87

When building a simple hello world binary with Meson, I am hitting the following error

mesonbuild.utils.universal.EnvironmentException: Unknown compiler(s): [['/home/developer/.cache/bazel/_bazel_developer/25e07d78077dfe1eca932359d50e41ef/sandbox/processwrapper-sandbox/9/execroot/_main/external/emsdk/emscripten_toolchain/emcc.sh']]

Digging a bit deeper, it seems emcc.py --version is failing and unable to find the tools module.

The Meson build system
Version: 1.1.1
Source dir: /home/developer/.cache/bazel/_bazel_developer/25e07d78077dfe1eca932359d50e41ef/sandbox/processwrapper-sandbox/9/execroot/_main/testing/hellomeson
Build dir: /home/developer/.cache/bazel/_bazel_developer/25e07d78077dfe1eca932359d50e41ef/sandbox/processwrapper-sandbox/9/execroot/_main/bazel-out/k8-fastbuild/bin/testing/test_meson.build_tmpdir
Build type: native build
Project name: tutorial
Project version: undefined
running cmd: ['/home/developer/.cache/bazel/_bazel_developer/25e07d78077dfe1eca932359d50e41ef/sandbox/processwrapper-sandbox/9/execroot/_main/external/emsdk/emscripten_toolchain/emcc.sh', '--version']
out: 
err: Traceback (most recent call last):
  File "/home/developer/.cache/bazel/_bazel_developer/25e07d78077dfe1eca932359d50e41ef/sandbox/processwrapper-sandbox/9/execroot/_main/external/emscripten_bin_linux/emscripten/emcc.py", line 23, in <module>
    from tools.toolchain_profiler import ToolchainProfiler
ModuleNotFoundError: No module named 'tools'

Perhaps this isn't included in the compiler_files filegroup which is passed to the toolchain?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions