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

3.5.0 doesn't compile with gcc 10 #12056

Closed
svenstaro opened this issue Sep 6, 2020 · 1 comment
Closed

3.5.0 doesn't compile with gcc 10 #12056

svenstaro opened this issue Sep 6, 2020 · 1 comment
Assignees
Labels
bad error messaging Issues where users get stuck because they don't understand what they did wrong P2 We'll consider working on this in future. (Assignee optional) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website

Comments

@svenstaro
Copy link

svenstaro commented Sep 6, 2020

Description of the problem / feature request:

Compiling bazel fails with

google/devtools/build/v1/build_events.proto:20:1: warning: Import google/api/annotations.proto is unused.
ERROR: /tmp/bazel_2EvbRwLJ/out/external/upb/BUILD:57:11: C++ compilation of rule '@upb//:upb' failed (Exit 1): gcc failed: error executing command 
  (cd /tmp/bazel_2EvbRwLJ/out/execroot/io_bazel && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl \
    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/k8-opt/bin/external/upb/_objs/upb/upb.d '-frandom-seed=bazel-out/k8-opt/bin/external/upb/_objs/upb/upb.o' -iquote external/upb -iquote bazel-out/k8-opt/bin/external/upb -Werror -Wno-long-long -pedantic -Wstrict-prototypes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/upb/upb/upb.c -o bazel-out/k8-opt/bin/external/upb/_objs/upb/upb.o)
Execution platform: //:default_host_platform
In file included from /usr/include/string.h:519,
                 from external/upb/upb/upb.h:16,
                 from external/upb/upb/upb.c:2:
In function 'strncpy',
    inlined from 'upb_status_seterrmsg' at external/upb/upb/upb.c:40:3:
/usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 127 equals destination size [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Target //src:bazel_nojdk failed to build
INFO: Elapsed time: 38.598s, Critical Path: 24.22s
INFO: 876 processes: 876 local.
FAILED: Build did NOT complete successfully

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

Compile bazel 3.5.0 with gcc 10 using:

env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" ./compile.sh

What operating system are you running Bazel on?

Arch Linux

I compile bazel using the build instructions found here: https://github.com/archlinux/svntogit-community/blob/packages/bazel/trunk/PKGBUILD

@aiuto aiuto added area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling bad error messaging Issues where users get stuck because they don't understand what they did wrong team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website and removed area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling labels Sep 6, 2020
@davido
Copy link
Contributor

davido commented Sep 7, 2020

The problem seems to be fixed upstream: https://github.com/protocolbuffers/upb/issues/262 and the fix needs to be cherry-picked in Bazel.

@meteorcloudy meteorcloudy self-assigned this Sep 10, 2020
@meteorcloudy meteorcloudy added the P2 We'll consider working on this in future. (Assignee optional) label Sep 10, 2020
aiuto pushed a commit that referenced this issue Sep 12, 2020
Fixes #12056

This is a replacement of #12077 after an unsuccessful attempt to upgrade upb version.

Closes #12083.

PiperOrigin-RevId: 331145667
aiuto pushed a commit that referenced this issue Sep 25, 2020
Fixes #12056

This is a replacement of #12077 after an unsuccessful attempt to upgrade upb version.

Closes #12083.

PiperOrigin-RevId: 331145667
laurentlb pushed a commit that referenced this issue Oct 1, 2020
Fixes #12056

This is a replacement of #12077 after an unsuccessful attempt to upgrade upb version.

Closes #12083.

PiperOrigin-RevId: 331145667
laurentlb pushed a commit that referenced this issue Oct 2, 2020
Fixes #12056

This is a replacement of #12077 after an unsuccessful attempt to upgrade upb version.

Closes #12083.

PiperOrigin-RevId: 331145667
coeuvre pushed a commit to coeuvre/bazel that referenced this issue Oct 22, 2020
Fixes bazelbuild#12056

This is a replacement of bazelbuild#12077 after an unsuccessful attempt to upgrade upb version.

Closes bazelbuild#12083.

PiperOrigin-RevId: 331145667
coeuvre pushed a commit to coeuvre/bazel that referenced this issue Oct 22, 2020
Fixes bazelbuild#12056

This is a replacement of bazelbuild#12077 after an unsuccessful attempt to upgrade upb version.

Closes bazelbuild#12083.

PiperOrigin-RevId: 331145667
@hochhaus hochhaus mentioned this issue Apr 25, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bad error messaging Issues where users get stuck because they don't understand what they did wrong P2 We'll consider working on this in future. (Assignee optional) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website
Projects
None yet
4 participants