Skip to content

Commit

Permalink
Fixed regression for proc-macro crates (#441)
Browse files Browse the repository at this point in the history
This fixes `crates.bzl` never having any crates defined in the `_PROC_MACRO_DEPENDENCIES` map.

This fixes a regression from #425 (or #282) and regenerates cargo-raze outputs (which should have been done on the merged commit). 

This also fixes a regression in how BUILD files were rendered, resulting in buildifier defects. I cherry picked a change I had an another branch which is ahead of `main` and contains the fix. This change includes #393

Finally, this fixes another regression where `extra_aliased_targets` was being ignored.
  • Loading branch information
UebelAndre authored Aug 25, 2021
1 parent 8443486 commit f480d81
Show file tree
Hide file tree
Showing 637 changed files with 1,687 additions and 1,689 deletions.
47 changes: 45 additions & 2 deletions examples/remote/binary_dependencies/cargo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ licenses([
])

# Aliased targets
alias(
name = "atty",
actual = "@remote_binary_dependencies__atty__0_2_14//:atty",
tags = [
"cargo-raze",
"manual",
],
)

alias(
name = "ferris_says",
actual = "@remote_binary_dependencies__ferris_says__0_2_0//:ferris_says",
Expand All @@ -22,8 +31,33 @@ alias(
)

alias(
# Extra aliased target, from raze configuration
# N.B.: The exact form of this is subject to change.
name = "indicatif",
actual = "@remote_binary_dependencies__indicatif__0_14_0//:indicatif",
tags = [
"cargo-raze",
"manual",
],
)

alias(
name = "structopt",
actual = "@remote_binary_dependencies__structopt__0_3_20//:structopt",
tags = [
"cargo-raze",
"manual",
],
)

alias(
name = "texture_synthesis",
actual = "@remote_binary_dependencies__texture_synthesis__0_8_0//:texture_synthesis",
tags = [
"cargo-raze",
"manual",
],
)

alias(
name = "cargo_bin_texture_synthesis",
actual = "@remote_binary_dependencies__texture_synthesis_cli__0_8_0//:cargo_bin_texture_synthesis",
tags = [
Expand All @@ -32,6 +66,15 @@ alias(
],
)

alias(
name = "texture_synthesis_cli",
actual = "@remote_binary_dependencies__texture_synthesis_cli__0_8_0//:texture_synthesis_cli",
tags = [
"cargo-raze",
"manual",
],
)

# Export file for Stardoc support
exports_files(
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:rust.bzl",
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

Expand All @@ -38,7 +39,6 @@ rust_library(
crate_features = [
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:rust.bzl",
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

Expand All @@ -38,7 +39,6 @@ rust_library(
crate_features = [
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:rust.bzl",
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

Expand All @@ -35,14 +36,11 @@ licenses([
rust_library(
name = "adler32",
srcs = glob(["**/*.rs"]),
aliases = {
},
crate_features = [
"default",
"std",
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2018",
rustc_flags = [
Expand All @@ -55,13 +53,5 @@ rust_library(
version = "1.2.0",
# buildifier: leave-alone
deps = [
] + selects.with_or({
# cfg(target_arch = "wasm32")
(
"@rules_rust//rust/platform:wasm32-unknown-unknown",
"@rules_rust//rust/platform:wasm32-wasi",
): [
],
"//conditions:default": [],
}),
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:rust.bzl",
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

Expand Down Expand Up @@ -40,7 +41,6 @@ rust_library(
crate_features = [
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:rust.bzl",
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

Expand Down Expand Up @@ -40,7 +41,6 @@ rust_library(
crate_features = [
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
Expand All @@ -56,22 +56,22 @@ rust_library(
] + selects.with_or({
# cfg(unix)
(
"@rules_rust//rust/platform:i686-apple-darwin",
"@rules_rust//rust/platform:i686-unknown-linux-gnu",
"@rules_rust//rust/platform:x86_64-apple-darwin",
"@rules_rust//rust/platform:x86_64-unknown-linux-gnu",
"@rules_rust//rust/platform:aarch64-apple-darwin",
"@rules_rust//rust/platform:aarch64-apple-ios",
"@rules_rust//rust/platform:aarch64-linux-android",
"@rules_rust//rust/platform:aarch64-unknown-linux-gnu",
"@rules_rust//rust/platform:arm-unknown-linux-gnueabi",
"@rules_rust//rust/platform:i686-apple-darwin",
"@rules_rust//rust/platform:i686-linux-android",
"@rules_rust//rust/platform:i686-unknown-freebsd",
"@rules_rust//rust/platform:i686-unknown-linux-gnu",
"@rules_rust//rust/platform:powerpc-unknown-linux-gnu",
"@rules_rust//rust/platform:s390x-unknown-linux-gnu",
"@rules_rust//rust/platform:x86_64-apple-darwin",
"@rules_rust//rust/platform:x86_64-apple-ios",
"@rules_rust//rust/platform:x86_64-linux-android",
"@rules_rust//rust/platform:x86_64-unknown-freebsd",
"@rules_rust//rust/platform:x86_64-unknown-linux-gnu",
): [
"@remote_binary_dependencies__libc__0_2_80//:libc",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:rust.bzl",
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

Expand Down Expand Up @@ -44,7 +45,6 @@ rust_library(
crate_features = [
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:rust.bzl",
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

Expand All @@ -39,8 +40,6 @@ licenses([
rust_library(
name = "backtrace",
srcs = glob(["**/*.rs"]),
aliases = {
},
crate_features = [
"addr2line",
"default",
Expand All @@ -50,7 +49,6 @@ rust_library(
"std",
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2018",
rustc_flags = [
Expand All @@ -69,15 +67,7 @@ rust_library(
"@remote_binary_dependencies__miniz_oxide__0_4_3//:miniz_oxide",
"@remote_binary_dependencies__object__0_22_0//:object",
"@remote_binary_dependencies__rustc_demangle__0_1_18//:rustc_demangle",
] + selects.with_or({
# cfg(windows)
(
"@rules_rust//rust/platform:i686-pc-windows-msvc",
"@rules_rust//rust/platform:x86_64-pc-windows-msvc",
): [
],
"//conditions:default": [],
}),
],
)

# Unsupported target "accuracy" with type "test" omitted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:rust.bzl",
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

Expand Down Expand Up @@ -67,7 +68,6 @@ rust_library(
"default",
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:rust.bzl",
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

Expand All @@ -36,7 +37,6 @@ rust_library(
crate_features = [
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2018",
rustc_flags = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:rust.bzl",
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

Expand Down Expand Up @@ -71,7 +72,6 @@ rust_library(
"std",
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:rust.bzl",
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

Expand All @@ -36,7 +37,6 @@ rust_library(
crate_features = [
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2018",
rustc_flags = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:rust.bzl",
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

Expand All @@ -36,7 +37,6 @@ rust_library(
crate_features = [
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2018",
rustc_flags = [
Expand Down
Loading

0 comments on commit f480d81

Please sign in to comment.