bazel: 0.27.0 build failure on fedora: python3 not detected

Attempting to build the fedora release rpms for v0.27.0 (https://copr.fedorainfracloud.org/coprs/vbatts/bazel) using the spec file at https://github.com/vbatts/copr-build-bazel

Description of the problem / feature request:

full build log bazel-f30.log relevant snip:

+ /usr/bin/mkdir -p bazel-0.27.0
+ cd bazel-0.27.0
+ /usr/bin/unzip -qq /builddir/build/SOURCES/bazel-0.27.0-dist.zip
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.ovaoCj
+ umask 022
+ cd /builddir/build/BUILD
+ cd bazel-0.27.0
+ export CC=gcc
+ CC=gcc
+ export CXX=g++
+ CXX=g++
+ export 'EXTRA_BAZEL_ARGS= --host_javabase=@local_jdk//:jdk --verbose_failures'
+ EXTRA_BAZEL_ARGS=' --host_javabase=@local_jdk//:jdk --verbose_failures'
+ ./compile.sh
Building Bazel from scratch..find: 'src/tools/xcode-common/java/com/google/devtools/build/xcode/common': No such file or directory
find: 'src/tools/xcode-common/java/com/google/devtools/build/xcode/util': No such file or directory
....
Building Bazel with Bazel.
.WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/tmp/bazel_JcPgQJ9V/archive/libblaze.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
Loading:
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    Fetching @io_bazel_skydoc; fetching
Loading: 0 packages loaded
    Fetching @build_bazel_rules_nodejs; fetching
Loading: 0 packages loaded
Loading: 0 packages loaded
DEBUG: /tmp/bazel_JcPgQJ9V/out/external/build_bazel_rules_nodejs/internal/common/check_bazel_version.bzl:49:5:
Current Bazel is not a release version, cannot check for compatibility.
Loading: 0 packages loaded
DEBUG: /tmp/bazel_JcPgQJ9V/out/external/build_bazel_rules_nodejs/internal/common/check_bazel_version.bzl:51:5: Make sure that you are running at least Bazel 0.17.1.
Loading: 0 packages loaded
Loading: 1 packages loaded
[...]
[1,304 / 1,791] 5 actions, 1 running
    JavacBootstrap .../buildjar/libskylark-deps.jar [for host]; 30s local
    [Scann] Compiling src/main/cpp/global_variables.cc
    [Scann] Compiling src/main/cpp/main.cc
    [Scann] Compiling src/main/cpp/blaze.cc
    [Prepa] Executing genrule //src:embedded_tools_nojdk
ERROR: /builddir/build/BUILD/bazel-0.27.0/src/BUILD:311:2: Executing genrule //src:embedded_tools_nojdk failed (Exit 127): bash failed: error executing command 
  (cd /tmp/bazel_JcPgQJ9V/out/execroot/io_bazel && \
  exec env - \
    PATH=/builddir/.local/bin:/builddir/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin \
  /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: @bazel_tools//platforms:host_platform
[1,305 / 1,791] 4 actions, 1 running
    JavacBootstrap .../buildjar/libskylark-deps.jar [for host]; 30s local
    [Scann] Compiling src/main/cpp/global_variables.cc
    [Scann] Compiling src/main/cpp/main.cc
    [Scann] Compiling src/main/cpp/blaze.cc
/usr/bin/env: 'python': No such file or directory
[1,305 / 1,791] 4 actions, 1 running
    JavacBootstrap .../buildjar/libskylark-deps.jar [for host]; 30s local
    [Scann] Compiling src/main/cpp/global_variables.cc
    [Scann] Compiling src/main/cpp/main.cc
    [Scann] Compiling src/main/cpp/blaze.cc
Target //src:bazel_nojdk failed to build
[1,306 / 1,791] 3 actions, 0 running
    [Scann] Compiling src/main/cpp/global_variables.cc
    [Scann] Compiling src/main/cpp/main.cc
    [Scann] Compiling src/main/cpp/blaze.cc
INFO: Elapsed time: 819.724s, Critical Path: 30.61s
[1,306 / 1,791] 3 actions, 0 running
    [Scann] Compiling src/main/cpp/global_variables.cc
    [Scann] Compiling src/main/cpp/main.cc
    [Scann] Compiling src/main/cpp/blaze.cc
INFO: 1260 processes: 1260 local.
[1,306 / 1,791] 3 actions, 0 running
    [Scann] Compiling src/main/cpp/global_variables.cc
    [Scann] Compiling src/main/cpp/main.cc
    [Scann] Compiling src/main/cpp/blaze.cc
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

building the fedora-30-x86_64 rpm on copr

What operating system are you running Bazel on?

Fedora 30 x86_64

What’s the output of bazel info release?

n/a

What’s the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

n/a

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Symbolic link method seems to have worked for me …

# Download, build, and install Bazel
    mkdir -p bazel-0.29.1
    cd bazel-0.29.1
    wget https://github.com/bazelbuild/bazel/releases/download/0.29.1/bazel-0.29.1-dist.zip
    unzip -o bazel-0.29.1-dist.zip
    export EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk"
    ln -s /usr/bin/python3 /usr/bin/python
    ./compile.sh

It looks like the hacki’est winner is simply forcing a python into the path.

# horrible of horribles, just to have `python` in the PATH
mkdir -p ./bin-hack
ln -sf /usr/bin/python3 ./bin-hack/python
export PATH=$(pwd)/bin-hack:$PATH