aspect-build / aspect-build/rules_lint
[Bug]: Failure to run bazel lint in NixOS
- Dominant language
- Starlark
- Stars
- 154
- Forks
- 125
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 20
Description
### What happened?
Running `bazel lint ` fails in NixOS.
The reason is most likely due to non-hermetic implementation of some rule that makes use of `coreutils` from the system. I was able to track the problem down to [js/private/js_binary.sh.tpl](https://github.com/aspect-build/rules_js/blob/main/js/private/js_binary.sh.tpl)
### Version
Development (host) and target OS/architectures: NixOS 24.11
Output of `bazel --version`: 8.2.1
Version of the Aspect rules, or other relevant rules from your
`WORKSPACE` or `MODULE.bazel` file: "aspect_rules_lint", version = "1.4.2"
Language(s) and/or frameworks involved:
### How to reproduce
```shell
bazelisk lint standalone/...
INFO: Analyzed 26 targets (167 packages loaded, 38299 targets configured).
ERROR: /home/user/Documents/cpp-knowledge/CppStarterTemplate/standalone/BUILD.bazel:19:10: Linting //standalone:hello-world with clang-tidy failed: (Exit 127): patcher.sh failed: error executing AspectRulesLintClangTidy command (from target //standalone:hello-world) bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/aspect_rules_lint+/lint/private/patcher.sh bazel-out/k8-fastbuild/bin/standalone/_hello-world.patch_cfg
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/aspect_rules_lint+/lint/private/patcher.sh: line 34: mktemp: command not found
Aspect //bzl/lint:linters.bzl%clang_tidy of //standalone:hello-world failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 5.900s, Critical Path: 2.60s
INFO: 2 processes: 21 action cache hit, 2 internal.
ERROR: Build did NOT complete successfully
```
### Any other information?
_No response_
Contributor guide
Research direction
Reproduce the failure with `bazelisk lint standalone/...` on NixOS and inspect `js/private/js_binary.sh.tpl` together with the reported `patcher.sh` line 34. Trace why `mktemp` is unavailable in the sandbox; done means the lint action runs successfully without depending on undeclared system coreutils.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nixos, shell
- Domain
- build-system, operating-systems, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100