Skip to content

Commit 922b8d0

Browse files
authored
Build windows without runfiles links by default. (#3366)
1 parent 1832faa commit 922b8d0

File tree

18 files changed

+28
-196
lines changed

18 files changed

+28
-196
lines changed

.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

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

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/cargo_aliases/.bazelrc

Lines changed: 0 additions & 25 deletions
This file was deleted.

examples/crate_universe/cargo_remote/.bazelrc

Lines changed: 0 additions & 25 deletions
This file was deleted.

examples/crate_universe/cargo_workspace/.bazelrc

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)