-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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_5: init at 5.0.0 #156110
bazel_5: init at 5.0.0 #156110
Conversation
Super excited to see this merged! |
👍 Good job, can't wait for it. |
Bazel 5 is going to be a second long term support release. Changes from bazel_4: - compile java_tools (such as ijar) using nix-provided jdk - local jvm and jdk are now passed using --tool_java_runtime_version, --tool_java_runtime_version and --extra_toolchains flags see https://docs.bazel.build/versions/5.0.0/bazel-and-java.html for details - update-srcDeps.py: distdir_tar function renamed to _distdir_tar to properly parse bazel query output executed against bazel 5 sources - bazel_5.updater: uses bazel_4 to generate src-deps.json. This change was required to handle json.decode calls in bazel 5 dependencies - protobuf-test and java-test adjusted to take into consideration both jdk 8 (for Bazel < 5.0.0) and jdk 11 (for Bazel >= 5.0.0) https://blog.bazel.build/2022/01/19/bazel-5.0.html https://github.com/bazelbuild/bazel/releases/tag/5.0.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't build it, get this error on Monterey, maybe ofborg will have more luck once you remove the references to the BUILD
files that don't exist anymore:
ERROR: /private/tmp/nix-build-bazel-5.0.0.drv-0/bazel_src/tools/osx/BUILD:36:8: Executing genrule //tools/osx:xcode-locator-genrule failed: (Exit 1): bash failed: error executing command
(cd /private/tmp/nix-build-bazel-5.0.0.drv-0/bazel_w2MkV045/out/execroot/io_bazel && \
exec env - \
PATH=/nix/store/srv3qk2wrq058z2wwvdj02hm5jlvcj40-coreutils-9.0/bin:/nix/store/fkygdjhm2raz32xrzwnq8b89hkkdc9vv-python3-3.9.9/bin:/nix/store/n5wfzh32h5z8f4cgvzi18bw9z2cx72li-unzip-6.0/bin:/nix/store/j6psba7fhh8s5f5jws10ab4jxib07vyn-which-2.21/bin:/nix
/nix/store/b0q4wjdw6xwhfsqy8ab106cmhn5xrr8p-bash-5.1-p12/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh;
/nix/store/scg11r43cghwmwzdxdnfmf9smg85hdqx-clang-wrapper-11.1.0/bin/clang -frandom-seed=q9a93n662b -Wno-deprecated-declarations -isystem /nix/store/fkygdjhm2raz32xrzwnq8b89hkkdc9vv-python3-3.9.9/include -isystem /nix/store/cx3cahmpcl9zc3wg6z79zv8j1pj
')
# Configuration: 8e55c9b76f8a990b2d0df99e7ea9a26196076ba338ba4436cfcc96e98e157942
# Execution platform: //:default_host_platform
In file included from tools/osx/xcode_locator.m:24:
In file included from /nix/store/488a9qwl2njhxzqc9jkanww8m6ivrzgn-apple-framework-CoreServices/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19:
In file included from /nix/store/f1sj4q111pvlz2gc6fh2giy59p4hjx3j-apple-framework-CoreFoundation/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
In file included from /nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/types.h:75:
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/cdefs.h:761:2: error: Unsupported architecture
#error Unsupported architecture
^
In file included from tools/osx/xcode_locator.m:24:
In file included from /nix/store/488a9qwl2njhxzqc9jkanww8m6ivrzgn-apple-framework-CoreServices/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19:
In file included from /nix/store/f1sj4q111pvlz2gc6fh2giy59p4hjx3j-apple-framework-CoreFoundation/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
In file included from /nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/types.h:78:
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/machine/types.h:37:2: error: architecture not supported
#error architecture not supported
^
In file included from tools/osx/xcode_locator.m:24:
In file included from /nix/store/488a9qwl2njhxzqc9jkanww8m6ivrzgn-apple-framework-CoreServices/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19:
In file included from /nix/store/f1sj4q111pvlz2gc6fh2giy59p4hjx3j-apple-framework-CoreFoundation/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
In file included from /nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/types.h:79:
In file included from /nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:33:
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/machine/_types.h:34:2: error: architecture not supported
#error architecture not supported
^
In file included from tools/osx/xcode_locator.m:24:
In file included from /nix/store/488a9qwl2njhxzqc9jkanww8m6ivrzgn-apple-framework-CoreServices/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19:
In file included from /nix/store/f1sj4q111pvlz2gc6fh2giy59p4hjx3j-apple-framework-CoreFoundation/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
In file included from /nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/types.h:79:
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
typedef __int64_t __darwin_blkcnt_t; /* total blocks */
^
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:56:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
typedef __int32_t __darwin_blksize_t; /* preferred block size */
^
note: '__int128_t' declared here
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:57:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
typedef __int32_t __darwin_dev_t; /* dev_t */
^
note: '__int128_t' declared here
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_gid_t; /* [???] process and group IDs */
^
note: '__uint128_t' declared here
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_id_t; /* [XSI] pid_t, uid_t, or gid_t*/
^
note: '__uint128_t' declared here
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'
typedef __uint64_t __darwin_ino64_t; /* [???] Used for 64 bit inodes */
^
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
^
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'; did you mean '__uint128_t'?
typedef __uint16_t __darwin_mode_t; /* [???] Some file attributes */
^
note: '__uint128_t' declared here
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
typedef __int64_t __darwin_off_t; /* [???] Used for file sizes */
^
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:72:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
typedef __int32_t __darwin_pid_t; /* [???] process and group IDs */
^
note: '__int128_t' declared here
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_sigset_t; /* [???] signal set */
^
note: '__uint128_t' declared here
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:74:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
typedef __int32_t __darwin_suseconds_t; /* [???] microseconds */
^
note: '__int128_t' declared here
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_uid_t; /* [???] user IDs */
^
note: '__uint128_t' declared here
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */
^
note: '__uint128_t' declared here
In file included from tools/osx/xcode_locator.m:24:
In file included from /nix/store/488a9qwl2njhxzqc9jkanww8m6ivrzgn-apple-framework-CoreServices/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19:
In file included from /nix/store/f1sj4q111pvlz2gc6fh2giy59p4hjx3j-apple-framework-CoreFoundation/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
In file included from /nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/types.h:81:
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/machine/endian.h:37:2: error: architecture not supported
#error architecture not supported
^
In file included from tools/osx/xcode_locator.m:24:
In file included from /nix/store/488a9qwl2njhxzqc9jkanww8m6ivrzgn-apple-framework-CoreServices/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19:
In file included from /nix/store/f1sj4q111pvlz2gc6fh2giy59p4hjx3j-apple-framework-CoreFoundation/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
/nix/store/8xkv6d53n2hznyvf1vsyknqz4awj77i7-Libsystem-1238.60.2/include/sys/types.h:95:9: error: unknown type name 'u_int64_t'
typedef u_int64_t u_quad_t; /* quads */
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Target //src:bazel_nojdk failed to build
INFO: Elapsed time: 181.874s, Critical Path: 30.91s
INFO: 1382 processes: 526 internal, 856 local.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
ERROR: Could not build Bazel
pkgs/development/tools/build-managers/bazel/bazel_5/default.nix
Outdated
Show resolved
Hide resolved
…e/stdredirect/BUILD in darwinPatches as these files do not exist anymore
pkgs/development/tools/build-managers/bazel/bazel_5/default.nix
Outdated
Show resolved
Hide resolved
pkgs/development/tools/build-managers/bazel/bazel_5/default.nix
Outdated
Show resolved
Hide resolved
Tested compilation on Gentoo Linux x86_64 with $ ./result/bin/bazel --version
bazel 5.0.0- (@non-git) |
Co-authored-by: divanorama <divanorama@gmail.com>
I had to do this to make it build on my laptop with Monterey:
I can now repro the same error as ofborg, but I'm not sure what's going on. |
…n") or arm64 (on "aarch64-darwin")
Should be good now. I had to disable layering checks in order to resolve build errors on darwin. Compilation succeeded on my Monterey based x86_64-darwin builder. |
Tested on both |
Co-authored-by: Uri Baghin <uri@canva.com>
Motivation for this change
Add https://github.com/bazelbuild/bazel/releases/tag/5.0.0
Things done
Bazel 5 is going to be a second long term support release.
Changes from bazel_4:
see https://docs.bazel.build/versions/5.0.0/bazel-and-java.html for details
https://blog.bazel.build/2022/01/19/bazel-5.0.html
https://github.com/bazelbuild/bazel/releases/tag/5.0.0
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes