Skip to content

Commit 778c360

Browse files
committed
rebase
2 parents 78d915a + 922b8d0 commit 778c360

183 files changed

Lines changed: 17885 additions & 2236 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelci/presubmit.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ default_macos_targets: &default_macos_targets
6969
default_windows_targets: &default_windows_targets
7070
- "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
7171
- "//..."
72-
default_windows_no_runfiles_targets: &default_windows_no_runfiles_targets
73-
- "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
74-
- "//..."
7572
crate_universe_vendor_example_targets: &crate_universe_vendor_example_targets
7673
- "//vendor_external:crates_vendor"
7774
- "//vendor_local_manifests:crates_vendor"
@@ -148,15 +145,14 @@ tasks:
148145
shell_commands: *no_bzlmod_shell_commands
149146
build_targets: *default_windows_targets
150147
test_targets: *default_windows_targets
151-
windows_no_runfiles:
152-
name: No Runfiles
148+
windows_with_runfiles:
149+
name: With Runfiles
153150
platform: windows
154-
build_flags:
155-
- "--noenable_runfiles"
156-
test_flags:
157-
- "--noenable_runfiles"
158-
build_targets: *default_windows_no_runfiles_targets
159-
test_targets: *default_windows_no_runfiles_targets
151+
batch_commands:
152+
- echo startup --windows_enable_symlinks > user.bazelrc
153+
- echo common --noenable_runfiles >> user.bazelrc
154+
build_targets: *default_windows_targets
155+
test_targets: *default_windows_targets
160156
ubuntu2004_split_coverage_postprocessing:
161157
name: Split Coverage Postprocessing
162158
platform: ubuntu2004
@@ -251,18 +247,19 @@ tasks:
251247
build_targets: *default_windows_targets
252248
test_targets: *default_windows_targets
253249
windows_no_runfiles_with_aspects:
254-
name: No Runfiles With Aspects
250+
name: With Runfiles With Aspects
255251
platform: windows
252+
batch_commands:
253+
- echo startup --windows_enable_symlinks > user.bazelrc
254+
- echo common --noenable_runfiles >> user.bazelrc
256255
build_flags:
257-
- "--noenable_runfiles"
258256
- "--config=rustfmt"
259257
- "--config=clippy"
260258
test_flags:
261-
- "--noenable_runfiles"
262259
- "--config=rustfmt"
263260
- "--config=clippy"
264-
build_targets: *default_windows_no_runfiles_targets
265-
test_targets: *default_windows_no_runfiles_targets
261+
build_targets: *default_windows_targets
262+
test_targets: *default_windows_targets
266263
windows_rolling_with_aspects:
267264
name: "Windows Rolling Bazel Version With Aspects"
268265
platform: windows

.bazelrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ build --nobuild_runfile_links
1111
# https://bazel.build/reference/command-line-reference#flag--enable_platform_specific_config
1212
common --enable_platform_specific_config
1313

14-
# https://bazel.build/docs/windows#symlink
15-
startup --windows_enable_symlinks
16-
build:windows --enable_runfiles
17-
1814
# Enable the only currently supported report type
1915
# https://bazel.build/reference/command-line-reference#flag--combined_report
2016
coverage --combined_report=lcov

.github/github.bazelrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
# Always display the flags being used
44
common --announce_rc
55

6-
# These settings make the windows workers behave similarly to unix workers
7-
startup --windows_enable_symlinks
8-
build --enable_runfiles
9-
106
# Show errors in CI
117
test --test_output=errors
128

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module(
44
name = "rules_rust",
5-
version = "0.59.1",
5+
version = "0.59.2",
66
)
77

88
###############################################################################

cargo/cargo_build_script_runner/cargo_manifest_dir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ impl RunfilesMaker {
279279
/// Delete runfiles from the runfiles directory that do not match user defined suffixes
280280
///
281281
/// The Windows implementation assumes symlinks are not supported and real files will have
282-
/// been copied into the runfiles directoriy.
282+
/// been copied into the runfiles directory.
283283
fn drain_runfiles_dir_windows(&self) -> Result<(), String> {
284284
for dest in self.runfiles.values() {
285285
if !self

crate_universe/extensions.bzl

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ There are some examples of using crate_universe with bzlmod in the [example fold
2626
To use rules_rust in a project using bzlmod, add the following to your MODULE.bazel file:
2727
2828
```python
29-
bazel_dep(name = "rules_rust", version = "0.59.1")
29+
bazel_dep(name = "rules_rust", version = "0.59.2")
3030
```
3131
3232
You find the latest version on the [release page](https://github.com/bazelbuild/rules_rust/releases).
@@ -243,7 +243,7 @@ module(
243243
bazel_dep(name = "bazel_skylib", version = "1.7.1")
244244
245245
# https://github.com/bazelbuild/rules_rust/releases
246-
bazel_dep(name = "rules_rust", version = "0.59.1")
246+
bazel_dep(name = "rules_rust", version = "0.59.2")
247247
248248
###############################################################################
249249
# T O O L C H A I N S
@@ -801,7 +801,11 @@ def _get_generator(module_ctx):
801801
generator_sha256 = module_ctx.os.environ.get(CARGO_BAZEL_GENERATOR_SHA256)
802802
generator_url = module_ctx.os.environ.get(CARGO_BAZEL_GENERATOR_URL)
803803
elif len(CARGO_BAZEL_URLS) == 0:
804-
return module_ctx.path(Label("@cargo_bazel_bootstrap//:cargo-bazel"))
804+
# For Bazel 7 and below, `module_ctx.path` will also watch files so to avoid
805+
# volatility in lock files caused by referencing host specific files, direct
806+
# references are avoided.
807+
return module_ctx.path(Label("@cargo_bazel_bootstrap//:BUILD.bazel")).dirname.get_child("cargo-bazel")
808+
805809
else:
806810
generator_sha256 = CARGO_BAZEL_SHA256S.get(host_triple.str)
807811
generator_url = CARGO_BAZEL_URLS.get(host_triple.str)
@@ -839,8 +843,17 @@ def _get_host_cargo_rustc(module_ctx, host_triple, host_tools_repo):
839843
"""
840844
binary_ext = system_to_binary_ext(host_triple.system)
841845

842-
cargo_path = str(module_ctx.path(Label("@{}//:bin/cargo{}".format(host_tools_repo, binary_ext))))
843-
rustc_path = str(module_ctx.path(Label("@{}//:bin/rustc{}".format(host_tools_repo, binary_ext))))
846+
# For Bazel 7 and below, `module_ctx.path` will also watch files so to avoid
847+
# volatility in lock files caused by referencing host specific files, direct
848+
# references are avoided. Note that `BUILD.bazel` is not used as it also
849+
# contains host specific data.
850+
root = module_ctx.path(Label("@{rust_host_tools}//:WORKSPACE.bazel".format(
851+
rust_host_tools = host_tools_repo,
852+
)))
853+
854+
cargo_path = root.dirname.get_child("bin/cargo{}".format(binary_ext))
855+
rustc_path = root.dirname.get_child("bin/rustc{}".format(binary_ext))
856+
844857
return cargo_path, rustc_path
845858

846859
def _crate_impl(module_ctx):

docs/src/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,3 @@ WORKSPACE support is officially tested with Bazel 7 for as long as that is the m
9898
We aim to support Linux and macOS.
9999

100100
We do not have sufficient maintainer expertise to support Windows. Most things probably work, but we have had to disable many tests in CI because we lack the expertise to fix them. We welcome contributions to help improve its support.
101-
102-
Windows support for some features requires `--enable_runfiles` to be passed to Bazel, we recommend putting it in your bazelrc. See [Using Bazel on Windows](https://bazel.build/configure/windows) for more Windows-specific recommendations.

examples/all_crate_deps/.bazelrc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
# Required on windows
2-
common --enable_platform_specific_config
3-
startup --windows_enable_symlinks
4-
build:windows --enable_runfiles
5-
6-
build --experimental_enable_bzlmod
7-
81
# This isn't currently the defaut in Bazel, but we enable it to test we'll be ready if/when it flips.
92
build --incompatible_disallow_empty_glob
103

examples/compile_opt/.bazelrc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Required on windows
2-
common --enable_platform_specific_config
3-
startup --windows_enable_symlinks
4-
build:windows --enable_runfiles
5-
61
# This isn't currently the defaut in Bazel, but we enable it to test we'll be ready if/when it flips.
72
build --incompatible_disallow_empty_glob
83

examples/crate_universe/MODULE.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,6 @@ use_repo(
603603
"crates_vendor_pkgs__tracing-0.1.41",
604604
"crates_vendor_pkgs__tracing-subscriber-0.3.19",
605605
"cvm",
606-
"cvm__serde_yaml-0.9.34-deprecated",
607606
"cvm__tempfile-3.19.0",
608607
"cvm__tokio-1.44.1",
609608
"cvm__tokio-test-0.4.4",

0 commit comments

Comments
 (0)