Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to bootstrap Bazel on Z platform #13597

Closed
LakshmiRavichandran1 opened this issue Jun 23, 2021 · 3 comments
Closed

Unable to bootstrap Bazel on Z platform #13597

LakshmiRavichandran1 opened this issue Jun 23, 2021 · 3 comments
Labels
area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: feature request

Comments

@LakshmiRavichandran1
Copy link

ATTENTION! Please read and follow:

  • if this is a question about how to build / test / query / deploy using Bazel, or a discussion starter, send it to bazel-discuss@googlegroups.com
  • if this is a bug or feature request, fill the form below as best as you can.

Description of the problem / feature request:

Unable to bootstrap Bazel on Z platform.
The instructions at https://docs.bazel.build/versions/main/install-compile-source.html#bootstrap-bazel has been followed.
The build fails with errors stating 'external/upb/upb/table.c:742:15: error: this statement may fall through [-Werror=implicit-fallthrough=]' .

Feature requests: what underlying problem are you trying to solve with this feature?

Successfully build Bazel from scratch on Z platform.

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

  1. Get hold of a vm based on s390x architecture
  2. Try to build bazel from scratch following https://docs.bazel.build/versions/main/install-compile-source.html#bootstrap-bazel.

The bazel distribution bazel-4.1.0-dist.zip at https://github.com/bazelbuild/bazel/releases/tag/4.1.0 was used in this case.
# wget https://github.com/bazelbuild/bazel/releases/download/4.1.0/bazel-4.1.0-dist.zip

What operating system are you running Bazel on?

Red Hat Enterprise Linux 8.3 (Ootpa).

#cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.3 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.3"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.3 (Ootpa)"
ANSI_COLOR="0;31"

What's the output of bazel info release?

unable to fetch this info as bazel is not successfully built yet.

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

unable to fetch this info as bazel is not successfully built yet.

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

this information cannot be fetched as only a bazel distribution (bazel-4.1.0-dist.zip) was used to build it from scratch.

Have you found anything relevant by searching the web?

already reported issues or discussions on setting CFLAGS with --copt didnot help overcoming the problem.

Any other information, logs, or outputs that you want to share?

`# env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bash ./compile.sh
🍃  Building Bazel from scratch......
🍃  Building Bazel with Bazel.
...
ERROR: /tmp/bazel_rOgBYs0z/out/external/upb/BUILD:78:11: Compiling upb/table.c failed: (Exit 1): gcc failed: error executing command 
  (cd /tmp/bazel_rOgBYs0z/out/execroot/io_bazel && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin \
    PWD=/proc/self/cwd \
  /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections -MD -MF bazel-out/s390x-opt/bin/external/upb/_objs/upb/table.d '-frandom-seed=bazel-out/s390x-opt/bin/external/upb/_objs/upb/table.o' -iquote external/upb -iquote bazel-out/s390x-opt/bin/external/upb -Wextra -Werror -Wno-long-long -pedantic '-Werror=pedantic' -Wstrict-prototypes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/upb/upb/table.c -o bazel-out/s390x-opt/bin/external/upb/_objs/upb/table.o)
Execution platform: //:default_host_platform
external/upb/upb/table.c: In function 'upb_murmur_hash2':
external/upb/upb/table.c:742:15: error: this statement may fall through [-Werror=implicit-fallthrough=]
     case 3: h ^= data[2] << 16;
             ~~^~~~~~~~~~~~~~~~
external/upb/upb/table.c:743:5: note: here
     case 2: h ^= data[1] << 8;
     ^~~~
external/upb/upb/table.c:743:15: error: this statement may fall through [-Werror=implicit-fallthrough=]
     case 2: h ^= data[1] << 8;
             ~~^~~~~~~~~~~~~~~
external/upb/upb/table.c:744:5: note: here
     case 1: h ^= data[0]; h *= m;
     ^~~~
cc1: all warnings being treated as errors
Target //src:bazel_nojdk failed to build
INFO: Elapsed time: 129.984s, Critical Path: 13.76s
INFO: 608 processes: 17 internal, 591 local.
FAILED: Build did NOT complete successfully

ERROR: Could not build Bazel
# g++ --version
g++ (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# java -showversion
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-b01)
OpenJDK 64-Bit Zero VM (build 25.265-b01, interpreted mode)`
@aiuto aiuto added area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website labels Jun 24, 2021
@cfilleke
Copy link

cfilleke commented Sep 29, 2021

Hi Lakshmi!

try this build command for bootstrapping bazel:

env EXTRA_BAZEL_ARGS="--show_progress_rate_limit=0 --show_task_finish --show_timestamps --worker_verbose --color=no --copt="-Wno-error=implicit-fallthrough"  --curses=yes --host_javabase=@local_jdk//:jdk" bash ./compile.sh &> build.log
  • the --copt="Wno-error=implicit-fallthrough" tells the C compiler to please not turn warnings into fatal errors when the warning concerns implicit fallthroughs (as used in murmur-hash functions that seem to be copied-and-pasted and sometimes modified in about 12 places throughout the code)
  • the other additional options give you a build log you can analyze, debug and store a little easier than the default "now you see it now you don't" bazel build output.
  • NB I am still a little dubious about the implementation of murmur-hash as written on big endian machines, but that is a different discussion.

@meteorcloudy meteorcloudy added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels Feb 7, 2022
Copy link

github-actions bot commented Feb 7, 2024

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Feb 7, 2024
Copy link

github-actions bot commented May 7, 2024

This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post @bazelbuild/triage in a comment here and we'll take a look. Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants