Skip to content

Commit 9919d1d

Browse files
authored
Allow build/test on the entire repo (#341)
Clean up constraints and CI to allow running all targets without the need to exclude subtrees based on platform.
1 parent 988fe51 commit 9919d1d

File tree

6 files changed

+17
-22
lines changed

6 files changed

+17
-22
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ locally before attempting remote execution.
5757
Build them all with:
5858

5959
```sh
60-
bazel build -- //... -//platform/...
60+
bazel build //...
6161
```
6262

6363
- `swift`:
@@ -78,7 +78,7 @@ locally before attempting remote execution.
7878
Test them all with:
7979

8080
```sh
81-
bazel test -- //... -//platform/...
81+
bazel test //...
8282
```
8383

8484
- `swift`:
@@ -130,7 +130,7 @@ build --config=engflow
130130
Build them all with:
131131

132132
```sh
133-
bazel build -- //... -//platform/...
133+
bazel build //...
134134
```
135135

136136
- `swift`:
@@ -150,7 +150,7 @@ build --config=engflow
150150
Test them all with:
151151

152152
```sh
153-
bazel test -- //... -//platform/...
153+
bazel test //...
154154
```
155155

156156
- `swift`:

docker/sysbox/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ Usage:
1111
a container tha uses `sysbox` to run nested docker containers.
1212

1313
- Modify the `dind_test/BUILD`. Change the `container-image` attribute of the `sh_test`
14-
rule to point the container you produced in the previous step.
14+
rule to point the container you produced in the previous step.
1515

16-
- Modify the `.bazelrc` file at the top level of the repo to use your own endpoint.
16+
- Modify the `.bazelrc` file at the top level of the repo to use your own endpoint.
1717

1818
- Run the following command:
1919

2020
```sh
21-
bazel test --config=<your-cluster> --test_output=all //docker/sysbox/dind_test/...
21+
bazel test --config=<your-cluster> --test_output=all //docker/sysbox/dind_test:check_docker
2222
```
2323

2424
# How does it work?

docker/sysbox/dind_test/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ sh_test(
2828
# DO NOT ENABLE!!! "dockerPrivileged": "True",
2929
# sysbox containers will refuse to start
3030
},
31-
)
31+
tags = ["manual"]
32+
)

infra/test-all.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,7 @@
77
def main():
88
# All targets that can run in any environment.
99
targets = [
10-
"//cpp/...",
11-
"//docker/network/...",
12-
"//docker/sandbox/...",
13-
"//genrules/...",
14-
"//go/...",
15-
"//java/...",
16-
"//kotlin/...",
17-
"//scala/...",
18-
"//typescript/...",
19-
"//csharp/...",
20-
"//perl/...",
21-
"//python/...",
22-
"//swift/...",
10+
"//...",
2311
]
2412

2513
for key in ("ARCH", "OPAL_RPC_CREDENTIALS", "OS", "REMOTE_EXECUTION"):
@@ -42,7 +30,7 @@ def main():
4230
]
4331
# The //docker/sysbox/... targets should only run in linux + remote
4432
if os.getenv("REMOTE_EXECUTION") == "true" and os.getenv("OS") == "linux":
45-
targets += ["//docker/sysbox/...",]
33+
targets += ["//docker/sysbox/dind_test:check_docker",]
4634
args = ["bazel", "test"] + flags + ["--"] + targets
4735

4836
result = subprocess.run(args)

platform/linux_x64/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ cc_toolchain_suite(
3737
"k8|clang": ":cc-compiler-k8",
3838
"k8": ":cc-compiler-k8",
3939
},
40+
target_compatible_with = [
41+
"@platforms//os:linux",
42+
],
4043
)
4144

4245
cc_toolchain(

platform/windows_x64/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ cc_toolchain_suite(
3939
"x64_windows|msvc": ":msvc_cc_toolchain",
4040
"x64_windows": ":msvc_cc_toolchain",
4141
},
42+
target_compatible_with = [
43+
"@platforms//os:windows",
44+
],
4245
)
4346

4447
cc_toolchain(

0 commit comments

Comments
 (0)