Skip to content

Commit c640a9c

Browse files
peakschrisfmeum
andauthored
feat: fix zstd_toolchain and enable root tests on Windows (#1137)
* windows fixes * update * green root tests for windows * enable another test on windows * enable coreutils tests on windows * fix comment * fix issue during copy_directory_toolchain analysis * remove workaround * lint fix * disable 4 tests on windows * disable two incompatible tests on windows * bazel 8 fixes * add noshow_progress to ci jobs * fix windows/bazel7 * bump skylib 1.8.1 and disable one bats test * tidy * fix presubmit * align bcr patches to go bump * Update BUILD.bazel * Apply suggestions from code review * update e2e versions to match root * lock onto current go1.22.7 * Update go.mod * update patches --------- Co-authored-by: Fabian Meumertzheim <[email protected]>
1 parent 4af6c32 commit c640a9c

File tree

34 files changed

+226
-53
lines changed

34 files changed

+226
-53
lines changed

.bazelrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import %workspace%/.aspect/bazelrc/javascript.bazelrc
77
import %workspace%/.aspect/bazelrc/performance.bazelrc
88

99
### YOUR PROJECT SPECIFIC OPTIONS GO HERE ###
10+
common --enable_platform_specific_config
1011

1112
# For testing our --stamp behavior.
1213
# Normally users would use a --workspace_status_command with a script that calls `git describe`.
@@ -29,6 +30,17 @@ common --check_direct_dependencies=off
2930
# Make sure we don't regress this.
3031
common --incompatible_auto_exec_groups
3132

33+
# Symlinks are pretty much required on windows so enable by default
34+
startup --windows_enable_symlinks
35+
36+
# Point tools such as coursier (used in rules_jvm_external) to Bazel's downloaded JDK
37+
# suggested in https://github.com/bazelbuild/rules_jvm_external/issues/445
38+
common --repo_env=JAVA_HOME=../bazel_tools/jdk
39+
40+
# This option fixes 20 tests on Windows but I am reluctant to enable it as it would be
41+
# better for this library to be tested with runfiles off (it is a performance drain on windows).
42+
# common:windows --enable_runfiles
43+
3244
# Load any settings & overrides specific to the current user from `.aspect/bazelrc/user.bazelrc`.
3345
# This file should appear in `.gitignore` so that settings are not shared with team members. This
3446
# should be last statement in this config so the user configuration is able to overwrite flags from

.bcr/patches/go_dev_dep.patch

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ diff --git a/MODULE.bazel b/MODULE.bazel
22
index e63fa5b..9d78a88 100644
33
--- a/MODULE.bazel
44
+++ b/MODULE.bazel
5-
@@ -50,19 +50,19 @@ use_repo(host, "aspect_bazel_lib_host")
5+
@@ -52,26 +52,26 @@ use_repo(host, "aspect_bazel_lib_host")
66
bazel_dep(
77
name = "gazelle",
88
version = "0.40.0",
@@ -11,12 +11,20 @@ index e63fa5b..9d78a88 100644
1111
)
1212
bazel_dep(
1313
name = "rules_go",
14-
version = "0.51.0",
14+
version = "0.55.0",
1515
repo_name = "io_bazel_rules_go",
1616
- # In released versions: dev_dependency = True
1717
+ dev_dependency = True,
1818
)
1919

20+
go_sdk = use_extension(
21+
"@io_bazel_rules_go//go:extensions.bzl",
22+
"go_sdk",
23+
- # In released versions: dev_dependency = True
24+
+ dev_dependency = True,
25+
)
26+
go_sdk.from_file(go_mod = "//:go.mod")
27+
2028
go_deps = use_extension(
2129
"@gazelle//:extensions.bzl",
2230
"go_deps",

.github/workflows/ci.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ common --repository_cache=~/.cache/bazel-repository-cache
44

55
# Debug where options came from
66
common --announce_rc
7+
8+
# Keep bazel stdout readable in logs
9+
common --noshow_progress

.github/workflows/ci.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,9 @@ jobs:
8989
- bazel-version:
9090
major: 6
9191
bzlmod: 1
92-
# TODO: green up root Workspace on MacOS & Windows
92+
# TODO: green up root Workspace on MacOS
9393
- folder: .
9494
os: macos
95-
- folder: .
96-
os: windows
9795
include:
9896
- folder: docs
9997
bzlmod: 1

BUILD.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ assert_contains(
112112
name = "bazel_version_test",
113113
actual = ".bazelversion",
114114
expected = str(host.bazel_version),
115-
target_compatible_with = [] if host.bazel_version.startswith("7") else ["@platforms//:incompatible"],
115+
# TODO: Enable this for windows
116+
target_compatible_with = [] if host.bazel_version.startswith("7") and not host.is_windows else ["@platforms//:incompatible"],
116117
)
117118

118119
bzl_library(

MODULE.bazel

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ module(
99

1010
# Lower-bounds (minimum) versions for direct runtime dependencies
1111
bazel_dep(name = "bazel_features", version = "1.9.0")
12-
bazel_dep(name = "bazel_skylib", version = "1.5.0")
12+
bazel_dep(name = "bazel_skylib", version = "1.8.1")
1313
bazel_dep(name = "platforms", version = "0.0.10")
14-
bazel_dep(name = "stardoc", version = "0.6.2")
14+
bazel_dep(name = "stardoc", version = "0.7.1")
1515
bazel_dep(name = "rules_shell", version = "0.4.1")
1616

1717
# TODO(3.0): remove this back-compat
@@ -56,11 +56,18 @@ bazel_dep(
5656
)
5757
bazel_dep(
5858
name = "rules_go",
59-
version = "0.51.0",
59+
version = "0.55.0",
6060
repo_name = "io_bazel_rules_go",
6161
# In released versions: dev_dependency = True
6262
)
6363

64+
go_sdk = use_extension(
65+
"@io_bazel_rules_go//go:extensions.bzl",
66+
"go_sdk",
67+
# In released versions: dev_dependency = True
68+
)
69+
go_sdk.from_file(go_mod = "//:go.mod")
70+
6471
go_deps = use_extension(
6572
"@gazelle//:extensions.bzl",
6673
"go_deps",

e2e/api_entries/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ local_path_override(
44
path = "../..",
55
)
66

7-
bazel_dep(name = "bazel_skylib", version = "1.7.1", dev_dependency = True)
7+
bazel_dep(name = "bazel_skylib", version = "1.8.1", dev_dependency = True)

e2e/copy_action/.bazelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import %workspace%/../../.aspect/bazelrc/performance.bazelrc
88

99
### YOUR PROJECT SPECIFIC OPTIONS GO HERE ###
1010

11+
# Point tools such as coursier (used in rules_jvm_external) to Bazel's downloaded JDK
12+
# suggested in https://github.com/bazelbuild/rules_jvm_external/issues/445
13+
common --repo_env=JAVA_HOME=../bazel_tools/jdk
14+
1115
# Load any settings & overrides specific to the current user from `.aspect/bazelrc/user.bazelrc`.
1216
# This file should appear in `.gitignore` so that settings are not shared with team members. This
1317
# should be last statement in this config so the user configuration is able to overwrite flags from

e2e/copy_action/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ local_path_override(
44
path = "../..",
55
)
66

7-
bazel_dep(name = "bazel_skylib", version = "1.7.1", dev_dependency = True)
7+
bazel_dep(name = "bazel_skylib", version = "1.8.1", dev_dependency = True)

e2e/copy_to_directory/.bazelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import %workspace%/../../.aspect/bazelrc/performance.bazelrc
88

99
### YOUR PROJECT SPECIFIC OPTIONS GO HERE ###
1010

11+
# Point tools such as coursier (used in rules_jvm_external) to Bazel's downloaded JDK
12+
# suggested in https://github.com/bazelbuild/rules_jvm_external/issues/445
13+
common --repo_env=JAVA_HOME=../bazel_tools/jdk
14+
1115
# Load any settings & overrides specific to the current user from `.aspect/bazelrc/user.bazelrc`.
1216
# This file should appear in `.gitignore` so that settings are not shared with team members. This
1317
# should be last statement in this config so the user configuration is able to overwrite flags from

0 commit comments

Comments
 (0)