aspect-build / aspect-build/rules_aws
[Bug]: Cannot `bazel query 'deps(//...)'` when used on host without `/usr/sbin/pkgutil`
- Dominant language
- Starlark
- Stars
- 18
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
### What happened?
I used `"@aws_toolchains//:aws_cli_layer",` as a dep and can no longer run `bazel query 'deps(//...)'`
```
/bazel-user-root/output/external/aspect_rules_aws~/aws/repositories.bzl:61:9: An error occurred during the fetch of repository 'aspect_rules_aws~~aws~aws_darwin':
Traceback (most recent call last):
File ".../bazel-user-root/output/external/aspect_rules_aws~/aws/repositories.bzl", line 114, column 58, in _aws_repo_impl
(version_dir, target_tool_path) = _install_darwin(rctx, _release_info(rctx))
File ".../bazel-user-root/output/external/aspect_rules_aws~/aws/repositories.bzl", line 94, column 27, in _install_darwin
_cli_install_error(result)
File ".../bazel-user-root/output/external/aspect_rules_aws~/aws/repositories.bzl", line 61, column 9, in _cli_install_error
fail("aws CLI unpacking failed.\nSTDOUT: {}\nSTDERR: {}".format(result.stdout, result.stderr))
Error in fail: aws CLI unpacking failed.
STDOUT:
STDERR: src/main/tools/process-wrapper-legacy.cc:80: "execvp(/usr/sbin/pkgutil, ...)": No such file or directory
ERROR: Evaluation of query "deps(//...)" failed: preloading transitive closure failed: no such package '@@aspect_rules_aws~~aws~aws_darwin//installed': aws CLI unpacking failed.
STDOUT:
STDERR: src/main/tools/process-wrapper-legacy.cc:80: "execvp(/usr/sbin/pkgutil, ...)": No such file or directory
```
### Version
Development (host) and target OS/architectures: `Ubuntu 22.04`
Output of `bazel --version`: `7.6.0`
Version of the Aspect rules, or other relevant rules from your
`WORKSPACE` or `MODULE.bazel` file: `bazel_dep(name = "aspect_rules_aws", version = "0.6.1")`
Language(s) and/or frameworks involved: Using `"@aws_toolchains//:aws_cli_layer",`
### How to reproduce
```shell
bazel_dep(name = "aspect_rules_aws", version = "0.6.1")
aws = use_extension("@aspect_rules_aws//aws:extensions.bzl", "aws")
aws.toolchain(aws_cli_version = "2.13.0")
use_repo(aws, "aws", "aws_linux-x86_64", "aws_toolchains")
Using the
# Demonstrate that the CLI can be included in a container image
oci_image(
name = "image",
base = "@ubuntu",
entrypoint = ["/usr/local/aws-cli/aws"],
tars = ["@aws_toolchains//:aws_cli_layer"],
)
in https://github.com/aspect-build/rules_aws/blob/main/examples/cli/BUILD.bazel
```
### Any other information?
_No response_
Contributor guide
Research direction
Start with aws/repositories.bzl, especially _install_darwin and _cli_install_error, then reproduce the example from examples/cli/BUILD.bazel on Ubuntu 22.04 with Bazel 7.6.0. Done means bazel query 'deps(//...)' works on a host without /usr/sbin/pkgutil while the AWS CLI layer remains usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100