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

Use bazel 7 and bzlmod #5601

Merged
merged 6 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0
7.0.2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ bazel-out
bazel-spirv-tools
bazel-SPIRV-Tools
bazel-testlogs
MODULE.bazel.lock

# Vim
[._]*.s[a-w][a-z]
Expand Down
56 changes: 28 additions & 28 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ cc_library(
copts = TEST_COPTS,
deps = [
":spirv_tools_internal",
"@com_google_googletest//:gtest",
"@googletest//:gtest",
],
)

Expand All @@ -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(
[
Expand All @@ -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",
],
)
Expand All @@ -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",
],
)

Expand All @@ -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"],
Expand All @@ -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"],
Expand All @@ -550,7 +550,7 @@ cc_library(
":spirv_tools_internal",
":spirv_tools_opt_internal",
"@com_google_effcee//:effcee",
"@com_google_googletest//:gtest",
"@googletest//:gtest",
],
)

Expand All @@ -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"])]

Expand All @@ -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"],
Expand All @@ -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"],
Expand All @@ -621,7 +621,7 @@ cc_library(
":spirv_tools_reduce",
":test_lib",
":tools_io",
"@com_google_googletest//:gtest",
"@googletest//:gtest",
],
)

Expand All @@ -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"])]

Expand All @@ -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"])]

Expand Down Expand Up @@ -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"],
Expand All @@ -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",
],
)

Expand All @@ -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 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}

Expand Down
7 changes: 7 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -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",
)
35 changes: 1 addition & 34 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -47,6 +14,6 @@ local_repository(
)

local_repository(
name = "com_google_absl",
name = "abseil-cpp",
path = "external/abseil_cpp",
)