bazel-contrib / bazel-contrib/rules_uv

feat: Enable Windows Support for `rules_uv`

Open
#273 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Starlark
Stars
29
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Currently, the rule set fails on Windows.

I was able to partially workaround this by wrapping the `pip_compile` into `sh_binary`. This resolves the issue of executing the shell script; however, another issue is the path, as `../` is not where rules_multitol is located. It's `../../external/rules_multitool`.

That certainly has to do with runfiles / rlocation.

I will add more details as I investigate this further.

Gazelle currently uses shell scripts as well and supports Windows.

Reference for inspiration on possible fixes and enhancements on the implementation: https://github.com/bazel-contrib/bazel-gazelle/blob/0990b28954080252c89369d7a27176aee7381ab5/def.bzl

Step 1 is most likely to wrap all shell executables into a `sh_binary` rule.

While creating a venv, the same runfiles issue occurs, but it also currently expects to source `$target/bin/activate`, whereas on Windows, it must be `$target/Scripts/activate`.

Contributor guide

Open the contributing guide

Research direction

Start with the rules_uv pip_compile and virtual-environment creation paths, then compare their shell executable and runfiles handling with the referenced Bazel Gazelle def.bzl implementation. Verify Windows execution, rules_multitool resolution through runfiles, and the Windows venv activation path under target/Scripts/activate.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, shell
Domain
build-system, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.