Skip to content

Commit

Permalink
Merge branch 'main' into split-debuginfo
Browse files Browse the repository at this point in the history
  • Loading branch information
krasimirgg authored Jan 14, 2025
2 parents cc91a3a + bb74a65 commit 5331948
Show file tree
Hide file tree
Showing 288 changed files with 7,060 additions and 6,368 deletions.
59 changes: 48 additions & 11 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
---
minimum_bazel_version: &minimum_bazel_version "7.4.1"
no_bzlmod_bazel_version: &no_bzlmod_bazel_version "7.4.1"
no_bzlmod_shell_commands: &no_bzlmod_shell_commands
- echo "common --noenable_bzlmod --enable_workspace" >> user.bazelrc
- echo "7.4.1" > .bazelversion
no_bzlmod_rbe_shell_commands: &no_bzlmod_rbe_shell_commands
- sed -i 's/^# load("@bazel_ci_rules/load("@bazel_ci_rules/' WORKSPACE.bazel
- sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
- echo "common --noenable_bzlmod --enable_workspace" >> user.bazelrc
- echo "7.4.1" > .bazelversion
aspects_flags: &aspects_flags
- "--config=rustfmt"
- "--config=clippy"
Expand All @@ -16,12 +25,6 @@ bzlmod_flags: &bzlmod_flags
bzlmod_plus_repo_names_flags: &bzlmod_plus_repo_names_flags
# `--lockfile_mode=error` is omitted because the repo names leak into the lock file.
- "--incompatible_use_plus_in_repo_names"
no_bzlmod_shell_commands: &no_bzlmod_shell_commands
- echo "common --noenable_bzlmod --enable_workspace" >> user.bazelrc
no_bzlmod_rbe_shell_commands: &no_bzlmod_rbe_shell_commands
- sed -i 's/^# load("@bazel_ci_rules/load("@bazel_ci_rules/' WORKSPACE.bazel
- sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
- echo "common --noenable_bzlmod --enable_workspace" >> user.bazelrc
single_rust_channel_targets: &single_rust_channel_targets
- "--"
- "//..."
Expand All @@ -31,6 +34,21 @@ single_rust_channel_targets: &single_rust_channel_targets
# These tests are expected to fail as they require both a nightly and stable toolchain.
- "-//test/unit/channel_transitions/..."
- "-//test/unpretty/..."
single_rust_channel_min_version_targets: &single_rust_channel_min_version_targets
# START - Copied from 'single_rust_channel_targets'.
# TODO: Figure out how to do proper list inheritence.
- "--"
- "//..."
# TODO: Remove this and replace `cargo_bootstrap_repository` with a
# http_archive for a release: https://github.com/cross-rs/cross/issues/1356
- "-//crate_universe/tools/cross_installer/..."
# These tests are expected to fail as they require both a nightly and stable toolchain.
- "-//test/unit/channel_transitions/..."
- "-//test/unpretty/..."
# END - Copied from 'single_rust_channel_targets'.
#
# These tests exercise behavior only available versions of Rust >1.80
- "-//test/unit/lint_flags/..."
default_linux_targets: &default_linux_targets
- "--"
- "//..."
Expand Down Expand Up @@ -101,6 +119,7 @@ tasks:
ubuntu2004_no_bzlmod:
name: No Bzlmod
platform: ubuntu2004
bazel: *no_bzlmod_bazel_version
shell_commands: *no_bzlmod_shell_commands
build_targets: *default_linux_targets
test_targets: *default_linux_targets
Expand All @@ -111,12 +130,14 @@ tasks:
rbe_ubuntu2004_no_bzlmod:
name: No Bzlmod
platform: rbe_ubuntu2004
bazel: *no_bzlmod_bazel_version
shell_commands: *no_bzlmod_rbe_shell_commands
build_targets: *default_linux_targets
test_targets: *default_linux_targets
macos_no_bzlmod:
name: No Bzlmod
platform: macos_arm64
bazel: *no_bzlmod_bazel_version
shell_commands: *no_bzlmod_shell_commands
build_targets: *default_macos_targets
test_targets: *default_macos_targets
Expand All @@ -125,6 +146,7 @@ tasks:
windows_no_bzlmod:
name: No Bzlmod
platform: windows
bazel: *no_bzlmod_bazel_version
shell_commands: *no_bzlmod_shell_commands
build_targets: *default_windows_targets
test_targets: *default_windows_targets
Expand Down Expand Up @@ -327,16 +349,16 @@ tasks:
name: "Min Rust Version"
platform: ubuntu2004
shell_commands: *min_rust_version_shell_commands
build_targets: *single_rust_channel_targets
test_targets: *single_rust_channel_targets
build_targets: *single_rust_channel_min_version_targets
test_targets: *single_rust_channel_min_version_targets
ubuntu2004_min_rust_version_with_aspects:
name: "Min Rust Version With Aspects"
platform: ubuntu2004
shell_commands: *min_rust_version_shell_commands
build_flags: *aspects_flags
build_targets: *single_rust_channel_targets
build_targets: *single_rust_channel_min_version_targets
test_flags: *aspects_flags
test_targets: *single_rust_channel_targets
test_targets: *single_rust_channel_min_version_targets
ubuntu2004_stable_toolchain:
name: "Only Stable Toolchain"
platform: ubuntu2004
Expand Down Expand Up @@ -392,7 +414,6 @@ tasks:
build_targets:
- //...
run_targets:
- "//:test_docs"
- "//:publish_book"
clippy_failure:
name: Negative Clippy Tests
Expand Down Expand Up @@ -461,6 +482,22 @@ tasks:
working_directory: examples/crate_universe_local_path
run_targets:
- "//:vendor_edit_test_in_tree"
crate_universe_local_path_external_no_bzlmod:
name: Crate Universe Local Path External (No Bzlmod)
platform: ubuntu2004
bazel: *no_bzlmod_bazel_version
shell_commands: *no_bzlmod_shell_commands
working_directory: examples/crate_universe_local_path
run_targets:
- "//:vendor_edit_test_out_of_tree"
crate_universe_local_path_in_tree_no_bzlmod:
name: Crate Universe Local Path In Tree (No Bzlmod)
platform: ubuntu2004
bazel: *no_bzlmod_bazel_version
shell_commands: *no_bzlmod_shell_commands
working_directory: examples/crate_universe_local_path
run_targets:
- "//:vendor_edit_test_in_tree"
# See https://github.com/bazelbuild/rules_rust/issues/2186 about re-enabling these.
# crate_universe_examples_windows:
# name: Crate Universe Examples
Expand Down
20 changes: 17 additions & 3 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 Down Expand Up @@ -53,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 Down Expand Up @@ -83,7 +89,7 @@ use_repo(
"libc",
"rtra",
"rtra__serde-1.0.217",
"rtra__serde_json-1.0.134",
"rtra__serde_json-1.0.135",
"rules_rust_test_load_arbitrary_tool",
"rules_rust_toolchain_test_target_json",
)
Expand Down Expand Up @@ -120,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 Down Expand Up @@ -156,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 5331948

Please sign in to comment.