Skip to content

Commit e42381c

Browse files
authored
chore: bzlmod tests (#115)
1 parent f4dcc5e commit e42381c

File tree

11 files changed

+61
-96
lines changed

11 files changed

+61
-96
lines changed

.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test

.bazelrc

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
startup --windows_enable_symlinks
2-
common --enable_bzlmod
3-
build --enable_platform_specific_config
4-
build --incompatible_use_platforms_repo_for_constraints
5-
build --incompatible_enable_cc_toolchain_resolution
6-
build --incompatible_strict_action_env
7-
build --enable_runfiles
8-
build --noincompatible_remove_rule_name_parameter
9-
query --noincompatible_remove_rule_name_parameter
10-
11-
# Temporary until https://github.com/grailbio/bazel-toolchain/pull/198 is merged
12-
build:linux --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
13-
14-
common:ci --announce_rc
15-
common:ci --verbose_failures
16-
common:ci --keep_going
17-
common:ci --disk_cache=~/.cache/bazel-disk-cache
1+
import %workspace%/bazel/common.bazelrc
182

193
try-import %workspace%/user.bazelrc

.gitignore

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
# bazel
2-
/bazel-*
3-
/user.bazelrc
4-
5-
# https://github.com/hedronvision/bazel-compile-commands-extractor
6-
/compile_commands.json
7-
/external
8-
9-
# clangd
10-
/.cache/
1+
bazel-*/
2+
user.bazelrc
3+
compile_commands.json
4+
external/
5+
.cache/

MODULE.bazel

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@ module(name = "ecsact_parse")
22

33
bazel_dep(name = "rules_cc", version = "0.0.8")
44
bazel_dep(name = "bazel_skylib", version = "1.4.2")
5-
bazel_dep(name = "lexy")
6-
bazel_dep(name = "magic_enum")
7-
8-
git_override(
9-
module_name = "lexy",
10-
remote = "https://github.com/zaucy/lexy",
11-
commit = "6be29cc1b26f93c35b987979ab304ade7a506400",
12-
)
13-
14-
git_override(
15-
module_name = "magic_enum",
16-
remote = "https://github.com/Neargye/magic_enum",
17-
commit = "745bf36a64962aa113bd04fb9d2d377e7878d2ef",
18-
)
5+
bazel_dep(name = "ecsact_runtime", version = "0.4.1")
6+
bazel_dep(name = "lexy", version = "2022.05.1")
7+
bazel_dep(name = "magic_enum", version = "0.9.3")

WORKSPACE.bazel

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
workspace(name = "ecsact_parse")
2-
31
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4-
load("//:repositories.bzl", "ecsact_parse_dependencies")
5-
6-
ecsact_parse_dependencies()
7-
8-
http_archive(
9-
name = "com_google_googletest",
10-
sha256 = "d4cb2430eb82495a49a24310a609b99726726bf126c2fbfa92fd04c14f6a3b31",
11-
strip_prefix = "googletest-d1a0039b97291dd1dc14f123b906bb7622ffe07c",
12-
url = "https://github.com/google/googletest/archive/d1a0039b97291dd1dc14f123b906bb7622ffe07c.zip",
13-
)
142

153
http_archive(
164
name = "hedron_compile_commands",

bazel/platforms/BUILD.bazel

Lines changed: 0 additions & 19 deletions
This file was deleted.

repositories.bzl

Lines changed: 0 additions & 20 deletions
This file was deleted.

test/.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import %workspace%/../bazel/common.bazelrc
2+
3+
try-import %workspace%/user.bazelrc

test/BUILD.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@rules_cc//cc:defs.bzl", "cc_test")
2-
load("//bazel:copts.bzl", "copts")
2+
load("@ecsact_parse//bazel:copts.bzl", "copts")
33

44
# keep sorted
55
_TESTS = [
@@ -24,8 +24,8 @@ _TESTS = [
2424
srcs = ["parse_test_{}.cc".format(test)],
2525
copts = copts,
2626
deps = [
27-
"//:ecsact_parse",
28-
"@com_google_googletest//:gtest",
29-
"@com_google_googletest//:gtest_main",
27+
"@ecsact_parse",
28+
"@googletest//:gtest",
29+
"@googletest//:gtest_main",
3030
],
3131
) for test in _TESTS]

test/MODULE.bazel

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module(name = "ecsact_parse_test")
2+
3+
bazel_dep(name = "rules_cc", version = "0.0.8")
4+
bazel_dep(name = "googletest", version = "1.14.0")
5+
bazel_dep(name = "ecsact_parse")
6+
7+
local_path_override(
8+
module_name = "ecsact_parse",
9+
path = "..",
10+
)

test/WORKSPACE.bazel

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2+
3+
http_archive(
4+
name = "hedron_compile_commands",
5+
sha256 = "ed5aea1dc87856aa2029cb6940a51511557c5cac3dbbcb05a4abd989862c36b4",
6+
strip_prefix = "bazel-compile-commands-extractor-e16062717d9b098c3c2ac95717d2b3e661c50608",
7+
url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/e16062717d9b098c3c2ac95717d2b3e661c50608.tar.gz",
8+
)
9+
10+
load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
11+
12+
hedron_compile_commands_setup()
13+
14+
http_archive(
15+
name = "com_grail_bazel_toolchain",
16+
sha256 = "c53acf847fb52198758635490c5e987aacc7c64a5731a4027824762ba4e3f961",
17+
strip_prefix = "bazel-toolchain-c217c03479717279035906273702b8bc3309bbb4",
18+
url = "https://github.com/grailbio/bazel-toolchain/archive/c217c03479717279035906273702b8bc3309bbb4.zip",
19+
)
20+
21+
load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")
22+
23+
bazel_toolchain_dependencies()
24+
25+
load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
26+
27+
llvm_toolchain(
28+
name = "llvm_toolchain",
29+
llvm_version = "16.0.4",
30+
)
31+
32+
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
33+
34+
llvm_register_toolchains()

0 commit comments

Comments
 (0)