Skip to content

Commit

Permalink
Merge branch 'main' into relpath
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-mccall authored Jan 13, 2025
2 parents 7e348b1 + 5e426fa commit 79cdf83
Show file tree
Hide file tree
Showing 937 changed files with 17,892 additions and 16,520 deletions.
261 changes: 136 additions & 125 deletions .bazelci/presubmit.yml

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ build --nolegacy_external_runfiles
# Required for cargo_build_script support before Bazel 7
build --incompatible_merge_fixed_and_default_shell_env

# When our minimum bazel version reaches >= 7.4.0, we should uncomment the
# following line to guarantee that rules_rust does not rely on autoloading;
# see https://github.com/bazelbuild/bazel/issues/23043 for details.
# build --incompatible_autoload_externally=
# https://github.com/bazelbuild/bazel/issues/23043.
build --incompatible_autoload_externally=

###############################################################################
## Bzlmod
Expand Down
4 changes: 2 additions & 2 deletions .bcr/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bcr_test_module:
bazel: ["7.x"]
tasks:
run_tests:
working_directory: examples/bzlmod/hello_world
working_directory: examples/hello_world
name: "Run test module"
platform: ${{ platform }}
bazel: ${{ bazel }}
Expand All @@ -24,7 +24,7 @@ bcr_test_module_windows:
bazel: ["7.x"]
tasks:
run_tests:
working_directory: examples/bzlmod/hello_world
working_directory: examples/hello_world
name: "Run test module"
platform: windows
bazel: ${{ bazel }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ jobs:
bazel clean
# Build an archive of the repo contents.
# `examples/bzlmod` is included for the BCR presubmit; it must appear before --exclude="examples"
# `examples/hello_world` is included for the BCR presubmit; it must appear before --exclude="examples"
tar -czf ${{ github.workspace }}/.github/rules_rust.tar.gz \
-C ${{ github.workspace }} \
--exclude=".git" \
--exclude=".github" \
--exclude="crate_universe/target" \
examples/bzlmod \
examples/hello_world \
--exclude="examples" \
.
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/test/no_std/bazel-*
/docs/bazel-*
user.bazelrc
MODULE.bazel.lock
/MODULE.bazel.lock

# rustfmt
*.rs.bk
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Francois-Rene Rideau <[email protected]>
Julio Merino <[email protected]>
Kamal Marhubi <[email protected]>
Kristina Chodorow <[email protected]>
Michael Hackner <[email protected]>
Philipp Wollermann <[email protected]>
Ulf Adams <[email protected]>
Justine Alexandra Roberts Tunney <[email protected]>
Expand Down
37 changes: 32 additions & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bazel_dep(
)
bazel_dep(
name = "platforms",
version = "0.0.10",
version = "0.0.11",
)
bazel_dep(
name = "rules_cc",
Expand All @@ -42,6 +42,7 @@ bazel_dep(
internal_deps = use_extension("//rust/private:internal_extensions.bzl", "i")
use_repo(
internal_deps,
"rrra",
"rrra__anyhow-1.0.71",
"rrra__clap-4.3.11",
"rrra__env_logger-0.10.0",
Expand All @@ -52,6 +53,12 @@ use_repo(
"rules_rust_tinyjson",
)

cargo_internal_deps = use_extension("//cargo/private:internal_extensions.bzl", "i")
use_repo(
cargo_internal_deps,
"rrcti__cargo_toml-0.20.5",
)

rust = use_extension("//rust:extensions.bzl", "rust")
rust.toolchain(edition = "2021")
use_repo(rust, "rust_toolchains")
Expand All @@ -61,7 +68,18 @@ register_toolchains(
)

rust_host_tools = use_extension("//rust:extensions.bzl", "rust_host_tools")
use_repo(rust_host_tools, "rust_host_tools")
rust_host_tools.host_tools(
name = "rust_host_tools",
)
rust_host_tools.host_tools(
name = "rust_host_tools_nightly",
version = "nightly",
)
use_repo(
rust_host_tools,
"rust_host_tools",
"rust_host_tools_nightly",
)

rust_test = use_extension("//test:test_extensions.bzl", "rust_test", dev_dependency = True)
use_repo(
Expand All @@ -70,8 +88,8 @@ use_repo(
"generated_inputs_in_external_repo",
"libc",
"rtra",
"rtra__serde-1.0.216",
"rtra__serde_json-1.0.133",
"rtra__serde-1.0.217",
"rtra__serde_json-1.0.135",
"rules_rust_test_load_arbitrary_tool",
"rules_rust_toolchain_test_target_json",
)
Expand Down Expand Up @@ -108,7 +126,6 @@ use_repo(
"cargo_bazel.buildifier-linux-arm64",
"cargo_bazel.buildifier-linux-s390x",
"cargo_bazel.buildifier-windows-amd64.exe",
"cargo_bazel_bootstrap",
"cui",
"cui__anyhow-1.0.89",
"cui__camino-1.1.9",
Expand All @@ -119,6 +136,7 @@ use_repo(
"cui__cfg-expr-0.17.2",
"cui__clap-4.3.11",
"cui__crates-index-3.3.0",
"cui__glob-0.3.1",
"cui__hex-0.4.3",
"cui__indoc-2.0.5",
"cui__itertools-0.13.0",
Expand All @@ -143,6 +161,15 @@ use_repo(
"cui__walkdir-2.5.0",
)

crate_universe_internal_non_repro_deps = use_extension(
"//crate_universe/private:internal_extensions.bzl",
"cu_nr",
)
use_repo(
crate_universe_internal_non_repro_deps,
"cargo_bazel_bootstrap",
)

crate_universe_internal_dev_deps = use_extension(
"//crate_universe/private:internal_extensions.bzl",
"cu_dev",
Expand Down
4 changes: 4 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ load("//crate_universe/tools/cross_installer:cross_installer_deps.bzl", "cross_i

cross_installer_deps()

load("@rules_rust//cargo:deps.bzl", "cargo_dependencies")

cargo_dependencies()

load("@rules_rust//tools/rust_analyzer:deps.bzl", "rust_analyzer_dependencies")

rust_analyzer_dependencies()
Expand Down
16 changes: 9 additions & 7 deletions cargo/cargo_build_script_runner/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
load("//rust:defs.bzl", "rust_binary", "rust_library", "rust_test")

rust_library(
name = "cargo_build_script_output_parser",
srcs = ["lib.rs"],
name = "cargo_build_script_runner",
srcs = [
"cargo_manifest_dir.rs",
"lib.rs",
],
edition = "2018",
)

rust_test(
name = "test",
crate = ":cargo_build_script_output_parser",
crate = ":cargo_build_script_runner",
edition = "2018",
)

rust_binary(
name = "cargo_build_script_runner",
name = "runner",
srcs = ["bin.rs"],
edition = "2018",
visibility = ["//visibility:public"],
deps = [":cargo_build_script_output_parser"],
deps = [":cargo_build_script_runner"],
)

rust_test(
name = "bin_test",
crate = ":cargo_build_script_runner",
crate = ":runner",
edition = "2018",
deps = [":cargo_build_script_runner"],
)
Loading

0 comments on commit 79cdf83

Please sign in to comment.