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 Jan 10, 2025
1 parent 2dd6fe2 commit 0774669
Show file tree
Hide file tree
Showing 22 changed files with 271 additions and 109 deletions.
72 changes: 49 additions & 23 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 @@ -35,6 +41,7 @@ tasks:
- "--enable_workspace"
ubuntu1804_examples_standalone:
name: Examples (spawn_strategy=standalone)
bazel: "7.4.1"
platform: ubuntu1804
working_directory: examples
linux_targets: &linux_targets_standalone
Expand All @@ -45,17 +52,16 @@ 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
bazel: "7.4.1"
platform: ubuntu2004
working_directory: examples
linux_targets: &linux_targets
Expand All @@ -64,39 +70,28 @@ 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
bazel: "7.4.1"
platform: rbe_ubuntu2004
working_directory: examples
rbe_targets: &rbe_targets
- "//..."
- "//: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)
bazel: "7.4.1"
platform: macos
working_directory: examples
macos_targets: &macos_targets_standalone
Expand All @@ -112,18 +107,17 @@ 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
bazel: "7.4.1"
platform: macos
working_directory: examples
macos_targets: &macos_targets
Expand All @@ -136,15 +130,14 @@ 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
bazel: "7.4.1"
platform: windows
working_directory: examples
windows_targets: &windows_targets
Expand Down Expand Up @@ -196,6 +189,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 @@ -208,26 +207,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_arm64_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
1 change: 0 additions & 1 deletion .bazelversion

This file was deleted.

12 changes: 11 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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_cc", version = "0.0.17")
bazel_dep(name = "rules_python", version = "1.1.0-rc0")
Expand All @@ -22,6 +22,16 @@ bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.7.1", dev_dependenc
bazel_dep(name = "stardoc", version = "0.5.6", dev_dependency = True, repo_name = "io_bazel_stardoc")
bazel_dep(name = "bazel_ci_rules", version = "1.0.0", 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.12")
use_repo(python, "python_3_12")
Expand Down
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",
)
3 changes: 3 additions & 0 deletions docs/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

# https://github.com/bazelbuild/stardoc/issues/112
common --incompatible_allow_tags_propagation

common --noenable_bzlmod
common --enable_workspace
1 change: 0 additions & 1 deletion docs/.bazelversion

This file was deleted.

84 changes: 84 additions & 0 deletions docs/WORKSPACE.bazel
Original file line number Diff line number Diff line change
@@ -1 +1,85 @@
workspace(name = "rules_foreign_cc_docs")

local_repository(
name = "rules_foreign_cc",
path = "..",
)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "bazel_skylib",
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
],
)

http_archive(
name = "rules_java",
sha256 = "6d8c6d5cd86fed031ee48424f238fa35f33abc9921fd97dd4ae1119a29fc807f",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/8.6.3/rules_java-8.6.3.tar.gz",
],
)

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")

rules_java_dependencies()

load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")

rules_foreign_cc_dependencies()

load("@bazel_features//:deps.bzl", "bazel_features_deps")

bazel_features_deps()

load("//:stardoc_repository.bzl", "stardoc_repository")

stardoc_repository()

load("//:stardoc_deps.bzl", "stardoc_deps")

stardoc_deps()

load("@rules_python//python:repositories.bzl", "py_repositories")

py_repositories()

# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")

rules_java_toolchains()

# Gazelle dependencies

http_archive(
name = "bazel_gazelle",
sha256 = "b7387f72efb59f876e4daae42f1d3912d0d45563eac7cb23d1de0b094ab588cf",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz",
],
)

http_archive(
name = "bazel_skylib_gazelle_plugin",
sha256 = "747addf3f508186234f6232674dd7786743efb8c68619aece5fb0cac97b8f415",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-gazelle-plugin-1.5.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-gazelle-plugin-1.5.0.tar.gz",
],
)

load("@bazel_skylib_gazelle_plugin//:workspace.bzl", "bazel_skylib_gazelle_plugin_workspace")

bazel_skylib_gazelle_plugin_workspace()

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("@bazel_skylib_gazelle_plugin//:setup.bzl", "bazel_skylib_gazelle_plugin_setup")

bazel_skylib_gazelle_plugin_setup()

gazelle_dependencies(go_repository_default_config = "//:WORKSPACE.bazel")
1 change: 0 additions & 1 deletion examples/.bazelversion

This file was deleted.

Loading

0 comments on commit 0774669

Please sign in to comment.