From bb2e0107001f5c67a152cb88ceea704c2c8797f9 Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Tue, 10 Dec 2024 22:52:29 +0000 Subject: [PATCH] Update integration test to use bzlmod --- test/rustfmt/rustfmt_failure_test.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/rustfmt/rustfmt_failure_test.sh b/test/rustfmt/rustfmt_failure_test.sh index bcad661537..c16c942677 100755 --- a/test/rustfmt/rustfmt_failure_test.sh +++ b/test/rustfmt/rustfmt_failure_test.sh @@ -7,6 +7,8 @@ set -euo pipefail +set -x + if [[ -z "${BUILD_WORKSPACE_DIRECTORY:-}" ]]; then echo "This script should be run under Bazel" exit 1 @@ -43,14 +45,14 @@ function test_all_and_apply() { mkdir -p "${new_workspace}/test/rustfmt" && \ cp -r test/rustfmt/* "${new_workspace}/test/rustfmt/" && \ - cat << EOF > "${new_workspace}/WORKSPACE.bazel" -workspace(name = "rules_rust_test_rustfmt") -local_repository( - name = "rules_rust", + cat << EOF > "${new_workspace}/MODULE.bazel" +module(name = "rules_rust_test_rustfmt") +bazel_dep(name = "rules_rust", version = "0.0.0") +local_path_override( + module_name = "rules_rust", path = "${BUILD_WORKSPACE_DIRECTORY}", ) -load("@rules_rust//rust:repositories.bzl", "rust_repositories") -rust_repositories() +bazel_dep(name = "bazel_skylib", version = "1.7.1") EOF # See github.com/bazelbuild/rules_rust/issues/2317. echo "build --noincompatible_sandbox_hermetic_tmp" > "${new_workspace}/.bazelrc"