Use bazel 7 and bzlmod (#5601)

* Use bazel 7 and bzlmod

Many of our dependencies are now using bazel 7 and the new bzlmod module
system. This has been breaking our autoroll; this PR should fix the
issues we've been having with that.

It may or may not be worthwhile to update effcee to use bzlmod as well;
this would let us get rid of WORKSPACE entirely.

* Try to force cla check to rerun
This commit is contained in:
Cassandra Beckley 2024-03-14 14:42:12 -07:00 committed by GitHub
parent 02c79e9082
commit efb0fce2d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 42 additions and 64 deletions

View File

@ -1,3 +1,6 @@
# Enable Bzlmod for every Bazel command
common --enable_bzlmod
build --enable_platform_specific_config
build:linux --cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17

View File

@ -1 +1 @@
5.0.0
7.0.2

1
.gitignore vendored
View File

@ -23,6 +23,7 @@ bazel-out
bazel-spirv-tools
bazel-SPIRV-Tools
bazel-testlogs
MODULE.bazel.lock
# Vim
[._]*.s[a-w][a-z]

View File

@ -426,7 +426,7 @@ cc_library(
copts = TEST_COPTS,
deps = [
":spirv_tools_internal",
"@com_google_googletest//:gtest",
"@googletest//:gtest",
],
)
@ -446,8 +446,8 @@ cc_library(
"tools_util",
":spirv_tools_internal",
":test_lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(
[
@ -467,8 +467,8 @@ cc_test(
linkstatic = 1,
deps = [
":spirv_tools_opt_internal",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
"@spirv_headers//:spirv_cpp11_headers",
],
)
@ -481,8 +481,8 @@ cc_test(
linkstatic = 1,
deps = [
":spirv_tools_internal",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)
@ -508,8 +508,8 @@ cc_library(
linkstatic = 1,
deps = [
":link_test_lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(
["test/link/*_test.cpp"],
@ -525,8 +525,8 @@ cc_library(
":spirv_tools",
":spirv_tools_lint_internal",
":spirv_tools_opt_internal",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(
["test/lint/*_test.cpp"],
@ -550,7 +550,7 @@ cc_library(
":spirv_tools_internal",
":spirv_tools_opt_internal",
"@com_google_effcee//:effcee",
"@com_google_googletest//:gtest",
"@googletest//:gtest",
],
)
@ -566,8 +566,8 @@ cc_library(
":spirv_tools_opt_internal",
":test_lib",
"@com_google_effcee//:effcee",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(["test/opt/*_test.cpp"])]
@ -580,8 +580,8 @@ cc_library(
deps = [
":opt_test_lib",
":spirv_tools_opt_internal",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(
["test/opt/dominator_tree/*.cpp"],
@ -599,8 +599,8 @@ cc_library(
":spirv_tools",
":spirv_tools_opt_internal",
"@com_google_effcee//:effcee",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(
["test/opt/loop_optimizations/*.cpp"],
@ -621,7 +621,7 @@ cc_library(
":spirv_tools_reduce",
":test_lib",
":tools_io",
"@com_google_googletest//:gtest",
"@googletest//:gtest",
],
)
@ -636,7 +636,7 @@ cc_library(
":spirv_tools_internal",
":spirv_tools_opt_internal",
":spirv_tools_reduce",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest_main",
],
) for f in glob(["test/reduce/*_test.cpp"])]
@ -648,8 +648,8 @@ cc_library(
linkstatic = 1,
deps = [
":spirv_tools_internal",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(["test/util/*_test.cpp"])]
@ -680,8 +680,8 @@ cc_library(
":spirv_tools_internal",
":test_lib",
":val_test_lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(
["test/val/val_*_test.cpp"],
@ -702,8 +702,8 @@ cc_test(
":spirv_tools_internal",
":test_lib",
":val_test_lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)
@ -719,7 +719,7 @@ cc_test(
deps = [
":test_lib",
":val_test_lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)

2
DEPS
View File

@ -12,7 +12,7 @@ vars = {
# Use protobufs before they gained the dependency on abseil
'protobuf_revision': 'v21.12',
're2_revision': 'ed9fc269e2fdb299afe59e912928d31ad3fdcf7d',
're2_revision': 'dbf15a205c5b28fe7e8c43df2e036bbf47c9cb57',
'spirv_headers_revision': '8b246ff75c6615ba4532fe4fde20f1be090c3764',
}

7
MODULE.bazel Normal file
View File

@ -0,0 +1,7 @@
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "googletest", dev_dependency = True)
local_path_override(
module_name = "googletest",
path = "external/googletest",
)

View File

@ -1,41 +1,8 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_skylib",
strip_prefix = "bazel-skylib-main",
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/main.zip"],
)
# Override bazel's default `platforms`, since googletest requires a newer version. This can be removed once we use a newer Bazel version.
http_archive(
name = "platforms",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz",
"https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz",
],
sha256 = "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74",
)
# `platforms` needs `rules_license` on Windows. This can be removed if `platforms` above is removed.
http_archive(
name = "rules_license",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.8/rules_license-0.0.8.tar.gz",
"https://github.com/bazelbuild/rules_license/releases/download/0.0.8/rules_license-0.0.8.tar.gz",
],
sha256 = "241b06f3097fd186ff468832150d6cc142247dc42a32aaefb56d0099895fd229",
)
local_repository(
name = "spirv_headers",
path = "external/spirv-headers",
)
local_repository(
name = "com_google_googletest",
path = "external/googletest",
)
local_repository(
name = "com_googlesource_code_re2",
path = "external/re2",
@ -47,6 +14,6 @@ local_repository(
)
local_repository(
name = "com_google_absl",
name = "abseil-cpp",
path = "external/abseil_cpp",
)