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.29.0 -> 1.0.0 #69252

Merged
merged 2 commits into from Oct 11, 2019
Merged

bazel: 0.29.0 -> 1.0.0 #69252

merged 2 commits into from Oct 11, 2019

Conversation

guibou
Copy link
Contributor

@guibou guibou commented Sep 22, 2019

Motivation for this change

Update bazel to upstream version.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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 nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @Profpatsch

@guibou
Copy link
Contributor Author

guibou commented Sep 22, 2019

Sorry, I should have created a "draft" PR. This should not be merged until bazel 1.0 is official.

@guibou
Copy link
Contributor Author

guibou commented Sep 22, 2019

@GrahamcOfBorg build bazel.tests

@Mic92
Copy link
Member

Mic92 commented Sep 22, 2019

@guibou marking it as draft is a good idea.

@Mic92 Mic92 changed the title bazel: 0.29.0 -> 1.0.0-rc3 [WIPbazel: 0.29.0 -> 1.0.0-rc3 Sep 22, 2019
@Mic92 Mic92 changed the title [WIPbazel: 0.29.0 -> 1.0.0-rc3 [WIP]: bazel: 0.29.0 -> 1.0.0-rc3 Sep 22, 2019
@ofborg ofborg bot requested a review from mboes September 22, 2019 14:52
@guibou guibou changed the title [WIP]: bazel: 0.29.0 -> 1.0.0-rc3 bazel: 0.29.0 -> 1.0.0-rc3 Oct 10, 2019
@guibou
Copy link
Contributor Author

guibou commented Oct 10, 2019

Bazel 1.0 was released: https://blog.bazel.build/2019/10/10/bazel-1.0.html

I no longer consider this PR as work in progress.

@guibou guibou changed the title bazel: 0.29.0 -> 1.0.0-rc3 bazel: 0.29.0 -> 1.0.0 Oct 10, 2019
@Profpatsch
Copy link
Member

@GrahamcOfBorg build bazel.tests

@Profpatsch
Copy link
Member

We’ll have to fix the darwin build now:

Building Bazel from scratch....../usr/bin/xcrun --sdk macosx clang -fobjc-arc -framework CoreServices -framework Foundation -o /private/tmp/nix-build-bazel-1.0.0.drv-0/bazel_s6Mj2C4u/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'.
./bazel_src/scripts/generate_bash_completion.sh: line 71: ./bazel_src/output/bazel: No such file or directory
builder for '/nix/store/lfpcg31ckz5xf8bdygimz41ngc2dfh0h-bazel-1.0.0.drv' failed with exit code 127

@kalbasit, @uri-canva any input?

@kalbasit
Copy link
Member

We’ll have to fix the darwin build now:

Building Bazel from scratch....../usr/bin/xcrun --sdk macosx clang -fobjc-arc -framework CoreServices -framework Foundation -o /private/tmp/nix-build-bazel-1.0.0.drv-0/bazel_s6Mj2C4u/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'.
./bazel_src/scripts/generate_bash_completion.sh: line 71: ./bazel_src/output/bazel: No such file or directory
builder for '/nix/store/lfpcg31ckz5xf8bdygimz41ngc2dfh0h-bazel-1.0.0.drv' failed with exit code 127

@kalbasit, @uri-canva any input?

Maybe we should fix/expand this 👇?

sed -i -e "s;/usr/bin/xcrun clang;${stdenv.cc}/bin/clang $NIX_CFLAGS_COMPILE $NIX_LDFLAGS -framework CoreFoundation;g" \
scripts/bootstrap/compile.sh \
src/tools/xcode/realpath/BUILD \
src/tools/xcode/stdredirect/BUILD \
tools/osx/BUILD

@flokli
Copy link
Contributor

flokli commented Oct 11, 2019

@GrahamcOfBorg build bazel

@flokli
Copy link
Contributor

flokli commented Oct 11, 2019

bazelbuild/bazel@ada2c55 introduced explicit --sdk macosx parameters, and our sed to patch this to ${stdenv.cc}/bin/clang didn't apply anymore.

I pushed a commit on top of it which should fix the two currently not matching occurences in src/tools/xcode/realpath/BUILD and tools/osx/BUILD, but I'm not sure if more work is needed.

I'm not sure why we need this in first place - passing another compiler to use instead of xcrun should be something supported upstreamed somehow by BAZEL_USE_CPP_ONLY_TOOLCHAIN, so this might be an upstream bug while building bazel itself.

@Profpatsch
Copy link
Member

@GrahamcOfBorg build bazel.tests

@flokli
Copy link
Contributor

flokli commented Oct 11, 2019

I opened bazelbuild/bazel#9993 about using BAZEL_USE_CPP_ONLY_TOOLCHAIN to build bazel itself, so we might get rid of patching these xcrun paths in the future.

@Profpatsch
Copy link
Member

Profpatsch commented Oct 11, 2019

ERROR: /private/var/tmp/_bazel_nixbld1/56203a21b662facfb0adf82c2b07e3a9/external/com_google_protobuf/BUILD:388:1: C++ compilation of rule '@com_google_protobuf//:protoc' failed (Exit 1) cc_wrapper.sh failed: error executing command
  (cd /private/var/tmp/_bazel_nixbld1/56203a21b662facfb0adf82c2b07e3a9/sandbox/processwrapper-sandbox/2/execroot/our_workspace && \
  exec env - \
    PATH=/nix/store/z298gvhxk2z8l0asyn1dxhbfgkyqbdzw-clang-wrapper-7.1.0/bin:/nix/store/2vz5l1vh943013fi6y4c8vrnls30s5gb-clang-7.1.0/bin:/nix/store/ywh9sd47gs8m6r2gdlrg3240zc8lzqlz-coreutils-8.31/bin:/nix/store/fppvpyp7f1018ca9bsxanmxlm0jha3z3-cctools-binutils-darwin-wrapper/bin:/nix/store/8wja3apgzfxb6sq9zlgcwbayzqbv81rg-cctools-binutils-darwin/bin:/nix/store/ywh9sd47gs8m6r2gdlrg3240zc8lzqlz-coreutils-8.31/bin:/nix/store/611gq7s9s11w5ri95fbq2adi9ifrhkmn-python3-3.7.4/bin:/nix/store/z0ql8nlhvxsw4lwlhrinbg1vf8p064w7-zulu1.8.0_121-8.20.0.5/bin:/nix/store/ywh9sd47gs8m6r2gdlrg3240zc8lzqlz-coreutils-8.31/bin:/nix/store/2vi5scm77xixrgp6jp5j2xyg02zqhr1h-findutils-4.7.0/bin:/nix/store/5hzif2m3rjyhpbnrk3g63hr1h3s73q6p-diffutils-3.7/bin:/nix/store/46j1f9xrkxb4z7bjcqgs6aq073rc3jdl-gnused-4.7/bin:/nix/store/zl63kky2pi5vd4x53g2r0nqgirs43msk-gnugrep-3.3/bin:/nix/store/2v37kq4hkyl8bvl9gvrl3ag3d22dzwfc-gawk-5.0.1/bin:/nix/store/nd7wmp6bw5w3pc5p1yfrf9g2m6bwajia-gnutar-1.32/bin:/nix/store/cy599ifm4dwdxfm1kjghd16ni4nmy81c-gzip-1.10/bin:/nix/store/riygq975bghqqlhpqp4hihlvxrbqfzqk-bzip2-1.0.6.0.1-bin/bin:/nix/store/givd6m0izs21yc8drxsy9ps7qyivjsqg-gnumake-4.2.1/bin:/nix/store/v1sp0shp912cwz3h92rmpvpbsyshiq48-bash-4.4-p23/bin:/nix/store/3v46lnv5h6ah03i0mzqhqna5d550w6ic-patch-2.7.6/bin:/nix/store/czgx3s4y2ivcf5mc3iz8jmh9p2fql9vh-xz-5.2.4-bin/bin:/nix/store/v1sp0shp912cwz3h92rmpvpbsyshiq48-bash-4.4-p23/bin:/nix/store/ywh9sd47gs8m6r2gdlrg3240zc8lzqlz-coreutils-8.31/bin:/nix/store/2vi5scm77xixrgp6jp5j2xyg02zqhr1h-findutils-4.7.0/bin:/nix/store/2v37kq4hkyl8bvl9gvrl3ag3d22dzwfc-gawk-5.0.1/bin:/nix/store/zl63kky2pi5vd4x53g2r0nqgirs43msk-gnugrep-3.3/bin:/nix/store/1dxzl7kfpr1xpiislljmxypcl7il89rf-gnutar-1.32/bin:/nix/store/46j1f9xrkxb4z7bjcqgs6aq073rc3jdl-gnused-4.7/bin:/nix/store/cy599ifm4dwdxfm1kjghd16ni4nmy81c-gzip-1.10/bin:/nix/store/9safg84mmd3cd6i0lamd7dppvxrmz3i5-which-2.21/bin:/nix/store/h9dqx3wyaicslf9cdycya16dgmrgqn96-unzip-6.0/bin \
    PWD=/proc/self/cwd \
  external/local_config_cc/cc_wrapper.sh -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/host/bin/external/com_google_protobuf/_objs/protoc/main.d '-frandom-seed=bazel-out/host/bin/external/com_google_protobuf/_objs/protoc/main.o' -iquote external/com_google_protobuf -iquote bazel-out/host/bin/external/com_google_protobuf -iquote external/net_zlib -iquote bazel-out/host/bin/external/net_zlib -iquote external/bazel_tools -iquote bazel-out/host/bin/external/bazel_tools -isystem external/com_google_protobuf/src -isystem bazel-out/host/bin/external/com_google_protobuf/src -isystem external/net_zlib/zlib/include -isystem bazel-out/host/bin/external/net_zlib/zlib/include -g0 -g0 -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_protobuf/src/google/protobuf/compiler/main.cc -o bazel-out/host/bin/external/com_google_protobuf/_objs/protoc/main.o)
Execution platform: @local_config_platform//:host
Use --sandbox_debug to see verbose messages from the sandbox
src/main/tools/process-wrapper-legacy.cc:58: "execvp(external/local_config_cc/cc_wrapper.sh, ...)": No such file or directory
INFO: Elapsed time: 5,092s, Critical Path: 0,14s
INFO: 1 process: 1 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

cc @kalbasit @uri-canva

@flokli
Copy link
Contributor

flokli commented Oct 11, 2019

This smells like the same error as in #66723 (comment), so pinging @aherrmann here - this might already be halfway broken in master on Darwin, the version bump now just exercises more code paths.

What do you think about merging this PR into master as-is, rebasing #66723 on top of it, and fix the darwin problems in there too?

@Profpatsch
Copy link
Member

This smells like the same error as in #66723 (comment), so

Oh wow, you are right!

@Profpatsch
Copy link
Member

In accordance with @flokli I’ll merge and we are going to open an issue about the MacOS thing.

@Profpatsch Profpatsch merged commit a0380cb into NixOS:master Oct 11, 2019
@flokli
Copy link
Contributor

flokli commented Oct 11, 2019

I opened a follow-up issue for the broken MacOS tests in #70994.

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

5 participants