-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 0.27 appears to no longer run on Trusty/RHEL/CentOS due to glibc compat #8652
Comments
cc @moderation |
See #7816 (comment) |
Hmm, yikes. Dropping support for Trusty before EOL seems not great but maybe understandable, but I'm guessing that also dropping support for RHEL/CentOS is going to be very problematic for lots of people. Is there any chance of reconsidering this? |
Error on RHEL 7 is:
|
There was a discussion here: https://groups.google.com/d/msg/bazel-dev/_D6XzfNkQQE/8TNKiNmsCAAJ It looks like the change is breaking more things than intended. I'll wait for Philipp's feedback, but I suspect we'll do a new release to fix this. |
FWIW our internal build of bazel links libstdc++ statically to resolve this type of issue. |
+1 it would be awesome if the bazel official builds could do this also. |
tl;dr I'll fix this and will add official support for CentOS (we'll have to see which versions of CentOS we can do, but 7.x and 8.x sound very likely - does anyone still need CentOS 6.x?). @mzeren-vmw, could you share your patches (if any) / build command-line for Bazel that you use to statically link libstdc++? Maybe we can just use the same for our official releases.
The change dropped official support for Ubuntu 14.04 LTS and instead made Ubuntu 16.04 LTS our main build platform to build Linux release artifacts on. It was unknown at the time which platforms that would break. The reasoning was that Ubuntu 14.04 LTS standard support ended, which makes it "de facto" end of life for the majority of users, because package repositories with security updates can now only be accessed via a paid subscription, which isn't an option for our CI. Users were asked on their opinion regarding this and we built several release candidates of Bazel 0.27.0 to learn about the larger impact of this change. I'm not aware of anyone complaining until after the final release.
Yes. We have to strike a balance here and going with the standard support period of the most popular operating systems seems like a good option for now.
This is unfortunate and I'll improve the current situation in two steps:
It would have been nice if people could have reported breakages earlier, while 0.27.0 was still in the release candidate phase (or even earlier, after the initial announcement that we'll build Bazel on Ubuntu 16.04 LTS in the future, but I understand that it's hard to extrapolate "it will stop working on CentOS 7.x" from that), but now let's see that we can get this to work in 0.28.0 and hopefully in a 0.27.1 patch release. |
@philwo I'd be happy to test release candidate builds on RHEL. Where is the best place to track rc releases? They are not published on https://github.com/bazelbuild/bazel/releases and I don't see announcements on https://groups.google.com/forum/#!forum/bazel-dev |
@moderation Thank you! I'll see that we can upload release candidates as pre-releases to GitHub. They are currently announced on the bazel-discuss group, e.g. see here: https://groups.google.com/forum/#!topic/bazel-discuss/9BFvKuEsEbg. Bazelisk also supports a "last_rc" version which will automatically use the newest release candidate if one is available, otherwise the latest stable release. I'm using this on my personal and work machine and will ask the Bazel team to use it, so that the release candidates get some more real world testing. |
@philwo FWIW, I think the static link fixes would also fix Trusty, at least in the short term, with the understanding it is not fully supported. We would really, really appreciate it if you could do this there also. |
This is affecting googletest builds as wellSucceeding: bazel (0.26.1) |
@mattklein123 I'm happy to do the static linking as soon as someone tells me how. I can also do a quick manual test that the resulting binaries work on Trusty and CentOS. :) |
@gennadiycivil Travis CI uses Ubuntu 14.04 by default, but also supports Ubuntu 16.04. You (or the googletest owners) will have to update their Travis CI config to use Ubuntu 16.04. Does that work for you? |
Ultimately it comes down to passing |
Yes I will update relevant VMs to xenial. |
Unfortunately, we do this by substituting a wrapper for |
i would love for someone on the core team to own the fedora and RHEL builds 😸 |
@philwo @mattklein123 see the wrapper script in Envoy https://github.com/envoyproxy/envoy/blob/master/bazel/cc_wrapper.py, basically |
Thank you @mzeren-vmw and @lizan! @hlopko Could you help me set up static linking of libstdc++ for Bazel’s own build using the current best practices? What’s your recommendation for this? |
It seems like CentOS 7 has a slightly older glibc (2.17 vs. 2.19) and its libstdc++ is only newer by a patch-level bump (4.8.5 vs. 4.8.4) compared to Ubuntu 14.04. If we build our release artifacts on CentOS 7, the resulting binaries might work on all platforms that we intend to support. Statically linking libstdc++ would increase the binary size by a few megabytes, which we'd like to avoid and also I'm wondering what would happen to our JNI library libunix.so - wouldn't that also need to (separately) statically link against libstdc++? |
Re the size increase, its 47_434_606 bytes with statically linked libstdc++, and 45_176_063 with it being linked dynamically. |
So, I'm not a big fan of linking against libstdc++ statically. What if we created additional released binaries for old
Some background to why there is this libstdc++ incompatibility: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html. |
@hlopko You don’t even need that define if you build on CentOS/RHEL7, the toolchain is forcing CXX11ABI off. |
Having multiple binaries would be unfortunate for users of tools like |
Using this variable is will be possible to specify system libraries that should be added after default linker flags, after libraries to link, and after user link flags (i.e. after --linkopt and `linkopts` rule attribute). Flag separator is `:`, similarly to `BAZEL_LINKOPTS`. Escaping is done by `%`. Default value is empty string. With this it's possible to force Bazel to statically link `libstdc++` by using: ``` BAZEL_LINKOPTS=-static-libstdc++ BAZEL_LINKLIBS=-l%:libstdc++.a bazel build //foo ``` Fixes #2840. Relevant for #8652. RELNOTES: Bazel's C++ autoconfiguration now understands `BAZEL_LINKLIBS` environment variable to specify system libraries that should be appended to the link command line. Closes #8660. PiperOrigin-RevId: 253946433
I think this might have an impact on TensorFlow as TF 1.14 is still built on Ubuntu 14.04. /cc @gunan @perfinion @angersson @martinwicke I remember the discussion about TF with manylinux2014 is to move to CentOS 7.0? Wondering if the timeline of 2.0 fit in this scenario. |
@csuter this is the tracker for the TFP 0.27 issue |
For 1.14, we already set the max bazel version to 0.25.2: Even on master, 0.26.1 is the max version: So as far as I am concerned, this is a bazel 0.27 upgrade blocker, rather than a bug in TF build system. |
have you tried my centos build? https://copr.fedorainfracloud.org/coprs/vbatts/bazel/ |
@vbatts I tried with CentOS 7 + your bazel build and it works correctly. Thanks! 👍 |
@yongtang good to hear |
If I remember correctly, last time this happened I saw libc symbol problems, too, in which case statically linking libstdc++ won't help. The simplest solution for now would probably be to use the manylinux2010 devtoolset gcc to compile bazel. https://github.com/pypa/manylinux |
I got Bazel to build and pass its entire test suite on CentOS 7. I’ll verify that the binaries work on all platforms that we supported before and then change our CI to build release binaries on CentOS 7 tomorrow. @r4nt Thanks, I’ll have a look at that! |
@r4nt FWIW, I cannot build Bazel inside that container, it fails with C++ errors:
(I also can't build it in a vanilla CentOS 6 container with similar errors - I guess we just use a too new version of C++ that isn't supported by CentOS 6's libstdc++ and compilers yet?) |
@philwo devtoolset-8 should be a new enough GCC and libstdc++, its supposed to statically link in the missing bits but maybe that part is going wrong? (Note, devtoolset links to the proper centos7 libstdc++ what it can and only statically links the bits that are missing, it doesnt just statically link everything) |
14.04 is no longer supported by bazel bazelbuild/bazel#8652
Can someone on the bazel side please clarify what the plan of record is? If there's going to be a. 0.27.1 fix soon, then we don't have to address this the same way as if there won't. Even just knowing what's planned can help. I can't upgrade to 0.27.x without mitigating this somehow. Just upgrading our build machines is not a workable options for reasons I can't get in to. |
@cgruber Please see #7816 (comment) and the announcement on the mailing list. Bazel 0.27.1 should be released in the next days. If you have any questions, let me know. |
Oh! Sorry, I missed it. Thank you. |
No worries 😊 I should have pointed it out here on the bug, too. |
Using this variable is will be possible to specify system libraries that should be added after default linker flags, after libraries to link, and after user link flags (i.e. after --linkopt and `linkopts` rule attribute). Flag separator is `:`, similarly to `BAZEL_LINKOPTS`. Escaping is done by `%`. Default value is empty string. With this it's possible to force Bazel to statically link `libstdc++` by using: ``` BAZEL_LINKOPTS=-static-libstdc++ BAZEL_LINKLIBS=-l%:libstdc++.a bazel build //foo ``` Fixes bazelbuild#2840. Relevant for bazelbuild#8652. RELNOTES: Bazel's C++ autoconfiguration now understands `BAZEL_LINKLIBS` environment variable to specify system libraries that should be appended to the link command line. Closes bazelbuild#8660. PiperOrigin-RevId: 253946433
I'm closing this, because Bazel 0.27.1 is released and version from now on are built and tested on CentOS 7, so we should be good here. :) |
Using this variable is will be possible to specify system libraries that should be added after default linker flags, after libraries to link, and after user link flags (i.e. after --linkopt and `linkopts` rule attribute). Flag separator is `:`, similarly to `BAZEL_LINKOPTS`. Escaping is done by `%`. Default value is empty string. With this it's possible to force Bazel to statically link `libstdc++` by using: ``` BAZEL_LINKOPTS=-static-libstdc++ BAZEL_LINKLIBS=-l%:libstdc++.a bazel build //foo ``` Fixes bazelbuild#2840. Relevant for bazelbuild#8652. RELNOTES: Bazel's C++ autoconfiguration now understands `BAZEL_LINKLIBS` environment variable to specify system libraries that should be appended to the link command line. Closes bazelbuild#8660. PiperOrigin-RevId: 253946433
Is this expected or should Bazel still support these platforms?
The text was updated successfully, but these errors were encountered: