Skip to content

Commit

Permalink
CI fixes (bazelbuild#784)
Browse files Browse the repository at this point in the history
* do not use bzlmod for integration test

* change distro target

* split out doc_build to non bzlmod
  • Loading branch information
aiuto authored Nov 22, 2023
1 parent 3917ae6 commit dd4cb3c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 20 deletions.
14 changes: 4 additions & 10 deletions .bazelci/integration.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
lts: &lts
bazel: latest

rolling: &rolling
bazel: rolling


common: &common
platform: ubuntu1804
working_directory: ..
build_targets:
- "distro:*"
- "distro:all"

tasks:
rolling_ubuntu:
name: rolling_distro
<<: *rolling
platform: ubuntu1804
bazel: rolling
<<: *common
lts_ubuntu:
name: lts_distro
platform: ubuntu1804
<<: *lts
bazel: latest
<<: *common
11 changes: 7 additions & 4 deletions .bazelci/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ ubuntu1804: &ubuntu
platform: ubuntu1804
<<: *common
<<: *default_tests
build_targets:
- "//distro:distro"
- "//distro:relnotes"
- "//doc_build:*"

centos7: &centos
platform: centos7_java11_devtoolset10
Expand Down Expand Up @@ -94,6 +90,9 @@ tasks:
platform: ubuntu1804
build_flags:
- "--enable_bzlmod"
build_targets:
- "//distro:distro"
- "//distro:relnotes"
<<: *common
<<: *rolling
<<: *default_tests
Expand All @@ -118,6 +117,10 @@ tasks:
name: lts_ubuntu
<<: *ubuntu
<<: *lts
build_targets:
- "//distro:distro"
- "//distro:relnotes"
- "//doc_build:*"
lts_windows:
name: lts_windows
<<: *windows
Expand Down
16 changes: 10 additions & 6 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ local_repository(
#)

# Needed for making our release notes
#load("//toolchains/git:git_configure.bzl", "experimental_find_system_git")
#
#experimental_find_system_git(
# name = "rules_pkg_git",
# verbose = False,
#)
load("//toolchains/git:git_configure.bzl", "experimental_find_system_git_bzlmod")

experimental_find_system_git_bzlmod(
name = "rules_pkg_git",
verbose = False,
)
register_toolchains(
"@rules_pkg_git//:git_auto_toolchain",
"//toolchains/git:git_missing_toolchain",
)
17 changes: 17 additions & 0 deletions toolchains/git/git_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ _find_system_git = repository_rule(
},
)

# buildifier: disable=function-docstring-args
def experimental_find_system_git(name, workspace_file = None, verbose = False):
"""Create a toolchain that lets you run git.
Expand All @@ -76,3 +77,19 @@ def experimental_find_system_git(name, workspace_file = None, verbose = False):
"@%s//:git_auto_toolchain" % name,
"@rules_pkg//toolchains/git:git_missing_toolchain",
)

# buildifier: disable=function-docstring-args
def experimental_find_system_git_bzlmod(name, workspace_file = None, verbose = False):
"""Create a toolchain that lets you run git.
WARNING: This is experimental. The API and behavior are subject to change
at any time.
This presumes that your Bazel WORKSPACE file is located under your git
client. That is often true, but might not be in a multi-repo where you
might weave together a Bazel workspace from several git repos that are
all rooted under the WORKSPACE file.
"""
if not workspace_file:
workspace_file = Label("//:MODULE.bazel")
_find_system_git(name = name, workspace_file = workspace_file, verbose = verbose)

0 comments on commit dd4cb3c

Please sign in to comment.