Skip to content

[Bug]: Cannot bazel query 'deps(//...)' when used on host without /usr/sbin/pkgutil #117

@jtszalay

Description

@jtszalay

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions