Skip to content

Commit 841666d

Browse files
committed
Moved @rules_rust//tools/runfiles to @rules_rust//rust/runfiles
1 parent 09472f7 commit 841666d

File tree

19 files changed

+51
-46
lines changed

19 files changed

+51
-46
lines changed

.bazelci/presubmit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ default_windows_no_runfiles_targets: &default_windows_no_runfiles_targets
7272
- "-//test/test_env:test_run"
7373
- "-//test/unit/pipelined_compilation/..."
7474
- "-//test/unit/rustdoc/..."
75-
- "-//tools/runfiles/..."
75+
- "-//rust/runfiles/..."
7676
# Runfiles used by the test only.
7777
- "-//test/empty_suite:deps_test"
7878
crate_universe_vendor_example_targets: &crate_universe_vendor_example_targets
@@ -293,7 +293,7 @@ tasks:
293293
- "--enable_bzlmod"
294294
build_targets:
295295
- "//crate_universe:cargo_bazel_bin"
296-
- "//tools/runfiles"
296+
- "//rust/runfiles"
297297
- "//util/import"
298298
ubuntu2004_clang:
299299
name: With Clang

crate_universe/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ rust_test(
110110
"RUSTC": "$(rootpath @rules_rust//rust/toolchain:current_rustc_files)",
111111
},
112112
deps = [
113-
"@rules_rust//tools/runfiles",
113+
"@rules_rust//rust/runfiles",
114114
] + all_crate_deps(
115115
normal_dev = True,
116116
),
@@ -138,7 +138,7 @@ rust_test(
138138
tags = ["requires-network"],
139139
deps = [
140140
":cargo_bazel",
141-
"@rules_rust//tools/runfiles",
141+
"@rules_rust//rust/runfiles",
142142
] + all_crate_deps(
143143
normal = True,
144144
),

examples/sys/basic/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ rust_test(
3232
edition = "2021",
3333
rustc_env = {"HELLO_SYS_RLOCATIONPATH": "$(rlocationpath :hello_sys)"},
3434
deps = [
35-
"@rules_rust//tools/runfiles",
35+
"@rules_rust//rust/runfiles",
3636
],
3737
)

extensions/mdbook/private/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ rust_binary(
1515
edition = "2021",
1616
visibility = ["//visibility:public"],
1717
deps = [
18+
"@rules_rust//rust/runfiles",
1819
"@rules_rust//tools/action_args",
19-
"@rules_rust//tools/runfiles",
2020
],
2121
)
2222

extensions/mdbook/test/generated_srcs/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ rust_test(
3131
data = [":generated_srcs"],
3232
edition = "2021",
3333
rustc_env = {"MDBOOK_OUTPUT_RLOCATIONPATH": "$(rlocationpath :generated_srcs)"},
34-
deps = ["@rules_rust//tools/runfiles"],
34+
deps = ["@rules_rust//rust/runfiles"],
3535
)

rust/runfiles/BUILD.bazel

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
load(
2+
"//rust:defs.bzl",
3+
"rust_doc",
4+
"rust_library",
5+
"rust_test",
6+
)
7+
8+
rust_library(
9+
name = "runfiles",
10+
srcs = ["runfiles.rs"],
11+
edition = "2018",
12+
visibility = ["//visibility:public"],
13+
)
14+
15+
rust_test(
16+
name = "runfiles_test",
17+
crate = ":runfiles",
18+
data = ["data/sample.txt"],
19+
)
20+
21+
rust_doc(
22+
name = "runfiles_doc",
23+
crate = ":runfiles",
24+
)
File renamed without changes.

tools/runfiles/runfiles.rs renamed to rust/runfiles/runfiles.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! name = "my_binary",
99
//! ...
1010
//! data = ["//path/to/my/data.txt"],
11-
//! deps = ["@rules_rust//tools/runfiles"],
11+
//! deps = ["@rules_rust//rust/runfiles"],
1212
//! )
1313
//! ```
1414
//!
@@ -351,8 +351,8 @@ mod test {
351351
let r = Runfiles::create().unwrap();
352352

353353
let d = rlocation!(r, "rules_rust").unwrap();
354-
let f = rlocation!(r, "rules_rust/tools/runfiles/data/sample.txt").unwrap();
355-
assert_eq!(d.join("tools/runfiles/data/sample.txt"), f);
354+
let f = rlocation!(r, "rules_rust/rust/runfiles/data/sample.txt").unwrap();
355+
assert_eq!(d.join("rust/runfiles/data/sample.txt"), f);
356356

357357
let mut f = File::open(f).unwrap();
358358

@@ -373,8 +373,8 @@ mod test {
373373
env::remove_var(MANIFEST_FILE_ENV_VAR);
374374
let r = Runfiles::create().unwrap();
375375

376-
let mut f = File::open(rlocation!(r, "rules_rust/tools/runfiles/data/sample.txt").unwrap())
377-
.unwrap();
376+
let mut f =
377+
File::open(rlocation!(r, "rules_rust/rust/runfiles/data/sample.txt").unwrap()).unwrap();
378378

379379
let mut buffer = String::new();
380380
f.read_to_string(&mut buffer).unwrap();
@@ -399,8 +399,8 @@ mod test {
399399

400400
let r = Runfiles::create().unwrap();
401401

402-
let mut f = File::open(rlocation!(r, "rules_rust/tools/runfiles/data/sample.txt").unwrap())
403-
.unwrap();
402+
let mut f =
403+
File::open(rlocation!(r, "rules_rust/rust/runfiles/data/sample.txt").unwrap()).unwrap();
404404

405405
let mut buffer = String::new();
406406
f.read_to_string(&mut buffer).unwrap();

test/bzl_version/bzl_ext_version_test.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def bzl_ext_version_test(name, module_bazel, **kwargs):
2424
"MODULE_BAZEL": "$(rlocationpath {})".format(module_bazel),
2525
},
2626
deps = [
27-
Label("//tools/runfiles"),
27+
Label("//rust/runfiles"),
2828
],
2929
**kwargs
3030
)

test/bzl_version/bzl_version_test.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def bzl_version_test(name, module_bazel, **kwargs):
2424
"VERSION": VERSION,
2525
},
2626
deps = [
27-
Label("//tools/runfiles"),
27+
Label("//rust/runfiles"),
2828
],
2929
**kwargs
3030
)

0 commit comments

Comments
 (0)