Skip to content

Commit 6873239

Browse files
committed
Added rules_rust prefix to transitive workspace names.
1 parent 8cb0c78 commit 6873239

File tree

9 files changed

+44
-44
lines changed

9 files changed

+44
-44
lines changed

.bazelci/presubmit.yml

+20-20
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
default_linux_targets: &default_linux_targets
33
- "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
44
- "..."
5-
- "@examples//..."
5+
- "@rules_rust_examples//..."
66
# TODO: Switch manual tag to platform constraint after bazel 4.0.
77
- "//test/versioned_dylib:versioned_dylib_test"
88
# Bindgen currently only has a working toolchain for 18.04
9-
- "-@examples//ffi/rust_calling_c/simple/..."
9+
- "-@rules_rust_examples//ffi/rust_calling_c/simple/..."
1010
tasks:
1111
ubuntu1604:
1212
build_targets: *default_linux_targets
@@ -17,7 +17,7 @@ tasks:
1717
build_targets: *default_linux_targets
1818
test_targets:
1919
- "..."
20-
- "@examples//..."
20+
- "@rules_rust_examples//..."
2121
# TODO: Switch manual tag to platform constraint after bazel 4.0.
2222
- "//test/versioned_dylib:versioned_dylib_test"
2323
build_flags:
@@ -33,11 +33,11 @@ tasks:
3333
osx_targets: &osx_targets
3434
- "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
3535
- "..."
36-
- "@examples//..."
36+
- "@rules_rust_examples//..."
3737
# Skip tests for dylib support on osx, since we don't support it yet.
38-
- "-@examples//ffi/rust_calling_c:matrix_dylib_test"
39-
- "-@examples//ffi/rust_calling_c:matrix_dynamically_linked"
40-
- "-@examples//ffi/rust_calling_c/simple/..."
38+
- "-@rules_rust_examples//ffi/rust_calling_c:matrix_dylib_test"
39+
- "-@rules_rust_examples//ffi/rust_calling_c:matrix_dynamically_linked"
40+
- "-@rules_rust_examples//ffi/rust_calling_c/simple/..."
4141
build_targets: *osx_targets
4242
test_targets: *osx_targets
4343
build_flags:
@@ -47,15 +47,15 @@ tasks:
4747
- "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
4848
- "..."
4949
- "//test/..."
50-
- "@examples//..."
50+
- "@rules_rust_examples//..."
5151
- "-//test/conflicting_deps:conflicting_deps_test"
5252
# rust_doc_test is likely not fully sandboxed
5353
- "-//test/chained_direct_deps:mod3_doc_test"
54-
- "-@examples//fibonacci:fibonacci_doc_test"
55-
- "-@examples//hello_lib:hello_lib_doc_test"
56-
- "-@examples//ffi/rust_calling_c/simple/..."
54+
- "-@rules_rust_examples//fibonacci:fibonacci_doc_test"
55+
- "-@rules_rust_examples//hello_lib:hello_lib_doc_test"
56+
- "-@rules_rust_examples//ffi/rust_calling_c/simple/..."
5757
# See https://github.com/bazelbuild/bazel/issues/9987
58-
- "-@examples//ffi/rust_calling_c:matrix_dylib_test"
58+
- "-@rules_rust_examples//ffi/rust_calling_c:matrix_dylib_test"
5959
build_flags:
6060
- "--config=rustfmt"
6161
windows:
@@ -71,14 +71,14 @@ tasks:
7171
- "-//test/proto/..."
7272
- "-//tools/rust_analyzer/..."
7373
- "-//test/rustfmt/..."
74-
- "@examples//..."
75-
- "-@examples//ffi/rust_calling_c:matrix_dylib_test"
76-
- "-@examples//ffi/rust_calling_c:matrix_dynamically_linked"
77-
- "-@examples//ffi/rust_calling_c/simple/..."
78-
- "-@examples//hello_sys/..."
79-
- "-@examples//complex_sys/..."
80-
- "-@examples//proto/..."
81-
- "-@examples//wasm/..."
74+
- "@rules_rust_examples//..."
75+
- "-@rules_rust_examples//ffi/rust_calling_c:matrix_dylib_test"
76+
- "-@rules_rust_examples//ffi/rust_calling_c:matrix_dynamically_linked"
77+
- "-@rules_rust_examples//ffi/rust_calling_c/simple/..."
78+
- "-@rules_rust_examples//hello_sys/..."
79+
- "-@rules_rust_examples//complex_sys/..."
80+
- "-@rules_rust_examples//proto/..."
81+
- "-@rules_rust_examples//wasm/..."
8282
build_targets: *windows_targets
8383
test_targets: *windows_targets
8484
examples:

WORKSPACE.bazel

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
workspace(name = "rules_rust")
22

3-
load("@rules_rust//rust:repositories.bzl", "rust_repositories")
3+
load("//rust:repositories.bzl", "rust_repositories")
44

55
rust_repositories(include_rustc_srcs = True)
66

7-
load("@rules_rust//proto:repositories.bzl", "rust_proto_repositories")
7+
load("//proto:repositories.bzl", "rust_proto_repositories")
88

99
rust_proto_repositories()
1010

11-
load("@rules_rust//bindgen:repositories.bzl", "rust_bindgen_repositories")
11+
load("//bindgen:repositories.bzl", "rust_bindgen_repositories")
1212

1313
rust_bindgen_repositories()
1414

15-
load("@rules_rust//tools/rust_analyzer/raze:crates.bzl", "rules_rust_tools_rust_analyzer_fetch_remote_crates")
15+
load("//tools/rust_analyzer/raze:crates.bzl", "rules_rust_tools_rust_analyzer_fetch_remote_crates")
1616

1717
rules_rust_tools_rust_analyzer_fetch_remote_crates()
1818

19-
load("@rules_rust//wasm_bindgen:repositories.bzl", "rust_wasm_bindgen_repositories")
19+
load("//wasm_bindgen:repositories.bzl", "rust_wasm_bindgen_repositories")
2020

2121
rust_wasm_bindgen_repositories()
2222

@@ -52,37 +52,37 @@ rbe_autoconfig(name = "buildkite_config")
5252
# Load all dependencies for examples
5353

5454
local_repository(
55-
name = "examples",
55+
name = "rules_rust_examples",
5656
path = "examples",
5757
)
5858

59-
load("@examples//:examples_repositories.bzl", examples_repositories = "repositories")
59+
load("@rules_rust_examples//:examples_repositories.bzl", examples_repositories = "repositories")
6060

6161
examples_repositories()
6262

63-
load("@examples//:examples_deps.bzl", examples_deps = "deps")
63+
load("@rules_rust_examples//:examples_deps.bzl", examples_deps = "deps")
6464

6565
examples_deps()
6666

67-
load("@examples//:examples_transitive_deps.bzl", examples_transitive_deps = "transitive_deps")
67+
load("@rules_rust_examples//:examples_transitive_deps.bzl", examples_transitive_deps = "transitive_deps")
6868

6969
examples_transitive_deps(is_top_level = True)
7070

7171
# Load all dependencies for docs
7272

7373
local_repository(
74-
name = "docs",
74+
name = "rules_rust_docs",
7575
path = "docs",
7676
)
7777

78-
load("@docs//:docs_repositories.bzl", docs_repositories = "repositories")
78+
load("@rules_rust_docs//:docs_repositories.bzl", docs_repositories = "repositories")
7979

8080
docs_repositories()
8181

82-
load("@docs//:docs_deps.bzl", docs_deps = "deps")
82+
load("@rules_rust_docs//:docs_deps.bzl", docs_deps = "deps")
8383

8484
docs_deps()
8585

86-
load("@docs//:docs_transitive_deps.bzl", docs_transitive_deps = "transitive_deps")
86+
load("@rules_rust_docs//:docs_transitive_deps.bzl", docs_transitive_deps = "transitive_deps")
8787

8888
docs_transitive_deps(is_top_level = True)

docs/WORKSPACE.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
workspace(name = "io_bazel_rules_rust_docs")
1+
workspace(name = "rules_rust_docs")
22

33
load(":docs_repositories.bzl", "repositories")
44

docs/rust_wasm_bindgen.vm

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
To build a `rust_binary` for `wasm32-unknown-unknown` target add the `--platforms=@rules_rust//rust/platform:wasm` flag.
55

66
```command
7-
bazel build @examples//hello_world_wasm --platforms=@rules_rust//rust/platform:wasm
7+
bazel build @rules_rust_examples//hello_world_wasm --platforms=@rules_rust//rust/platform:wasm
88
```
99

1010
To build a `rust_binary` for `wasm32-wasi` target add the `--platforms=@rules_rust//rust/platform:wasi` flag.
1111

1212
```command
13-
bazel build @examples//hello_world_wasm --platforms=@rules_rust//rust/platform:wasi
13+
bazel build @rules_rust_examples//hello_world_wasm --platforms=@rules_rust//rust/platform:wasi
1414
```
1515

1616
`rust_wasm_bindgen` will automatically transition to the `wasm` platform and can be used when

examples/WORKSPACE.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
workspace(name = "examples")
1+
workspace(name = "rules_rust_examples")
22

33
load(":examples_repositories.bzl", "repositories")
44

examples/complex_sys/repositories.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ def rules_rust_examples_complex_sys_repositories():
1414
strip_prefix = "openssl-OpenSSL_1_1_1d",
1515
urls = ["https://github.com/openssl/openssl/archive/OpenSSL_1_1_1d.tar.gz"],
1616
sha256 = "23011a5cc78e53d0dc98dfa608c51e72bcd350aa57df74c5d5574ba4ffb62e74",
17-
build_file = "@examples//third_party/openssl:BUILD.openssl.bazel",
17+
build_file = "@rules_rust_examples//third_party/openssl:BUILD.openssl.bazel",
1818
)

examples/examples_deps.bzl

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
5-
load("@examples//complex_sys:repositories.bzl", "rules_rust_examples_complex_sys_repositories")
6-
load("@examples//hello_sys/raze:crates.bzl", "rules_rust_examples_hello_sys_fetch_remote_crates")
75
load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
86
load("@rules_rust//bindgen:repositories.bzl", "rust_bindgen_repositories")
97
load("@rules_rust//proto:repositories.bzl", "rust_proto_repositories")
108
load("@rules_rust//rust:repositories.bzl", "rust_repositories", "rust_repository_set")
119
load("@rules_rust//wasm_bindgen:repositories.bzl", "rust_wasm_bindgen_repositories")
10+
load("@rules_rust_examples//complex_sys:repositories.bzl", "rules_rust_examples_complex_sys_repositories")
11+
load("@rules_rust_examples//hello_sys/raze:crates.bzl", "rules_rust_examples_hello_sys_fetch_remote_crates")
1212

1313
def deps():
1414
"""Define dependencies for `rules_rust` examples"""
@@ -43,7 +43,7 @@ def deps():
4343
maybe(
4444
http_archive,
4545
name = "libc",
46-
build_file = "@examples//ffi:libc.BUILD",
46+
build_file = "@rules_rust_examples//ffi:libc.BUILD",
4747
sha256 = "1ac4c2ac6ed5a8fb9020c166bc63316205f1dc78d4b964ad31f4f21eb73f0c6d",
4848
strip_prefix = "libc-0.2.20",
4949
urls = [

examples/hello_world/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ package(default_visibility = ["//visibility:public"])
99
rust_binary(
1010
name = "hello_world",
1111
srcs = ["src/main.rs"],
12-
deps = ["@examples//hello_lib"],
12+
deps = ["@rules_rust_examples//hello_lib"],
1313
)
1414

1515
rust_doc(

examples/proto/helloworld/helloworld_test.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl ServerInfo {
3737
fn new() -> ServerInfo {
3838
let r = Runfiles::create().unwrap();
3939
let mut c =
40-
Command::new(r.rlocation("examples/proto/helloworld/greeter_server/greeter_server"))
40+
Command::new(r.rlocation("rules_rust_examples/proto/helloworld/greeter_server/greeter_server"))
4141
.arg("0")
4242
.stdout(Stdio::piped())
4343
.spawn()
@@ -66,7 +66,7 @@ impl ServerInfo {
6666
let r = Runfiles::create().unwrap();
6767

6868
let mut cmd0 =
69-
Command::new(r.rlocation("examples/proto/helloworld/greeter_client/greeter_client"));
69+
Command::new(r.rlocation("rules_rust_examples/proto/helloworld/greeter_client/greeter_client"));
7070
let cmd = cmd0.arg(format!("-p={}", self.port));
7171

7272
let output = if let Some(s) = arg { cmd.arg(s) } else { cmd }

0 commit comments

Comments
 (0)