diff --git a/.bazelrc b/.bazelrc index 3752b49..664e7e3 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,3 +1,14 @@ +# # Bazel7 +# TODO: With bzlmod we cannot access the WORKSPACE file anymore +# $ bazel build //:gazelle +# ERROR: /.../external/bazel_gazelle_go_repository_config/BUILD.bazel: no such +# target '@@bazel_gazelle_go_repository_config//:WORKSPACE': target 'WORKSPACE' +# not declared in package '' defined by +# /CAS/bazel-cache/f1a15cfb78ca8fde7615be5d21224669/external/bazel_gazelle_go_repository_config/BUILD.bazel; +# however, a source file of this name exists. (Perhaps add +# 'exports_files(["WORKSPACE"])' to /BUILD?) +build --noenable_bzlmod + # Required for @com_google_absl and remoteapis that use it. build --cxxopt=-std=c++17 build --host_cxxopt=-std=c++17 diff --git a/.bazelversion b/.bazelversion index 09b254e..66ce77b 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.0.0 +7.0.0 diff --git a/WORKSPACE b/WORKSPACE index f98476a..4c562e3 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -86,16 +86,25 @@ gazelle_dependencies() http_archive( name = "com_google_protobuf", - sha256 = "a700a49470d301f1190a487a923b5095bf60f08f4ae4cac9f5f7c36883d17971", - strip_prefix = "protobuf-23.4", - urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protobuf-23.4.tar.gz"], + integrity = "sha256-m9h7goDvcg0yQFFPiE5WpxLyIY8NaTtIBQyDYCiUCkI=", + strip_prefix = "protobuf-25.1", + urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protobuf-25.1.tar.gz"], ) load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") protobuf_deps() -# Below dependencies are for the example project. +# # Dependencies below are for the example project. + +# C++ rules for Bazel. + +http_archive( + name = "rules_cc", + sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf", + strip_prefix = "rules_cc-0.0.9", + urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"], +) http_archive( name = "com_grail_bazel_toolchain", @@ -112,14 +121,6 @@ llvm_toolchain( llvm_version = "14.0.0", ) -# C++ rules for Bazel. -http_archive( - name = "rules_cc", - sha256 = "fe1e7b1801a63e79eb1b40dc44bf0590117a399e118ac44afd6fa07bf63e9ece", - strip_prefix = "rules_cc-58f8e026c00a8a20767e3dc669f46ba23bc93bdb", - urls = ["https://github.com/bazelbuild/rules_cc/archive/58f8e026c00a8a20767e3dc669f46ba23bc93bdb.zip"], -) - # Register the auto configured rules_cc toolchain for local execution. load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") @@ -208,9 +209,9 @@ http_archive( http_archive( name = "aspect_rules_js", - sha256 = "00e7b97b696af63812df0ca9e9dbd18579f3edd3ab9a56f227238b8405e4051c", - strip_prefix = "rules_js-1.23.0", - url = "https://github.com/aspect-build/rules_js/releases/download/v1.23.0/rules_js-v1.23.0.tar.gz", + sha256 = "76a04ef2120ee00231d85d1ff012ede23963733339ad8db81f590791a031f643", + strip_prefix = "rules_js-1.34.1", + url = "https://github.com/aspect-build/rules_js/releases/download/v1.34.1/rules_js-v1.34.1.tar.gz", ) load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") diff --git a/tools/remote-toolchains/extract-bazel-auto-toolchains-fixture/WORKSPACE b/tools/remote-toolchains/extract-bazel-auto-toolchains-fixture/WORKSPACE index da47f00..c54f548 100644 --- a/tools/remote-toolchains/extract-bazel-auto-toolchains-fixture/WORKSPACE +++ b/tools/remote-toolchains/extract-bazel-auto-toolchains-fixture/WORKSPACE @@ -5,9 +5,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # C++ rules for Bazel. http_archive( name = "rules_cc", - sha256 = "954b7a3efc8752da957ae193a13b9133da227bdacf5ceb111f2e11264f7e8c95", - strip_prefix = "rules_cc-9e10b8a6db775b1ecd358d8ddd3dab379a2c29a5", - urls = ["https://github.com/bazelbuild/rules_cc/archive/9e10b8a6db775b1ecd358d8ddd3dab379a2c29a5.zip"], + sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf", + strip_prefix = "rules_cc-0.0.9", + urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"], ) load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") diff --git a/tools/remote-toolchains/extract-bazel-auto-toolchains.sh b/tools/remote-toolchains/extract-bazel-auto-toolchains.sh index 435cf8a..ae21226 100755 --- a/tools/remote-toolchains/extract-bazel-auto-toolchains.sh +++ b/tools/remote-toolchains/extract-bazel-auto-toolchains.sh @@ -7,7 +7,7 @@ # `.bazelversion` in the repository root. # # Example usage: ./extract-bazel-auto-toolchains.sh ubuntu-act-22-04 ghcr.io/catthehacker/ubuntu:act-22.04 -set -eEuo pipefail +set -eu -o pipefail script_dir="$(dirname "${BASH_SOURCE[0]}")" diff --git a/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc/BUILD b/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc/BUILD old mode 100644 new mode 100755 index b5acd20..4a703b0 --- a/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc/BUILD +++ b/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc/BUILD @@ -106,10 +106,11 @@ cc_toolchain_config( "-Wl,-z,relro,-z,now", "-B/usr/bin", "-pass-exit-codes", + ], + link_libs = [ "-lstdc++", "-lm", ], - link_libs = [], opt_compile_flags = [ "-g0", "-O2", diff --git a/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc/builtin_include_directory_paths b/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc/builtin_include_directory_paths old mode 100644 new mode 100755 diff --git a/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc/cc_toolchain_config.bzl b/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc/cc_toolchain_config.bzl index 3d5ae2f..4325a68 100644 --- a/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc/cc_toolchain_config.bzl +++ b/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc/cc_toolchain_config.bzl @@ -313,7 +313,7 @@ def _impl(ctx): ], flag_groups = [ flag_group( - flags = ["-gsplit-dwarf"], + flags = ["-gsplit-dwarf", "-g"], expand_if_available = "per_object_debug_info_file", ), ], @@ -354,8 +354,8 @@ def _impl(ctx): flag_group( flags = [ "-fprofile-use=%{fdo_profile_path}", - "-Xclang-only=-Wno-profile-instr-unprofiled", - "-Xclang-only=-Wno-profile-instr-out-of-date", + "-Wno-profile-instr-unprofiled", + "-Wno-profile-instr-out-of-date", "-fprofile-correction", ], expand_if_available = "fdo_profile_path", @@ -808,8 +808,8 @@ def _impl(ctx): flag_groups = [ flag_group( flags = [ - "-Xclang-only=-mllvm", - "-Xclang-only=-prefetch-hints-file=%{fdo_prefetch_hints_path}", + "-mllvm", + "-prefetch-hints-file=%{fdo_prefetch_hints_path}", ], expand_if_available = "fdo_prefetch_hints_path", ), @@ -950,7 +950,6 @@ def _impl(ctx): ], ) - dynamic_library_linker_tool_path = tool_paths dynamic_library_linker_tool_feature = feature( name = "dynamic_library_linker_tool", flag_sets = [ @@ -1114,6 +1113,8 @@ def _impl(ctx): strip_debug_symbols_feature, coverage_feature, supports_pic_feature, + gcc_coverage_map_format_feature, + llvm_coverage_map_format_feature, ] + ( [ supports_start_end_lib_feature, @@ -1150,6 +1151,8 @@ def _impl(ctx): user_compile_flags_feature, sysroot_feature, unfiltered_compile_flags_feature, + gcc_coverage_map_format_feature, + llvm_coverage_map_format_feature, ] return cc_common.create_cc_toolchain_config_info( diff --git a/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc/tools/cpp/empty.cc b/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc/tools/cpp/empty.cc old mode 100644 new mode 100755 diff --git a/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc_toolchains/BUILD b/tools/remote-toolchains/ubuntu-act-22-04/local_config_cc_toolchains/BUILD old mode 100644 new mode 100755 diff --git a/tools/remote-toolchains/ubuntu-act-22-04/local_config_platform/BUILD.bazel b/tools/remote-toolchains/ubuntu-act-22-04/local_config_platform/BUILD.bazel index b2828f7..5a6a076 100644 --- a/tools/remote-toolchains/ubuntu-act-22-04/local_config_platform/BUILD.bazel +++ b/tools/remote-toolchains/ubuntu-act-22-04/local_config_platform/BUILD.bazel @@ -8,3 +8,8 @@ platform( # Auto-detected host platform constraints. constraint_values = HOST_CONSTRAINTS, ) + +exports_files([ + # Export constraints.bzl for use in downstream bzl_library targets. + "constraints.bzl", +]) diff --git a/tools/remote-toolchains/ubuntu-act-22-04/local_config_sh/BUILD b/tools/remote-toolchains/ubuntu-act-22-04/local_config_sh/BUILD old mode 100644 new mode 100755