Skip to content

Commit 5691f04

Browse files
authored
uv/host: Strip stdout of sw_vers on MacOS (#719)
The output of `sw_vers` on various MacOS versions (in my case 26.1) can include a newline at the end, which causes: ``` ERROR: /private/var/tmp/_bazel_zsol/63b99ba49019d270ca10253bff172211/external/aspect_rules_py+/uv/private/constraints/platform/BUILD.bazel:81:9: in _platform_version_at_least rule @@aspect_rules_py+//uv/private/constraints/platform:_is_macos_at_least_10_13_flag: Traceback (most recent call last): File "/private/var/tmp/_bazel_zsol/63b99ba49019d270ca10253bff172211/external/aspect_rules_py+/uv/private/constraints/platform/defs.bzl", line 62, column 12, in _platform_version_at_least_impl int(x) Error in int: invalid base-10 literal: "1\n" ``` This PR avoids the error by calling `strip()` on the result of `sw_vers -productVersion`. --- ### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes Fixed an issue with using the experimental uv rules on MacOS 26.1 ### Test plan - Covered by existing test cases
1 parent 951011b commit 5691f04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

uv/private/host/repository.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _platform(rctx):
2424

2525
if os == "osx":
2626
res = rctx.execute(["sw_vers", "-productVersion"])
27-
ver = res.stdout.split(".")
27+
ver = res.stdout.strip().split(".")
2828
return "libsystem", "{}.{}".format(ver[0], ver[1])
2929

3030
elif os == "linux":

0 commit comments

Comments
 (0)