diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index d62597b..0e37db7 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -1,10 +1,11 @@ -bcr_test_module: - module_path: "examples/bzlmod" - matrix: - platform: ["debian11", "macos", "macos_arm64", "ubuntu2004_arm64"] - tasks: - run_tests: - name: "Run test module" - platform: ${{ platform }} - test_targets: - - "//..." +matrix: + platform: + - debian11 + - ubuntu2004_arm64 + - macos_arm64 +tasks: + verify_targets: + name: Verify this module can be built as a depenedency of another module + platform: ${{ platform }} + build_targets: + - '@hermetic_cc_toolchain//toolchain/...' diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 97a5c53..9b0f747 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -22,9 +22,9 @@ steps: # image: "debian:stable" # command: apt-get update && apt-get install --no-install-recommends -y wine64 python3 ca-certificates && ci/zig-utils - label: "Test rules_cc example" - command: ci/prepare_git && ci/test_example rules_cc + command: ci/prepare_git && ci/test_example rules_cc override_repository - label: "Test bzlmod example" - command: ci/prepare_git && ci/test_example bzlmod + command: ci/prepare_git && ci/test_example bzlmod override_module - label: "mod-tidy and update-repos" command: tools/mod-tidy && git diff --exit-code agents: diff --git a/ci/test_example b/ci/test_example index 9ec6881..fba1f31 100755 --- a/ci/test_example +++ b/ci/test_example @@ -6,20 +6,21 @@ set -xeuo pipefail example=$1 +override_option_name=$2 echo --- setup "$example" root=$(git rev-parse --show-toplevel) cd "examples/$example" echo --- "testing examples/$example with hermetic_cc_toolchain pointing to git repository root" -"$root/tools/bazel" test "--override_repository=hermetic_cc_toolchain=$root" --test_output=errors ... +"$root/tools/bazel" test "--$override_option_name=hermetic_cc_toolchain=$root" --test_output=errors ... echo --- "testing examples/$example with hermetic_cc_toolchain pointing to a directory produced by release tarball" # generate release tarball and put to temp REL=$(mktemp -d); trap 'rm -fr $REL' EXIT; "$root/ci/release_v99" tar -vx -C "$REL" -f "$root/hermetic_cc_toolchain-v99.0.0.tar.gz" -"$root/tools/bazel" test "--override_repository=hermetic_cc_toolchain=$REL" --test_output=errors ... +"$root/tools/bazel" test "--$override_option_name=hermetic_cc_toolchain=$REL" --test_output=errors ... echo --- "testing examples/$example as is" "$root/tools/bazel" test --test_output=errors ... diff --git a/examples/bzlmod/MODULE.bazel b/examples/bzlmod/MODULE.bazel index 4e8dccd..df3ee30 100644 --- a/examples/bzlmod/MODULE.bazel +++ b/examples/bzlmod/MODULE.bazel @@ -5,6 +5,7 @@ module( bazel_dep( name = "hermetic_cc_toolchain", + # TODO(zplin): use thel latest released version after we publish it to BCR version = "", ) local_path_override( diff --git a/tools/releaser/main.go b/tools/releaser/main.go index 555225e..dc3c0f9 100644 --- a/tools/releaser/main.go +++ b/tools/releaser/main.go @@ -42,6 +42,7 @@ var ( "v2.0.0-rc2": "40dff82816735e631e8bd51ede3af1c4ed1ad4646928ffb6a0e53e228e55738c", "v2.0.0": "57f03a6c29793e8add7bd64186fc8066d23b5ffd06fe9cc6b0b8c499914d3a65", "v2.1.0": "892b0dd7aa88c3504a8821e65c44fd22f32c16afab12d89e9942fff492720b37", + "v2.1.1": "86ace5cd211d0ae49a729a11afb344843698b64464f2095a776c57ebbdf06698", } _boilerplateFiles = []string{ @@ -351,7 +352,6 @@ func makeTgz(w io.Writer, repoRoot string, ref string) (string, error) { ref, "LICENSE", "toolchain/*", - "examples/bzlmod/*", // files to be renamed "tools/releaser/data/WORKSPACE",