Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 693986

Summary: dev-util/bazel-0.28.1 : [1Athird_party/.../log_linux.cc:43:13: error: ambiguating new declaration of long int gettid()
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Zac Medico <zmedico>
Status: RESOLVED FIXED    
Severity: normal CC: harrisl, hazelnusse, marien.zwart, paul, perfinion
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=712740
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 691846    
Attachments: emerge-info.txt
dev-util:bazel-0.28.1:20190910-015537.log
emerge-history.txt
environment
etc.portage.tbz2
logs.tbz2
patches for gcc-9

Description Toralf Förster gentoo-dev 2019-09-10 17:05:13 UTC
[364 / 631] checking cached actions

[1Athird_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,

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_no-multilib_hardened-libressl-20190905-001552

  -------------------------------------------------------------------

  Please see the tracker bug for details.

gcc-config -l:
 [1] x86_64-pc-linux-gnu-9.2.0 *

Available Python interpreters, in order of preference:
  [1]   python3.6
  [2]   python2.7 (fallback)
  [3]   pypy (fallback)
Available Ruby profiles:
  [1]   ruby24 (with Rubygems)
  [2]   ruby25 (with Rubygems) *
Available Rust versions:
  [1]   rust-1.37.0 *
java-config:
The following VMs are available for generation-2:
*)	IcedTea JDK 3.13.0 [icedtea-bin-8]
Available Java Virtual Machines:
  [1]   icedtea-bin-8  system-vm

repository timestamp:

==> /var/db/repos/gentoo/metadata/timestamp.chk <==
Tue, 10 Sep 2019 00:45:48 +0000

emerge -qpvO dev-util/bazel
[ebuild  N    ] dev-util/bazel-0.28.1  USE="-examples -tools"
Comment 1 Toralf Förster gentoo-dev 2019-09-10 17:05:16 UTC
Created attachment 589622 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2019-09-10 17:05:19 UTC
Created attachment 589624 [details]
dev-util:bazel-0.28.1:20190910-015537.log
Comment 3 Toralf Förster gentoo-dev 2019-09-10 17:05:21 UTC
Created attachment 589626 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2019-09-10 17:05:24 UTC
Created attachment 589628 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2019-09-10 17:05:27 UTC
Created attachment 589630 [details]
etc.portage.tbz2
Comment 6 Toralf Förster gentoo-dev 2019-09-10 17:05:29 UTC
Created attachment 589632 [details]
logs.tbz2
Comment 7 Helmut Jarausch 2019-09-17 12:05:30 UTC
Created attachment 590068 [details, diff]
patches for gcc-9
Comment 8 Marien Zwart 2019-11-23 05:53:14 UTC
Note that gettid() is only provided by glibc as of 2.30 (see glibc's NEWS file), so I think the attached patch will not work correctly on stable glibc.
Comment 9 Bernd Feige 2019-11-23 10:29:59 UTC
(In reply to Helmut Jarausch from comment #7)
> Created attachment 590068 [details, diff] [details, diff]
> patches for gcc-9

The problem persists with current dev-util/bazel-1.2.0 and the patch still applies, as soon as log_linux.cc.ORIG is changed to log_linux.cc in the patch header... Thanks!
Comment 10 Bernd Feige 2019-11-23 10:33:30 UTC
Note that 1.2.0-r1 should fix this as it carries a patch renaming gpr's local gettid() function:
https://github.com/vbatts/copr-build-bazel/commit/75516ad2211feb6326ce330de0efcd4ee662aba4
Comment 11 David Klempner 2019-11-25 23:06:07 UTC
This was already fixed in grpc upstream, I believe around 1.24.0 timeframe: https://github.com/grpc/grpc/pull/18950

Sadly this is a vendored version and so doesn't automatically get such fixes.
Comment 12 Paul Bors 2019-12-08 01:42:31 UTC
How do we get 1.2.0-r1?

I don't see it released in the default gentoo profile and not listed at:
https://packages.gentoo.org/packages/dev-util/bazel
Comment 13 Paul Bors 2019-12-08 01:46:00 UTC
ClearLinux has patched it this way:
https://github.com/clearlinux-pkgs/tensorflow/blob/master/Add-grpc-fix-for-gettid.patch
Comment 14 Zac Medico gentoo-dev 2019-12-09 06:19:29 UTC
*** Bug 701716 has been marked as a duplicate of this bug. ***
Comment 15 Zac Medico gentoo-dev 2019-12-09 06:21:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27d3e4549dfcbc89442c54b4e5c602b274284203

commit 27d3e4549dfcbc89442c54b4e5c602b274284203
Author:     Julius Putra Tanu Setiaji <indocomsoft@gmail.com>
AuthorDate: 2019-12-05 10:28:36 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-12-09 05:55:47 +0000

    dev-util/bazel: Add gRPC patch for glibc 2.30
    
    Closes: https://bugs.gentoo.org/701398
    Closes: https://github.com/gentoo/gentoo/pull/13878
    Package-Manager: Portage-2.3.80, Repoman-2.3.19
    Signed-off-by: Julius Putra Tanu Setiaji <indocomsoft@gmail.com>
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 dev-util/bazel/bazel-1.2.0-r1.ebuild         | 113 +++++++++++++++++++++++++++
 dev-util/bazel/files/1.2.0-grpc-gettid.patch |  78 ++++++++++++++++++
 2 files changed, 191 insertions(+)
Comment 16 Zac Medico gentoo-dev 2019-12-09 06:21:48 UTC
*** Bug 701398 has been marked as a duplicate of this bug. ***
Comment 17 Paul Bors 2019-12-16 05:07:39 UTC
For a back-port to Bazel-0.29.1 for those who want to install Tensorflow2 with latest stable build (as of today):
https://github.com/paulbors/gentoo-localrepo/tree/master/dev-util/bazel
Comment 18 Benda Xu gentoo-dev 2020-03-26 01:50:59 UTC
(In reply to Paul Bors from comment #17)
> For a back-port to Bazel-0.29.1 for those who want to install Tensorflow2
> with latest stable build (as of today):
> https://github.com/paulbors/gentoo-localrepo/tree/master/dev-util/bazel

Thank you Paul!  The patch has been backported to bazel-0.29.1.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=698fb8eb416f848dff3553d21bae2b445f003370
Comment 19 Paul Bors 2020-03-26 02:57:49 UTC
Thanks Benda,

Promise for next contribution I make to raise a pull request myself. I just need time to go through the setup for Gentoo development in a Docker container so I don't mess up my workstation :)