aspect-build / aspect-build/rules_lint
[Bug]: Various issues running examples on windows
- Dominant language
- Starlark
- Stars
- 154
- Forks
- 125
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 20
Description
### What happened?
There are various issues when running the example repo on Windows. It would be nice to fix these and give a better starting experience.
### Various linters/formatters don't work:
- clang-tidy/clang-format don't have windows target preconfigured
- buf fails
- etc
### Issues due to lack of windows support in other bazel modules
- bash lint.sh --fix //src:hello_cc fails on windows due to missing node.bat:
```
FATAL: aspect_rules_js[js_binary]: node wrapper '/d/udu/b/l2x2bhay/execroot/_main/./external/aspect_rules_lint~/lint/private/patcher_node_bin/node.bat' not found
```
- bazel run //docs:update_10 fails:
```
Target //docs:update_10 failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: Analysis of target '//docs:update_10' failed; build aborted: Target //docs:update_10 is incompatible and cannot be built, but was explicitly requested.
Dependency chain:
//docs:update_10 (2bc110)
//docs:clang-tidy-docgen.md (2bc110)
//docs:clang-tidy (2bc110) <-- target platform (@@local_config_platform//:host) didn't satisfy constraint @@platforms//:incompatible
```
### Issues local to examples repo
- example/.bazeliskrc causes builds to fail as aspect-cli doesn't support windows. A workaround is to delete this file.
- example/.bazelversion causes builds to fail as bazelisk doesn't support ../ notation. A workaround is to copy the parent .bazelversion into examples.
- lint.sh only returns a single target result, see https://github.com/aspect-build/rules_lint/issues/178
- jq isn't installed by default on windows. This command grabs it: `curl -L -o jq.exe https://github.com/stedolan/jq/releases/latest/download/jq-win64.exe`
### Version
Development (host) and target OS/architectures:
Output of `bazel --version`:
7.1.1
Version of the Aspect rules, or other relevant rules from your
`WORKSPACE` or `MODULE.bazel` file:
rules_lint latest
Language(s) and/or frameworks involved:
all
### How to reproduce
```shell
Clone repo on windows
cd example
set BAZEL_SH=c:\msys64\usr\bin\bash.exe
get jq.exe
bazel test //...
```
### Any other information?
_No response_
Contributor guide
Research direction
Reproduce the failures from the Windows commands in the issue, starting with `bazel test //...` from the `example` directory. Inspect `example/.bazeliskrc`, `example/.bazelversion`, and `lint.sh`, then check the clang-tidy, buf, node.bat, docs:update_10, and jq failures. Done means the example workflows and listed linting, documentation, and test commands work on Windows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, node.js
- Domain
- build-system, operating-systems, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100