Skip to content

Commit

Permalink
fix ci for bazel 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jsharpe committed Dec 18, 2024
1 parent 21e463e commit f039c9f
Show file tree
Hide file tree
Showing 23 changed files with 177 additions and 119 deletions.
70 changes: 43 additions & 27 deletions .bazelci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ tasks:
- "//..."
test_targets:
- "//..."
macos_arm64:
platform: macos_arm64
build_targets:
- "//..."
test_targets:
- "//..."
windows:
platform: windows
build_targets:
Expand All @@ -28,10 +34,8 @@ tasks:
- "-//test:shell_method_symlink_contents_to_dir_test"
- "-//test:shell_script_inner_fun_test"
build_flags:
- "--noenable_bzlmod"
- "--enable_workspace"
test_flags:
- "--noenable_bzlmod"
- "--enable_workspace"
ubuntu1804_examples_standalone:
name: Examples (spawn_strategy=standalone)
Expand All @@ -45,14 +49,12 @@ tasks:
- "-c"
- "dbg"
- "--spawn_strategy=standalone"
- "--noenable_bzlmod"
- "--enable_workspace"
test_targets: *linux_targets_standalone
test_flags:
- "-c"
- "dbg"
- "--spawn_strategy=standalone"
- "--noenable_bzlmod"
- "--enable_workspace"
ubuntu2004_examples:
name: Examples
Expand All @@ -64,24 +66,9 @@ tasks:
build_targets: *linux_targets
test_targets: *linux_targets
build_flags:
- "--noenable_bzlmod"
- "--enable_workspace"
test_flags:
- "--noenable_bzlmod"
- "--enable_workspace"
ubuntu2004_examples_bzlmod:
name: Examples (bzlmod)
platform: ubuntu2004
working_directory: examples
linux_targets: &linux_targets_bzlmod
- "//..."
- "//:third_party_examples_linux_tests"
# gives error '//external:databinding_annotation_processor': target 'databinding_annotation_processor' not declared in package 'external' defined by /workdir/examples/WORKSPACE.bazel (Tip: use `query "//external:*"` to see all the targets in that package) and referenced by '@bazel_tools//tools/android:databinding_annotation_processor'
- "-//cmake_android/..."
build_targets: *linux_targets_bzlmod
test_targets: *linux_targets_bzlmod
build_flags:
- "--enable_bzlmod"
rbe_ubuntu2004_examples:
name: Examples
platform: rbe_ubuntu2004
Expand All @@ -91,10 +78,12 @@ tasks:
- "//:third_party_examples_linux_rbe_tests"
# Gives error: zipalign: error while loading shared libraries: /usr/local/lib/libc++.so: file too short
- "-//cmake_android/..."
# Python requirements not supported on Ubuntu 16.04
- "-//:requirements_test"
build_targets: *rbe_targets
test_targets: *rbe_targets
build_flags:
- "--enable_workspace"
test_flags:
- "--enable_workspace"
macos_examples_standalone:
name: Examples (spawn_strategy=standalone)
platform: macos
Expand All @@ -112,15 +101,13 @@ tasks:
- "dbg"
- "--spawn_strategy=standalone"
- "--noincompatible_enable_cc_toolchain_resolution"
- "--noenable_bzlmod"
- "--enable_workspace"
test_targets: *macos_targets_standalone
test_flags:
- "-c"
- "dbg"
- "--spawn_strategy=standalone"
- "--noincompatible_enable_cc_toolchain_resolution"
- "--noenable_bzlmod"
- "--enable_workspace"
macos_examples:
name: Examples
Expand All @@ -136,12 +123,10 @@ tasks:
build_targets: *macos_targets
build_flags:
- "--noincompatible_enable_cc_toolchain_resolution"
- "--noenable_bzlmod"
- "--enable_workspace"
test_targets: *macos_targets
test_flags:
- "--noincompatible_enable_cc_toolchain_resolution"
- "--noenable_bzlmod"
- "--enable_workspace"
windows_examples:
name: Examples
Expand Down Expand Up @@ -172,10 +157,8 @@ tasks:
build_targets: *windows_targets
test_targets: *windows_targets
build_flags:
- "--noenable_bzlmod"
- "--enable_workspace"
test_flags:
- "--noenable_bzlmod"
- "--enable_workspace"
rbe_ubuntu2004_flags:
name: Flags
Expand All @@ -195,6 +178,12 @@ tasks:
working_directory: test/standard_cxx_flags_test
test_targets:
- "//:flags_test"
macos_arm64_flags:
name: Flags (arm64)
platform: macos_arm64
working_directory: test/standard_cxx_flags_test
test_targets:
- "//:flags_test"
windows_flags:
name: Flags
platform: windows
Expand All @@ -207,26 +196,53 @@ tasks:
working_directory: test/detect_root_test
test_targets:
- "//:tests"
build_flags:
- "--enable_workspace"
test_flags:
- "--enable_workspace"
ubuntu2004_detect_root:
name: Detect root
platform: ubuntu2004
working_directory: test/detect_root_test
test_targets:
- "//:tests"
build_flags:
- "--enable_workspace"
test_flags:
- "--enable_workspace"
macos_detect_root:
name: Detect root
platform: macos
working_directory: test/detect_root_test
test_targets:
- "//:tests"
build_flags:
- "--enable_workspace"
test_flags:
- "--enable_workspace"
macos_oarm64_detect_root:
name: Detect root (arm64)
platform: macos_arm64
working_directory: test/detect_root_test
test_targets:
- "//:tests"
build_flags:
- "--enable_workspace"
test_flags:
- "--enable_workspace"
windows_detect_root:
name: Detect root
platform: windows
working_directory: test/detect_root_test
test_targets:
- "//:tests"
build_flags:
- "--enable_workspace"
test_flags:
- "--enable_workspace"
docs_linux:
name: Docs
bazel: "7.4.1"
platform: ubuntu2004
working_directory: docs
build_targets:
Expand Down
2 changes: 1 addition & 1 deletion .github/docs-0.1.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ index 0000000..9eb0697
+# https://github.com/bazelbuild/stardoc/issues/112
+common --incompatible_allow_tags_propagation
+
+common --noenable_bzlmod
+common --noenable_bzlmod --enable_workspace
+build --workspace_status_command=tools/workspace_status.sh
diff --git a/docs/stardoc_repository.bzl b/docs/stardoc_repository.bzl
index 2153aa8..7c63be7 100644
Expand Down
2 changes: 1 addition & 1 deletion .github/docs-0.10.1.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ index dc6a3f7..9eb0697 100644
+# https://github.com/bazelbuild/stardoc/issues/112
+common --incompatible_allow_tags_propagation
+
+common --noenable_bzlmod
+common --noenable_bzlmod --enable_workspace
build --workspace_status_command=tools/workspace_status.sh
2 changes: 1 addition & 1 deletion .github/docs-0.2.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ index 0000000..9eb0697
+# https://github.com/bazelbuild/stardoc/issues/112
+common --incompatible_allow_tags_propagation
+
+common --noenable_bzlmod
+common --noenable_bzlmod --enable_workspace
+build --workspace_status_command=tools/workspace_status.sh
diff --git a/docs/stardoc_repository.bzl b/docs/stardoc_repository.bzl
index 2153aa8..7c63be7 100644
Expand Down
2 changes: 1 addition & 1 deletion .github/docs-0.3.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ index 0000000..9eb0697
+# https://github.com/bazelbuild/stardoc/issues/112
+common --incompatible_allow_tags_propagation
+
+common --noenable_bzlmod
+common --noenable_bzlmod --enable_workspace
+build --workspace_status_command=tools/workspace_status.sh
diff --git a/docs/stardoc_repository.bzl b/docs/stardoc_repository.bzl
index 2153aa8..7c63be7 100644
Expand Down
2 changes: 1 addition & 1 deletion .github/docs-0.4.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ index dc6a3f7..9eb0697 100644
+# https://github.com/bazelbuild/stardoc/issues/112
+common --incompatible_allow_tags_propagation
+
+common --noenable_bzlmod
+common --noenable_bzlmod --enable_workspace
build --workspace_status_command=tools/workspace_status.sh
diff --git a/docs/stardoc_repository.bzl b/docs/stardoc_repository.bzl
index 2153aa8..7c63be7 100644
Expand Down
2 changes: 1 addition & 1 deletion .github/docs-0.5.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ index dc6a3f7..9eb0697 100644
+# https://github.com/bazelbuild/stardoc/issues/112
+common --incompatible_allow_tags_propagation
+
+common --noenable_bzlmod
+common --noenable_bzlmod --enable_workspace
build --workspace_status_command=tools/workspace_status.sh
diff --git a/docs/stardoc_repository.bzl b/docs/stardoc_repository.bzl
index 2153aa8..7c63be7 100644
Expand Down
2 changes: 1 addition & 1 deletion .github/docs-0.5.1.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ index dc6a3f7..9eb0697 100644
+# https://github.com/bazelbuild/stardoc/issues/112
+common --incompatible_allow_tags_propagation
+
+common --noenable_bzlmod
+common --noenable_bzlmod --enable_workspace
build --workspace_status_command=tools/workspace_status.sh
diff --git a/docs/stardoc_repository.bzl b/docs/stardoc_repository.bzl
index 2153aa8..7c63be7 100644
Expand Down
2 changes: 1 addition & 1 deletion .github/docs-0.6.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ index dc6a3f7..9eb0697 100644
+# https://github.com/bazelbuild/stardoc/issues/112
+common --incompatible_allow_tags_propagation
+
+common --noenable_bzlmod
+common --noenable_bzlmod --enable_workspace
build --workspace_status_command=tools/workspace_status.sh
diff --git a/docs/stardoc_repository.bzl b/docs/stardoc_repository.bzl
index 2153aa8..7c63be7 100644
Expand Down
2 changes: 1 addition & 1 deletion .github/docs-0.7.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ index dc6a3f7..9eb0697 100644
+# https://github.com/bazelbuild/stardoc/issues/112
+common --incompatible_allow_tags_propagation
+
+common --noenable_bzlmod
+common --noenable_bzlmod --enable_workspace
build --workspace_status_command=tools/workspace_status.sh
diff --git a/docs/stardoc_repository.bzl b/docs/stardoc_repository.bzl
index 2153aa8..7c63be7 100644
Expand Down
2 changes: 1 addition & 1 deletion .github/docs-0.7.1.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ index dc6a3f7..9eb0697 100644
+# https://github.com/bazelbuild/stardoc/issues/112
+common --incompatible_allow_tags_propagation
+
+common --noenable_bzlmod
+common --noenable_bzlmod --enable_workspace
build --workspace_status_command=tools/workspace_status.sh
diff --git a/docs/stardoc_repository.bzl b/docs/stardoc_repository.bzl
index 2153aa8..7c63be7 100644
Expand Down
2 changes: 1 addition & 1 deletion .github/docs-0.8.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ index dc6a3f7..9eb0697 100644
+# https://github.com/bazelbuild/stardoc/issues/112
+common --incompatible_allow_tags_propagation
+
+common --noenable_bzlmod
+common --noenable_bzlmod --enable_workspace
build --workspace_status_command=tools/workspace_status.sh
diff --git a/docs/stardoc_repository.bzl b/docs/stardoc_repository.bzl
index 2153aa8..7c63be7 100644
Expand Down
2 changes: 1 addition & 1 deletion .github/docs-0.9.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ index dc6a3f7..9eb0697 100644
+# https://github.com/bazelbuild/stardoc/issues/112
+common --incompatible_allow_tags_propagation
+
+common --noenable_bzlmod
+common --noenable_bzlmod --enable_workspace
build --workspace_status_command=tools/workspace_status.sh
diff --git a/docs/stardoc_repository.bzl b/docs/stardoc_repository.bzl
index 2153aa8..7c63be7 100644
Expand Down
20 changes: 15 additions & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ module(
)

bazel_dep(name = "bazel_features", version = "1.15.0")
bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.5")
bazel_dep(name = "rules_python", version = "0.23.1")
bazel_dep(name = "rules_python", version = "1.0.0")
bazel_dep(name = "rules_shell", version = "0.3.0")

# Dev dependencies
Expand All @@ -22,9 +22,19 @@ bazel_dep(name = "bazel_ci_rules", version = "1.0.0", dev_dependency = True)
# depends on it. If you are not using bazel_ci_rules; ideally we'd be able to remove this.
bazel_dep(name = "rules_cc", version = "0.0.9", dev_dependency = True)

rbe_preconfig = use_repo_rule(
"@bazel_ci_rules//:rbe_repo.bzl",
"rbe_preconfig",
)

rbe_preconfig(
name = "buildkite_config",
toolchain = "ubuntu2004",
)

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(python_version = "3.9")
use_repo(python, "python_3_9")
python.toolchain(python_version = "3.12")
use_repo(python, "python_3_12")

tools = use_extension("@rules_foreign_cc//foreign_cc:extensions.bzl", "tools")
use_repo(
Expand All @@ -46,6 +56,6 @@ register_toolchains(
"@rules_foreign_cc_framework_toolchains//:all",
"@cmake_3.23.2_toolchains//:all",
"@ninja_1.12.1_toolchains//:all",
"@python_3_9//:all",
"@python_3_12//:all",
"@rules_foreign_cc//toolchains:all",
)
Empty file added REPO.bazel
Empty file.
10 changes: 0 additions & 10 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
workspace(name = "rules_foreign_cc")

load("@bazel_ci_rules//:rbe_repo.bzl", "rbe_preconfig")

# Creates a default toolchain config for RBE.
# Use this as is if you are using the rbe_ubuntu16_04 container,
# otherwise refer to RBE docs.
rbe_preconfig(
name = "buildkite_config",
toolchain = "ubuntu1804-bazel-java11",
)
1 change: 1 addition & 0 deletions docs/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
common --incompatible_allow_tags_propagation

common --noenable_bzlmod
common --enable_workspace
build --workspace_status_command=tools/workspace_status.sh
Loading

0 comments on commit f039c9f

Please sign in to comment.