Skip to content

Commit b40e501

Browse files
authored
fix: windows functionality and tests (#334)
There are four issues when running on windows: 1. #330 2. #331 3. #332 4. #333 This PR fixes 3 and 4. There are related PRs in bazel-skylib and bazel-starlib. There is no dependency -- the PRs can close in any order. - cgrindel/bazel-starlib#446 (fixes 1) - bazelbuild/bazel-skylib#527 (fixes 2) ### Test results: Before: --enable_runfiles: 0 pass --noenable_runfiles: 0 pass After this PR: --enable_runfiles: 52 pass, 19 failures --noenable_runfiles: 51 pass, 20 failures (17 are doc diff-tests due to bazel-starlib) After this PR, together with wip PRs for 1 and 2: --enable_runfiles: 71 pass, 0 failures --noenable_runfiles: 51 pass, 20 failures (all due to bazel-starlib)
1 parent 2d514c3 commit b40e501

File tree

4 files changed

+62
-20
lines changed

4 files changed

+62
-20
lines changed

MODULE.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ bazel_dep(name = "rules_python", version = "0.19.0")
88
bazel_dep(name = "platforms", version = "0.0.7")
99
bazel_dep(name = "cgrindel_bazel_starlib", version = "0.18.0")
1010

11+
# not a direct dependency, but required here for bazel starlib's difftest macros to work
12+
bazel_dep(
13+
name = "buildifier_prebuilt",
14+
version = "6.1.2",
15+
)
16+
1117
register_toolchains("@bazel_tools//tools/python:autodetecting_toolchain")
1218

1319
# Must keep the Bazel version listed in WORKSPACE in sync with those loaded

MODULE.bazel.lock

Lines changed: 45 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shared.bazelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ common --color=auto --curses=auto
1212

1313
# Enable bzlmod
1414
common --enable_bzlmod
15+
16+
# Required for windows
17+
startup --windows_enable_symlinks
18+
19+
# this library requires runfiles for the bzlformat_lint_test
20+
# but this is off by default on windows. Switch it on.
21+
common --enable_runfiles

tests/tools_tests/remove_child_wksp_bazel_symlinks_test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ child_a_bazel_out="${bazel_out}/child_a"
3838
child_b_bazel_out="${bazel_out}/child_b"
3939
mkdir -p "${bazel_out}" "${child_a_bazel_out}" "${child_b_bazel_out}" "${parent_bazel_out}"
4040

41+
# Windows requires this for msys to create real symlinks
42+
# https://superuser.com/questions/1097481/msys2-create-a-sym-link-into-windows-folder-location
43+
export MSYS=winsymlinks:nativestrict
44+
4145
# Add bazel symlinks
4246
parent_symlink="${parent_dir}/bazel-parent"
4347
child_a_symlink="${child_a_dir}/bazel-child_a"

0 commit comments

Comments
 (0)