-
Notifications
You must be signed in to change notification settings - Fork 74.6k
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
TensorFlow now builds with Bazel 1.0 #33415
TensorFlow now builds with Bazel 1.0 #33415
Conversation
Fix cc_library targets by adding 'alwayslink = 1' so targets depending on them build with --incompatible_remove_legacy_whole_archive, which is enabled by default in Bazel 1.0. Fixes tensorflow#32835
ping |
I don't think |
Can you explain why? |
@mihaimaruseac I think specifying |
In this case approving. I was thinking that |
PiperOrigin-RevId: 276476881 Change-Id: Ife776ebdc88038a99f064ac895a86889a2c01473
@laszlocsomor , I did a rerun with TF@HEAD, but the build failure doesn't seem to be fixed. Are we missing anything? |
Well this is embarrassing, but it seems I was actually using 0.26.1 because of the Looking into failures with the real Bazel 1.1.0 now, then again with Bazel 1.0.0. I'll keep this thread updated. |
Fortunately, @scentini has also been working on this same issue and made far more progress than I did. |
Is that progress publicly available? |
Also would be very interested in trying this out :-) |
bazelbuild/bazel#7362 This PR updates `cc_library`s to use `alwayslink=1` when needed. Currently, library archives and library object groups are wrapped in `--whole_archive`, `--no_whole_archive`, thus the whole library is always linked. This changes with Bazel 1.0, and libraries that export otherwise unused symbols must be tagged as `alwayslink=1`. This PR fixes #32835 (once again, as it was fixed by #33415 but the codebase regressed in the meantime.) It also fixes most of the TF tests. PiperOrigin-RevId: 276772147 Change-Id: I05db02e84200a484df52f4f02b601dc486636912
bazelbuild/bazel#7362 This PR updates `cc_library`s to use `alwayslink=1` when needed. Currently, library archives and library object groups are wrapped in `--whole_archive`, `--no_whole_archive`, thus the whole library is always linked. This changes with Bazel 1.0, and libraries that export otherwise unused symbols must be tagged as `alwayslink=1`. This PR fixes tensorflow#32835 (once again, as it was fixed by tensorflow#33415 but the codebase regressed in the meantime.) It also fixes most of the TF tests. PiperOrigin-RevId: 276772147 Change-Id: I05db02e84200a484df52f4f02b601dc486636912
The commit in question is 52167ad. TF at HEAD currently builds with Bazel 1.0: https://buildkite.com/bazel/tensorflow/ There are still a couple of tests that are failing with Bazel 1.0, and I'm working on fixing them. Then, I will set --incompatible_remove_legacy_whole_archive to True in .bazelrc, to prevent regression. |
Is there some kind of hotfix one can apply to compile the current releases (1.15.0 and 2.0.0) with bazel 1.0? |
@laszlocsomor unfortunately neither of those apply on the 1.15.0 or 2.0.0 trees. Is there any other option? |
@timokau : Sorry, I'm not aware of any. Can you try resolving the merge conflicts? I just tried cherry-picking the commits onto r1.15: some conflicting targets don't yet exist (I deleted those), some files don't exist (deleted those too). There are some genuine conflicts too that I now cannot inspect closer, but the goal of these two cherry-picked commits was to add |
bazelbuild/bazel#7362 This PR updates `cc_library`s to use `alwayslink=1` when needed. Currently, library archives and library object groups are wrapped in `--whole_archive`, `--no_whole_archive`, thus the whole library is always linked. This changes with Bazel 1.0, and libraries that export otherwise unused symbols must be tagged as `alwayslink=1`. This PR fixes tensorflow#32835 (once again, as it was fixed by tensorflow#33415 but the codebase regressed in the meantime.) It also fixes most of the TF tests. PiperOrigin-RevId: 276772147 Change-Id: I05db02e84200a484df52f4f02b601dc486636912 (cherry picked from commit 52167ad)
Yeah, unfortunately I'm still stuck. I've gotten this far with cherry-picks: timokau@cec52a8 But the build still fails with
and I don't know where this symbol is coming from. Any help would be much appreciated from me and maybe also other distro maintainers. |
@scentini: does this error look familiar? |
@scentini @laszlocsomor any idea which package causes this:
? from the log it points to something in |
Can you try patching 2d2d6cf ? |
Thank you! Unfortunately with all those patches cherry-picked (to the best of my conflict-resolution ability), the build still fails:
Should I give up on trying to get 1.15 to build? |
@scentini thanks. I managed to port the patches you listed. On
Is there an easy way of identifying which |
Sometimes you can just search where the method is defined, and then find the cc_library that contains it. This case was tricky though, we managed to track it to this library. I sent out a PR internally to add |
…default of --incompatible_remove_legacy_whole_archive in cl/277339372 This should fix the latest issue reported in #33415. Also fixes an internally reported missing symbol. Related to bazelbuild/bazel#7362 PiperOrigin-RevId: 279792794 Change-Id: I6f5d26ee37b9c886662df5e2daf9273c15cae865
…default of --incompatible_remove_legacy_whole_archive in cl/277339372 This should fix the latest issue reported in tensorflow#33415. Also fixes an internally reported missing symbol. Related to bazelbuild/bazel#7362 PiperOrigin-RevId: 279792794 Change-Id: I6f5d26ee37b9c886662df5e2daf9273c15cae865
In case anybody else is interested in this, with this patch I got the 1.15.0 build to work with bazel 1.1. Thanks @scentini! |
Fix cc_library targets by adding 'alwayslink = 1'
so targets depending on them build with
--incompatible_remove_legacy_whole_archive, which
is enabled by default in Bazel 1.0.
Inspired by c3619ce
Fixes #32835