bazelbuild / bazelbuild/bazel

Documentation issue: Compiling Bazel from source

Open
#11,500 1 comment 0 reactions 0 assignees View on GitHub
area-EngProd help wanted P3 team-Documentation team-OSS type: documentation (cleanup)
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

Documentation URL: https://docs.bazel.build/versions/master/install-compile-source.html

> Python. Versions 2 and 3 are supported, installing one of them is enough.

But compiling Bazel 3.1.0 with Python 2 fails with the following error.

```
ERROR: /[...]/src/BUILD:305:2: Executing genrule //src:embedded_tools_nojdk failed (Exit 1): bash failed: error executing command
(cd /tmp/bazel_E1NyC7jk/out/execroot/io_bazel && \
exec env - \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/host/bin/src/create_embedded_tools "bazel-out/k8-opt/bin/src/embedded_tools_nojdk.zip" bazel-out/k8-opt/bin/src/embedded_tools_nojdk.params')
Execution platform: //:default_host_platform
Error occurred while attempting to use the default Python toolchain (@rules_python//python:autodetecting_toolchain).
According to '/usr/bin/python -V', version is 'Python 2.7.5', but we need version 3. PATH is:

[...]
```

Contributor guide

Open the contributing guide

Research direction

Open the documentation at https://docs.bazel.build/versions/master/install-compile-source.html and compare its Python version guidance with the Bazel 3.1.0 failure reported in the issue. Confirm which Python version the source build requires, then update the compilation instructions so the documented requirement matches the observed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.