Skip to content

Instantly share code, notes, and snippets.

@tomginsberg
Created January 16, 2024 18:27
Show Gist options
  • Save tomginsberg/8d8ae1507a85545bb9cc7bca2f74fff1 to your computer and use it in GitHub Desktop.
Save tomginsberg/8d8ae1507a85545bb9cc7bca2f74fff1 to your computer and use it in GitHub Desktop.
bazel pip build error
❯ bazel build //pip:pip --verbose_failures
INFO: Invocation ID: 1f41c117-577a-4751-9fb5-108254af44d8
INFO: Build option --host_force_python has changed, discarding analysis cache.
DEBUG: /home/tomginsberg/beit2/b2/bazel/rules/cerebras/configure.bzl:22:14: Cannot find the Cerebras SDK image /opt/Cerebras-SDK-0.9.0-202310042355-11-3a7b5a4f/cbcore_sdk-0.9.0-202310042355-11-21c056e8.sif
DEBUG: /home/tomginsberg/beit2/b2/bazel/rules/cerebras/configure.bzl:6:14: Cerebras targets are not supported.
DEBUG: /home/tomginsberg/beit2/b2/bazel/compilation/configure.bzl:26:14: Cannot find GCC version 13. Falling back to /usr/bin/gcc with version 12.
INFO: Analyzed target //pip:pip (0 packages loaded, 443 targets configured).
INFO: Found 1 target...
ERROR: /home/tomginsberg/beit2/pip/BUILD:8:13: wheel pip==21.3.1 failed: (Exit 1): wheel failed: error executing command
(cd /home/tomginsberg/.cache/bazel/_bazel_tomginsberg/4c5c982af61c48e9e2e02938924e17e8/sandbox/linux-sandbox/5/execroot/beit2 && \
exec env - \
bazel-out/host/bin/b2/bazel/rules/pip/tools/wheel 'pip==21.3.1' --index_archive bazel-out/k8-opt/bin/pip/pip-cpython-311/download.tar --wheel bazel-out/k8-opt/bin/pip/pip-cpython-311/pip.whl --python external/python/py.sh --build-dep external/pypi_pip/file/pip-21.3.1-py3-none-any.whl)
# Configuration: 7178c78e1b0178f855850615394de1f72c07141c5256bfaacd237d6a5d133b38
# Execution platform: @local_config_platform//:host
Use --sandbox_debug to see verbose messages from the sandbox
Traceback (most recent call last):
File "/home/tomginsberg/.cache/bazel/_bazel_tomginsberg/4c5c982af61c48e9e2e02938924e17e8/sandbox/linux-sandbox/5/execroot/beit2/bazel-out/host/bin/b2/bazel/rules/pip/tools/wheel.runfiles/beit2/b2/bazel/rules/pip/tools/wheel.py", line 123, in <module>
main()
File "/home/tomginsberg/.cache/bazel/_bazel_tomginsberg/4c5c982af61c48e9e2e02938924e17e8/sandbox/linux-sandbox/5/execroot/beit2/bazel-out/host/bin/b2/bazel/rules/pip/tools/wheel.runfiles/beit2/b2/bazel/rules/pip/tools/wheel.py", line 119, in main
wheel(args.python, args.index_archive, args.package_name, args.build_dep, args.wheel)
File "/home/tomginsberg/.cache/bazel/_bazel_tomginsberg/4c5c982af61c48e9e2e02938924e17e8/sandbox/linux-sandbox/5/execroot/beit2/bazel-out/host/bin/b2/bazel/rules/pip/tools/wheel.runfiles/beit2/b2/bazel/rules/pip/tools/wheel.py", line 66, in wheel
run_silently(cmd, env)
File "/home/tomginsberg/.cache/bazel/_bazel_tomginsberg/4c5c982af61c48e9e2e02938924e17e8/sandbox/linux-sandbox/5/execroot/beit2/bazel-out/host/bin/b2/bazel/rules/pip/tools/wheel.runfiles/beit2/b2/bazel/rules/pip/tools/common.py", line 15, in run_silently
subprocess.check_output(cmd, env=env, stderr=subprocess.STDOUT)
File "/usr/lib/python3.11/subprocess.py", line 466, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'strace'
----------------
Note: The failure of target //b2/bazel/rules/pip/tools:wheel (with exit code 1) may have been caused by the fact that it is running under Python 3 instead of Python 2. Examine the error to determine if that appears to be the problem. Since this target is built in the host configuration, the only way to change its version is to set --host_force_python=PY2, which affects the entire build.
If this error started occurring in Bazel 0.27 and later, it may be because the Python toolchain now enforces that targets analyzed as PY2 and PY3 run under a Python 2 and Python 3 interpreter, respectively. See https://github.com/bazelbuild/bazel/issues/7899 for more information.
----------------
Target //pip:pip failed to build
INFO: Elapsed time: 1.701s, Critical Path: 1.51s
INFO: 3 processes: 2 internal, 1 linux-sandbox.
FAILED: Build did NOT complete successfully
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment