Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update crate_universe to determine dep+feature trees per host #2877

Merged
merged 7 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 45 additions & 2 deletions bindgen/3rdparty/crates/BUILD.proc-macro2-1.0.60.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 45 additions & 2 deletions bindgen/3rdparty/crates/BUILD.quote-1.0.28.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 59 additions & 4 deletions crate_universe/3rdparty/crates/BUILD.phf_shared-0.11.2.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 45 additions & 2 deletions crate_universe/3rdparty/crates/BUILD.rand-0.8.5.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 16 additions & 13 deletions crate_universe/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,23 @@ bzl_library(
)

filegroup(
name = "rust_srcs",
name = "rust_data",
srcs = glob([
"src/**/*.bzl",
"src/**/*.j2",
"src/**/*.rs",
"src/**/*.sh",
"src/**/*.bat",
]),
visibility = ["//:__subpackages__"],
)

filegroup(
name = "rust_srcs",
srcs = glob([
"src/**/*.rs",
]) + [
":rust_data",
],
visibility = ["//crate_universe:__subpackages__"],
)

rust_library(
Expand All @@ -52,10 +62,7 @@ rust_library(
exclude = ["src/main.rs"],
),
aliases = aliases(),
compile_data = glob(
include = ["src/**"],
exclude = ["src/**/*.rs"],
),
compile_data = [":rust_data"],
edition = "2021",
proc_macro_deps = all_crate_deps(proc_macro = True),
# This target embeds additional, stamping related information (see
Expand Down Expand Up @@ -119,16 +126,12 @@ rust_test(
],
edition = "2021",
env = {
"CARGO": "$(rootpath @rules_rust//rust/toolchain:current_cargo_files)",
"RUSTC": "$(rootpath @rules_rust//rust/toolchain:current_rustc_files)",
"CARGO": "$(rlocationpath @rules_rust//rust/toolchain:current_cargo_files)",
"RUSTC": "$(rlocationpath @rules_rust//rust/toolchain:current_rustc_files)",
},
proc_macro_deps = all_crate_deps(
proc_macro_dev = True,
),
rustc_env = {
"CARGO": "$(rootpath @rules_rust//rust/toolchain:current_cargo_files)",
"RUSTC": "$(rootpath @rules_rust//rust/toolchain:current_rustc_files)",
},
tags = ["requires-network"],
deps = [
":cargo_bazel",
Expand Down
2 changes: 1 addition & 1 deletion crate_universe/private/bootstrap_utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _format_src_label(label):
return "Label(\"{}\"),".format(str(label).lstrip("@"))

def _srcs_module_impl(ctx):
srcs = [_format_src_label(src.owner) for src in ctx.files.srcs]
srcs = [_format_src_label(src.owner) for src in sorted(ctx.files.srcs)]
if not srcs:
fail("`srcs` cannot be empty")
output = ctx.actions.declare_file(ctx.label.name)
Expand Down
2 changes: 2 additions & 0 deletions crate_universe/private/srcs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ CARGO_BAZEL_SRCS = [
Label("//crate_universe:src/metadata.rs"),
Label("//crate_universe:src/metadata/cargo_bin.rs"),
Label("//crate_universe:src/metadata/cargo_tree_resolver.rs"),
Label("//crate_universe:src/metadata/cargo_tree_rustc_wrapper.bat"),
Label("//crate_universe:src/metadata/cargo_tree_rustc_wrapper.sh"),
Label("//crate_universe:src/metadata/dependency.rs"),
Label("//crate_universe:src/metadata/metadata_annotation.rs"),
Label("//crate_universe:src/rendering.rs"),
Expand Down
Loading
Loading