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

bazel build failure: error: ambiguating new declaration of 'long int gettid()' #8666

Closed
vbatts opened this issue Jun 18, 2019 · 4 comments
Closed
Labels
area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website untriaged

Comments

@vbatts
Copy link

vbatts commented Jun 18, 2019

Description of the problem / feature request:

https://copr.fedorainfracloud.org/coprs/vbatts/bazel/ || https://github.com/vbatts/copr-build-bazel

This build issue has been happening since around v0.25.1, but since this is on fedora rawhide which is their rolling development head, this could be due to a latest gcc, glibc, etc

full build log bazel-fedora-rawhide.log
relevant log snippet:

+ 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.zxDZux
+ 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_DXiOpeRe/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
Loading: 0 packages loaded
    Fetching @build_bazel_rules_nodejs; fetching
Loading: 0 packages loaded
Loading: 0 packages loaded
[...]
[314 / 323] 2 actions running
    Compiling third_party/grpc/src/cpp/server/server_context.cc; 1s local
    //third_party/grpc:grpc_client_channel; 0s local
[315 / 324] 2 actions, 1 running
    Compiling third_party/grpc/src/cpp/server/server_context.cc; 1s local
    [Scann] Compiling third_party/grpc/src/core/lib/gpr/log_linux.cc
ERROR: /builddir/build/BUILD/bazel-0.27.0/third_party/grpc/BUILD:386:1: C++ compilation of rule '//third_party/grpc:gpr_base' failed (Exit 1): gcc failed: error executing command
  (cd /tmp/bazel_DXiOpeRe/out/execroot/io_bazel && \
  exec env - \
    PATH=/builddir/.local/bin:/builddir/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin \
    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 '-std=c++0x' -MD -MF bazel-out
/k8-opt/bin/third_party/grpc/_objs/gpr_base/log_linux.d '-frandom-seed=bazel-out/k8-opt/bin/third_party/grpc/_objs/gpr_base/log_linux.o' '-DGRPC_ARES=0' -iquote . -iquote bazel-out/k8-opt/bin -isystem third_party/grpc -isystem bazel-out/k
8-opt/bin/third_party/grpc -isystem third_party/grpc/include -isystem bazel-out/k8-opt/bin/third_party/grpc/include -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME_
_="redacted"' -c third_party/grpc/src/core/lib/gpr/log_linux.cc -o bazel-out/k8-opt/bin/third_party/grpc/_objs/gpr_base/log_linux.o)
Execution platform: //:default_host_platform
[316 / 324] Compiling .../grpc/src/cpp/server/server_context.cc; 1s local
third_party/grpc/src/core/lib/gpr/log_linux.cc:43:13: error: ambiguating new declaration of 'long int gettid()'
   43 | static long gettid(void) { return syscall(__NR_gettid); }
      |             ^~~~~~
In file included from /usr/include/unistd.h:1170,
                 from third_party/grpc/src/core/lib/gpr/log_linux.cc:41:
/usr/include/bits/unistd_ext.h:34:16: note: old declaration '__pid_t gettid()'
   34 | extern __pid_t gettid (void) __THROW;
      |                ^~~~~~
third_party/grpc/src/core/lib/gpr/log_linux.cc:43:13: warning: 'long int gettid()' defined but not used [-Wunused-function]
   43 | static long gettid(void) { return syscall(__NR_gettid); }
      |             ^~~~~~
[316 / 324] Compiling .../grpc/src/cpp/server/server_context.cc; 1s local
Target //src:bazel_nojdk failed to build
[317 / 324] checking cached actions
INFO: Elapsed time: 284.963s, Critical Path: 13.70s
[317 / 324] checking cached actions
INFO: 308 processes: 308 local.
[317 / 324] checking cached actions
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.

build fedora rawhide rpm
docker run -it fedora:rawhide

What operating system are you running Bazel on?

fedora rawhide x86_64

What's the output of bazel info release?

n/a

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

n/a

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

this is from v0.27.0 release zip archive

@benjaminp
Copy link
Collaborator

This is a gRPC issue: grpc/grpc#18950

@irengrig irengrig added area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling untriaged labels Jun 19, 2019
vbatts added a commit to vbatts/copr-build-bazel that referenced this issue Jun 21, 2019
@vbatts
Copy link
Author

vbatts commented Jun 21, 2019

I'm carrying your patch for now, @benjaminp, so that I can build on fedora rawhide

@vbatts
Copy link
Author

vbatts commented Jun 21, 2019

clrpackages pushed a commit to clearlinux-pkgs/bazel that referenced this issue Oct 15, 2019
Rename occurrences of gettid in grpc to avoid naming conflicts with
glibc 2.30's gettid.

bazelbuild/bazel#8666
vbatts/copr-build-bazel@75516ad
grpc/grpc@d1d0173
clearlinux-pkgs/grpcio@5dd8919
@vbatts
Copy link
Author

vbatts commented Dec 19, 2019

closing, as bazel-2 has rebased to include upstream grpc fix

@vbatts vbatts closed this as completed Dec 19, 2019
@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
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 team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website untriaged
Projects
None yet
Development

No branches or pull requests

4 participants