summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraiuto <aiuto@google.com>2023-11-22 09:33:50 -0500
committerGitHub <noreply@github.com>2023-11-22 09:33:50 -0500
commitdd4cb3ca99189bc740ec7cb08c17b7528c28364b (patch)
tree2e6d42dc746e6cc743d0ad3781d0bd299bebfe9d
parent3917ae64448da126ded00197a4cc99ac43e2b20f (diff)
downloadbazelbuild-rules_pkg-dd4cb3ca99189bc740ec7cb08c17b7528c28364b.tar.gz
CI fixes (#784)
* do not use bzlmod for integration test * change distro target * split out doc_build to non bzlmod
-rw-r--r--.bazelci/integration.yml14
-rw-r--r--.bazelci/tests.yml11
-rw-r--r--WORKSPACE.bzlmod16
-rw-r--r--toolchains/git/git_configure.bzl17
4 files changed, 38 insertions, 20 deletions
diff --git a/.bazelci/integration.yml b/.bazelci/integration.yml
index d73a4d7..cf05c44 100644
--- a/.bazelci/integration.yml
+++ b/.bazelci/integration.yml
@@ -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
diff --git a/.bazelci/tests.yml b/.bazelci/tests.yml
index 3fc0111..d64a858 100644
--- a/.bazelci/tests.yml
+++ b/.bazelci/tests.yml
@@ -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
@@ -94,6 +90,9 @@ tasks:
platform: ubuntu1804
build_flags:
- "--enable_bzlmod"
+ build_targets:
+ - "//distro:distro"
+ - "//distro:relnotes"
<<: *common
<<: *rolling
<<: *default_tests
@@ -118,6 +117,10 @@ tasks:
name: lts_ubuntu
<<: *ubuntu
<<: *lts
+ build_targets:
+ - "//distro:distro"
+ - "//distro:relnotes"
+ - "//doc_build:*"
lts_windows:
name: lts_windows
<<: *windows
diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod
index e5300a3..3a25ac4 100644
--- a/WORKSPACE.bzlmod
+++ b/WORKSPACE.bzlmod
@@ -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",
+)
diff --git a/toolchains/git/git_configure.bzl b/toolchains/git/git_configure.bzl
index c1f9a0e..f537c1a 100644
--- a/toolchains/git/git_configure.bzl
+++ b/toolchains/git/git_configure.bzl
@@ -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.
@@ -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)