Skip to content

Commit e10eff7

Browse files
authored
Enabled //test/load_arbitrary_tool/... tests for windows (#860)
1 parent ce0291c commit e10eff7

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.bazelci/presubmit.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ tasks:
6464
- "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
6565
- "..."
6666
- "-//bindgen/..."
67-
- "-//test/load_arbitrary_tool/..."
6867
- "-//test/test_env/..."
6968
- "-//test/proto/..."
7069
- "-//tools/rust_analyzer/..."

test/load_arbitrary_tool/BUILD.bazel

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test")
22

33
filegroup(
44
name = "load_arbitrary_tool_test_src",
5-
srcs = [
6-
"@rules_rust_test_load_arbitrary_tool//:bin/cargo",
7-
],
5+
srcs = select({
6+
"//rust/platform:windows": ["@rules_rust_test_load_arbitrary_tool//:bin/cargo.exe"],
7+
"//conditions:default": ["@rules_rust_test_load_arbitrary_tool//:bin/cargo"],
8+
}),
89
)
910

1011
build_test(

test/load_arbitrary_tool/load_arbitrary_tool_test.bzl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,28 @@ load("//rust:repositories.bzl", "load_arbitrary_tool")
44
def _load_arbitrary_tool_test_impl(repository_ctx):
55
if "mac" in repository_ctx.os.name:
66
target_triple = "x86_64-apple-darwin"
7+
cargo_bin = "bin/cargo"
78
elif "windows" in repository_ctx.os.name:
89
target_triple = "x86_64-pc-windows-msvc"
10+
cargo_bin = "bin/cargo.exe"
911
else:
1012
target_triple = "x86_64-unknown-linux-gnu"
13+
cargo_bin = "bin/cargo"
1114

1215
# Download cargo
1316
load_arbitrary_tool(
1417
ctx = repository_ctx,
1518
tool_name = "cargo",
1619
tool_subdirectories = ["cargo"],
17-
version = "1.52.1",
20+
version = "1.53.0",
1821
iso_date = None,
1922
target_triple = target_triple,
2023
)
2124

2225
repo_path = repository_ctx.path(".")
2326
repository_ctx.file(
2427
"{}/BUILD.bazel".format(repo_path),
25-
content = "exports_files([\"bin/cargo\"])",
28+
content = "exports_files([\"{}\"])".format(cargo_bin),
2629
)
2730

2831
_load_arbitrary_tool_test = repository_rule(

0 commit comments

Comments
 (0)