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 0.13 #40525

Merged
merged 2 commits into from Jun 24, 2018
Merged

Bazel 0.13 #40525

merged 2 commits into from Jun 24, 2018

Conversation

mboes
Copy link
Contributor

@mboes mboes commented May 14, 2018

Motivation for this change

Upgrade to latest upstream.

There is already #40424 and #40205 that propose much the same thing. But the latter is currently just a change to the version number and sha256 sum, which doesn't build on NixOS. And the former propose far more changes in this PR that are certainly worth considering, but not on the critical path to upgrading to Bazel 0.13.

As per #39585, this change furthermore contains a change in package maintainer.

As noted in #40205, with this PR Tensorflow doesn't build due to Bazel 0.13 removing features that were previously deprecated. This needs to be addressed still.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@xeji
Copy link
Contributor

xeji commented May 14, 2018

Thank you. May I suggest you and the authors of the other 2 related PRs, @uri-canva and @rdnetto4 discuss this and try to reach consensus on how to move forward.

@uri-canva
Copy link
Contributor

I will close my PR and create a new PR for darwin support after Bazel has been upgraded to 0.13.0. As @mboes notes my PR has bigger changes than strictly required for the upgrade because of that.

@uri-canva uri-canva mentioned this pull request May 15, 2018
8 tasks
@zimbatm
Copy link
Member

zimbatm commented May 15, 2018

@GrahamcOfBorg build bazel

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: bazel

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: bazel

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: bazel

Partial log (click to expand)

[2,076 / 2,210] no action
INFO: Elapsed time: 217.383s, Critical Path: 53.88s
[2,076 / 2,210] no action
INFO: 1706 processes: 1488 local, 218 worker.
[2,076 / 2,210] no action
FAILED: Build did NOT complete successfully

ERROR: Could not build Bazel
builder for '/nix/store/ahjv8qhsacyd6difl940v9bxdgyd7h6v-bazel-0.13.0.drv' failed with exit code 1
error: build of '/nix/store/ahjv8qhsacyd6difl940v9bxdgyd7h6v-bazel-0.13.0.drv' failed

@zimbatm
Copy link
Member

zimbatm commented May 15, 2018

@mboes the /usr/bin/env replacement is still necessary. The build is currently failing with:

Executing genrule //src:embedded_tools; 0s local
/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/bash: bazel-out/host/bin/src/create_embedded_tools: /usr/bin/env: bad interpreter: No such file or directory

Note that is might not be the case on your local host if build sandboxing is turned off.

@xeji
Copy link
Contributor

xeji commented May 16, 2018

@GrahamcOfBorg build bazel

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: bazel

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: bazel

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: bazel

Partial log (click to expand)

//examples/cpp:hello-success_test                                        PASSED in 0.1s
//examples/java-native/src/test/java/com/example/myproject:hello         PASSED in 0.2s

Executed 2 out of 2 tests: 2 tests pass.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.
installing
post-installation fixup
patching script interpreter paths in /nix/store/k9i0ana4jn3nd8sp50qjav42k4v4h7rr-bazel-0.13.0
checking for references to /tmp in /nix/store/k9i0ana4jn3nd8sp50qjav42k4v4h7rr-bazel-0.13.0...
/nix/store/k9i0ana4jn3nd8sp50qjav42k4v4h7rr-bazel-0.13.0

@zimbatm
Copy link
Member

zimbatm commented May 16, 2018

things failing with nox-review:

error: build of '/nix/store/3p39fs8ffx0ypb71nvxmvlz4bb08ihka-python2.7-tflearn-0.2.1.drv', '/nix/store/d16mya1nc0inxijjmxypkpx4p633vjpz-python3.6-tensorflow-1.5.0.drv', '/nix/store/d4qdhaaj9n6lfl67s52kvi8ng8s8mn40-python3.6-edward-1.3.5.drv', '/nix/store/k5r4bbbsn00kqjhnv1bxghfxhacpihw7-python3.6-tflearn-0.2.1.drv', '/nix/store/racll38b0qkg79yd0x06yvz75h04mp2j-python2.7-edward-1.3.5.drv', '/nix/store/xk47wvbmyzjalbdfadr70v841bax4nfa-python2.7-tensorflow-1.5.0.drv' failed

they all seem to be tensorflow-related

@zimbatm
Copy link
Member

zimbatm commented May 16, 2018

@xeji
Copy link
Contributor

xeji commented May 16, 2018

Yes, this breaks the build of tensorflow and would require us to bump it to 1.8 according to discussion in #40205 . I'd rather wait for someone familiar with tensorflow to test if 1.8 really works before we merge this.

@zimbatm
Copy link
Member

zimbatm commented May 16, 2018

it would also be acceptable to keep version 0.12 around until tensorflow gets upgraded

@mboes
Copy link
Contributor Author

mboes commented May 17, 2018

So I tried giving building tensorflow 1.8 a go. But I either ran out of memory or hit what looks like a internal race condition within Bazel. The error goes something like this:

java.lang.RuntimeException: Unrecoverable error while evaluating node 'PACKAGE:tensorflow/core/kernels' (requested by nodes '//tensorflow:libtensorflow_framework.so com.google.devtools.build.lib.skyframe.BuildConfigurationValue$Key@edd564fa true (2067960961)', '//tensorflow:libtensorflow_framework.so com.google.devtools.build.lib.skyframe.BuildConfigurationValue$Key@71af1344 false (265845462)', '//tensorflow/core/grappler/costs:measuring_cost_estimator com.google.devtools.build.lib.skyframe.BuildConfigurationValue$Key@71af1344 false (2120862100)', '//tensorflow/core:core_cpu_internal com.google.devtools.build.lib.skyframe.BuildConfigurationValue$Key@71af1344 false (308542468)', '//tensorflow/core:framework_internal_headers_lib_gather com.google.devtools.build.lib.skyframe.BuildConfigurationValue$Key@71af1344 false (2112525397)', '//tensorflow/core:framework_internal_headers_lib_gather com.google.devtools.build.lib.skyframe.BuildConfigurationValue$Key@edd564fa true (824725492)')
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:424)
        at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:355)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Invalid EvalException:
java.lang.InterruptedException
        at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:503)
        at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:85)
        at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:62)
        ...

Only related upstream issue I could find is bazelbuild/bazel#2423.

Upshot: let's try keeping 0.12 for Tensorflow then, until we can get to the bottom of this.

@mboes
Copy link
Contributor Author

mboes commented May 17, 2018

Or more likely, this issue: bazelbuild/bazel#5177.

@xeji
Copy link
Contributor

xeji commented May 17, 2018

@mboes thanks for investigating. Let's keep the old version as bazel_0_12 and pin tensorflow to it for the time being.

@mboes mboes mentioned this pull request May 17, 2018
8 tasks
@mboes
Copy link
Contributor Author

mboes commented May 17, 2018

@xeji so I retried the build on another computer. It works fine. PR to upgrade Tensorflow submitted as #40689. I tested that Bazel 0.13 is able to build that version of Tensorflow on that other computer. While I did run into a known race condition on my laptop, provided @GrahamcOfBorg is happy then I think we should still upgrade, because I could not reproduce this race condition and for all we know the race condition was already there in Bazel 0.12.

@xeji
Copy link
Contributor

xeji commented May 24, 2018

@mboes this cannot be merged yet because the tensorflow update (#40689) doesn't build.
We can merge this if we keep the old version as bazel_0_12 and pin tensorflow to it.
Or we can let this wait until #40689 is fixed. What do you prefer?

@globin
Copy link
Member

globin commented Jun 11, 2018

cc @abbradar

@mboes
Copy link
Contributor Author

mboes commented Jun 23, 2018

@xeji looks like tensorflow is no longer a problem, because since #41259 Tensorflow is now built from a binary distribution. So I believe that blocker is now gone.

@mboes
Copy link
Contributor Author

mboes commented Jun 23, 2018

I have rebased the commits that were on this branch originally to current master, which has #41259 merged in.

@xeji
Copy link
Contributor

xeji commented Jun 24, 2018

@GrahamcOfBorg build bazel

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: bazel

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: bazel

Partial log (click to expand)

./tools/test/collect_coverage.sh: interpreter directive changed from "/bin/bash -x" to "/nix/store/46y32j94pm0cz6ygywb3wxxj0fdbqj13-bash/bin/bash -x"
./tools/test/test-setup.sh: interpreter directive changed from "/bin/bash" to "/nix/store/46y32j94pm0cz6ygywb3wxxj0fdbqj13-bash/bin/bash"
configuring
no configure script, doing nothing
building
Building Bazel from scratch....../usr/bin/xcrun clang -fobjc-arc -framework CoreServices -framework Foundation -o /tmp/bazel_jHWExtEd/archive/_embedded_binaries/xcode-locator tools/osx/xcode_locator.m
xcode-select: error: no developer tools were found at '/Applications/Xcode.app', and no install could be requested (perhaps no UI is present), please install manually from 'developer.apple.com'.
/nix/store/7amnc2662p390bgzj6c0snylj19vxmj2-stdenv-darwin/setup: line 1291: ./output/bazel: No such file or directory
builder for '/nix/store/skpwcblpi077b7zw26mm0jqmlznsw8d9-bazel-0.13.0.drv' failed with exit code 127
�[31;1merror:�[0m build of '/nix/store/skpwcblpi077b7zw26mm0jqmlznsw8d9-bazel-0.13.0.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: bazel

Partial log (click to expand)

//examples/cpp:hello-success_test                                        PASSED in 0.0s
//examples/java-native/src/test/java/com/example/myproject:hello         PASSED in 0.2s

Executed 2 out of 2 tests: 2 tests pass.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.
installing
post-installation fixup
patching script interpreter paths in /nix/store/jh7xc1qbf4by5cqnqxgiafvwfwqbyish-bazel-0.13.0
checking for references to /tmp in /nix/store/jh7xc1qbf4by5cqnqxgiafvwfwqbyish-bazel-0.13.0...
/nix/store/jh7xc1qbf4by5cqnqxgiafvwfwqbyish-bazel-0.13.0

@xeji
Copy link
Contributor

xeji commented Jun 24, 2018

Darwin build was broken before this PR despite #41911, which (according to its title) should have fixed it. cc @uri-canva

@xeji xeji merged commit 25fa3ff into NixOS:master Jun 24, 2018
@xeji xeji mentioned this pull request Jun 24, 2018
8 tasks
@uri-canva
Copy link
Contributor

xcode-select: error: no developer tools were found at '/Applications/Xcode.app', and no install could be requested (perhaps no UI is present), please install manually from 'developer.apple.com'.

It seems Bazel cannot be built on CI without Xcode, and I'm not sure we can install Xcode from nix because of the license. A shim can be created, but that's a lot of work.

In the meantime I'll double check it's working on darwin on master, thanks for the heads up @xeji.

@uri-canva uri-canva mentioned this pull request Jun 26, 2018
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants