Skip to content

Commit

Permalink
Renamed BUILD and WORKSPACE files to BUILD.bazel and WORKSPACE.bazel (b…
Browse files Browse the repository at this point in the history
…azelbuild#665)

The use of `BUILD`/`WORKSPACE` vs `BUILD.bazel`/`WORKSPACE.bazel` was inconsistent across the repo. This PR updates all files without the `.bazel` extension to use it (which has the higher priority over the two styles. see [here](https://docs.bazel.build/versions/master/build-ref.html#packages)).

Additionally, this PR contains buildifier fixes
  • Loading branch information
UebelAndre authored and yagehu committed Apr 23, 2021
1 parent 86b35ba commit f72a5e4
Show file tree
Hide file tree
Showing 79 changed files with 17 additions and 18 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions cargo/cargo_build_script.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ def cargo_build_script(
rustc_env (dict, optional): Environment variables to set in rustc when compiling the build script.
**kwargs: Forwards to the underlying `rust_binary` rule.
"""

# This duplicates the code in _build_script_impl because we need to make these available both when we invoke rustc (this code) and when we run the compiled build script (_build_script_impl).
# https://github.com/bazelbuild/rules_rust/issues/661 will hopefully remove this duplication.
rustc_env = dict(rustc_env)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/crate_universe/basic/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ rust_binary(
sh_test(
name = "test",
srcs = ["test.sh"],
data = [":basic"],
args = ["$(location :basic)"],
data = [":basic"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ rust_repositories()
# Need to have an http_file along the lines of:
#
# load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
#
#
# http_file(
# name = "crate_universe_resolver_darwin",
# urls = ["file:///PATH/TO/rules_rust/cargo/crate_universe_resolver/target/release/crate_universe_resolver"],
# sha256 = "FILL_ME_IN",
# executable = True,
# )
#
#
# http_file(
# name = "crate_universe_resolver_linux",
# urls = ["file:///PATH/TO/rules_rust/cargo/crate_universe_resolver/target/release/crate_universe_resolver"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "openssl",
build_file = "@examples//third_party/openssl:BUILD.openssl.bazel",
sha256 = "23011a5cc78e53d0dc98dfa608c51e72bcd350aa57df74c5d5574ba4ffb62e74",
strip_prefix = "openssl-OpenSSL_1_1_1d",
urls = ["https://github.com/openssl/openssl/archive/OpenSSL_1_1_1d.tar.gz"],
sha256 = "23011a5cc78e53d0dc98dfa608c51e72bcd350aa57df74c5d5574ba4ffb62e74",
build_file = "@examples//third_party/openssl:BUILD.openssl.bazel",
)

load("@rules_rust//rust:repositories.bzl", "rust_repositories")
Expand All @@ -25,14 +25,14 @@ rust_repositories()
# Need to have an http_file along the lines of:
#
# load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
#
#
# http_file(
# name = "crate_universe_resolver_darwin",
# urls = ["file:///PATH/TO/rules_rust/cargo/crate_universe_resolver/target/release/crate_universe_resolver"],
# sha256 = "FILL_ME_IN",
# executable = True,
# )
#
#
# http_file(
# name = "crate_universe_resolver_linux",
# urls = ["file:///PATH/TO/rules_rust/cargo/crate_universe_resolver/target/release/crate_universe_resolver"],
Expand Down
1 change: 0 additions & 1 deletion examples/crate_universe/uses_proc_macro/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ load(
"@rules_rust//rust:rust.bzl",
"rust_binary",
)

load("@rust_deps//:defs.bzl", "crate")

rust_binary(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ rust_repositories()
# Need to have an http_file along the lines of:
#
# load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
#
#
# http_file(
# name = "crate_universe_resolver_darwin",
# urls = ["file:///PATH/TO/rules_rust/cargo/crate_universe_resolver/target/release/crate_universe_resolver"],
# sha256 = "FILL_ME_IN",
# executable = True,
# )
#
#
# http_file(
# name = "crate_universe_resolver_linux",
# urls = ["file:///PATH/TO/rules_rust/cargo/crate_universe_resolver/target/release/crate_universe_resolver"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ rust_repositories()
# Need to have an http_file along the lines of:
#
# load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
#
#
# http_file(
# name = "crate_universe_resolver_darwin",
# urls = ["file:///PATH/TO/rules_rust/cargo/crate_universe_resolver/target/release/crate_universe_resolver"],
# sha256 = "FILL_ME_IN",
# executable = True,
# )
#
#
# http_file(
# name = "crate_universe_resolver_linux",
# urls = ["file:///PATH/TO/rules_rust/cargo/crate_universe_resolver/target/release/crate_universe_resolver"],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion rust/private/rust.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def _rust_test_common(ctx, toolchain, output):
root = crate.root,
srcs = depset(ctx.files.srcs, transitive = [crate.srcs]),
deps = depset(ctx.attr.deps, transitive = [crate.deps]),
proc_macro_deps = depset( ctx.attr.proc_macro_deps, transitive = [crate.proc_macro_deps]),
proc_macro_deps = depset(ctx.attr.proc_macro_deps, transitive = [crate.proc_macro_deps]),
aliases = ctx.attr.aliases,
output = output,
edition = crate.edition,
Expand Down
File renamed without changes.
9 changes: 4 additions & 5 deletions test/build_env/BUILD → test/build_env/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
load(
"//rust:rust.bzl",
"rust_test",
)

load(
"//cargo:cargo_build_script.bzl",
"cargo_build_script",
)
load(
"//rust:rust.bzl",
"rust_test",
)

package(default_visibility = ["//visibility:public"])

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f72a5e4

Please sign in to comment.