aquaproj / aqua

Declarative CLI Version manager written in Go. Support Lazy Install, Registry, and continuous update with Renovate. CLI version is switched seamlessly
https://aquaproj.github.io
878 stars 39 forks source link

[Bug Report] Install failed when release is executable file #683

Closed 4513ECHO closed 2 years ago

4513ECHO commented 2 years ago

aqua version

Please use the latest version.

$ aqua -v
aqua version 1.5.0 (9d1d73bb167f8cd791e7082852f75dedeb1d9b3d)

Environment

:warning: aqua doesn't support Windows.

linux (Ubuntu)

arm64 (Raspberry Pi)

Overview

Auqa failed when relase is single executable file. For example, I added antonmedv/fx to registry. Its release contains only executable files.

How to reproduce

aqua.yaml should be not partial but complete configuration. Please remove unneeded configuration to reproduce the issue.

# aqua.yaml
---
registries:
  - name: local
    type: local
    path: experimental.yaml

packages:
  - name: antonmedv/fx@22.0.10
    registry: local
# experimental.yaml
---
packages:
  # init: a
  - type: github_release
    repo_owner: antonmedv
    repo_name: fx
    asset: 'fx_{{.OS}}_{{.Arch}}'
    description: Terminal JSON viewer
    files:
      - name: fx
        src: 'fx_{{.OS}}_{{.Arch}}'
$ AQUA_CONFIG=./aqua.yaml aqua i --test
ERRO[0000] install the package                           aqua_version=1.5.0 error="check file_src is correct: exe_path isn't found: stat /home/hibiki/.local/share/aquaproj-aqua/pkgs/github_release/github.com/antonmedv/fx/22.0.10/fx_linux_arm64/fx_linux_arm64: no such file or directory" file_name=fx package_name=antonmedv/fx package_version=22.0.10 program=aqua registry=local
FATA[0000] aqua failed                                   aqua_version=1.5.0 error="it failed to install some packages" program=aqua

Debug Output

Please set the environment variable AQUA_LOG_LEVEL=debug and run aqua and tell us the debug output.

$ AQUA_CONFIG=./aqua.yaml AQUA_LOG_LEVEL=debug aqua i --test
DEBU[0000] install the proxy                             aqua_version=1.5.0 package_name=aqua-proxy package_version=v1.0.0 program=aqua registry=
DEBU[0000] check if aqua-proxy is already installed      aqua_version=1.5.0 package_name=aqua-proxy package_version=v1.0.0 program=aqua registry=
DEBU[0000] install the package                           aqua_version=1.5.0 package_name=antonmedv/fx package_version=22.0.10 program=aqua registry=local
DEBU[0000] check if the package is already installed     aqua_version=1.5.0 package_name=antonmedv/fx package_version=22.0.10 program=aqua registry=local
ERRO[0000] install the package                           aqua_version=1.5.0 error="check file_src is correct: exe_path isn't found: stat /home/hibiki/.local/share/aquaproj-aqua/pkgs/github_release/github.com/antonmedv/fx/22.0.10/fx_linux_arm64/fx_linux_arm64: no such file or directory" file_name=fx package_name=antonmedv/fx package_version=22.0.10 program=aqua registry=local
FATA[0000] aqua failed                                   aqua_version=1.5.0 error="it failed to install some packages" program=aqua

Expected Behaviour

Aqua should be success to install

Actual Behaviour

Aqua failed.

Important Factoids

I tried to remove files property, but it also failed.

References

suzuki-shunsuke commented 2 years ago

Thank you for you report.

antonmedv/fx has already been included in aqua-registry. https://github.com/aquaproj/aqua-registry/blob/v2.11.1/registry.yaml#L692-L706

And in macOS arm64, it works well.

$ aqua -v     
aqua version 1.5.0 (9d1d73bb167f8cd791e7082852f75dedeb1d9b3d)

aqua.yaml

registries:
- type: standard
  ref: v2.11.1
packages:
- name: antonmedv/fx@22.0.10

macOS arm64

$ aqua i
INFO[0000] download and unarchive the package            aqua_version=1.5.0 package_name=antonmedv/fx package_version=22.0.10 program=aqua registry=standard registry_ref=v2.11.1

$ fx --version
22.0.10
suzuki-shunsuke commented 2 years ago

In case of format is raw, you don't have to specify file's src.

suzuki-shunsuke commented 2 years ago

I tried to remove files property, but it also failed.

It is strange. 🤔

suzuki-shunsuke commented 2 years ago

I tried to reproduce the issue according to How to reproduce, but I can't reproduce it on macOS arm64. I'll try to reproduce on Linux ARM64 with lima.

suzuki-shunsuke commented 2 years ago

Hmm... I can't reproduce it on Linux ARM64.

suzuki-shunsuke commented 2 years ago

There are many packages whose format is raw in aqua-registry, but they work well.

$ git --no-pager grep -l "format: raw"
pkgs/99designs/aws-vault/registry.yaml
pkgs/FiloSottile/mkcert/registry.yaml
pkgs/TomWright/dasel/registry.yaml
pkgs/abiosoft/colima/registry.yaml
pkgs/alexellis/arkade/registry.yaml
pkgs/alexellis/k3sup/registry.yaml
pkgs/amacneil/dbmate/registry.yaml
pkgs/antonmedv/llama/registry.yaml
pkgs/argoproj-labs/argocd-image-updater/registry.yaml
pkgs/aws-containers/amazon-ecs-exec-checker/registry.yaml
pkgs/batchcorp/plumber/registry.yaml
pkgs/bcicen/ctop/registry.yaml
pkgs/bcicen/slackcat/registry.yaml
pkgs/benchkram/bob/registry.yaml
pkgs/brigadecore/brigade/registry.yaml
pkgs/bronze1man/yaml2json/registry.yaml
pkgs/cloudflare/cfssl/mkbundle/registry.yaml
pkgs/cloudflare/cfssl/registry.yaml
pkgs/cloudfoundry/bosh-cli/registry.yaml
pkgs/cloudposse/atmos/registry.yaml
pkgs/cnrancher/autok3s/registry.yaml
pkgs/codeclimate/test-reporter/registry.yaml
pkgs/codesenberg/bombardier/registry.yaml
pkgs/crossplane/crossplane/registry.yaml
pkgs/direnv/direnv/registry.yaml
pkgs/evilmartians/lefthook/registry.yaml
pkgs/fishi0x01/vsh/registry.yaml
pkgs/fission/fission/registry.yaml
pkgs/flosell/iam-policy-json-to-terraform/registry.yaml
pkgs/geofffranks/spruce/registry.yaml
pkgs/grafana/tanka/registry.yaml
pkgs/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/registry.yaml
pkgs/grpc-ecosystem/grpc-gateway/protoc-gen-openapiv2/registry.yaml
pkgs/gruntwork-io/kubergrunt/registry.yaml
pkgs/gsamokovarov/jump/registry.yaml
pkgs/haskell/ghcup-hs/registry.yaml
pkgs/hasura/graphql-engine/registry.yaml
pkgs/jsonnet-bundler/jsonnet-bundler/registry.yaml
pkgs/k0sproject/k0s/registry.yaml
pkgs/k0sproject/k0sctl/registry.yaml
pkgs/knative/client/registry.yaml
pkgs/kubernetes-sigs/cluster-api/registry.yaml
pkgs/kubernetes-sigs/kind/registry.yaml
pkgs/kubernetes/kompose/registry.yaml
pkgs/kubernetes/kubectl/registry.yaml
pkgs/liamg/extrude/registry.yaml
pkgs/liamg/gitjacker/registry.yaml
pkgs/liamg/memit/registry.yaml
pkgs/liamg/pax/registry.yaml
pkgs/liamg/scout/registry.yaml
pkgs/liamg/traitor/registry.yaml
pkgs/loft-sh/devspace/registry.yaml
pkgs/loft-sh/vcluster/registry.yaml
pkgs/marcosnils/bin/registry.yaml
pkgs/mozilla/sops/registry.yaml
pkgs/mvdan/gofumpt/registry.yaml
pkgs/mvdan/sh/registry.yaml
pkgs/nikochiko/autosaved/registry.yaml
pkgs/okteto/okteto/registry.yaml
pkgs/openfaas/faas-cli/registry.yaml
pkgs/operator-framework/operator-sdk/registry.yaml
pkgs/pglet/pglet/registry.yaml
pkgs/pivotal-cf/pivnet-cli/registry.yaml
pkgs/plexsystems/sinker/registry.yaml
pkgs/pressly/goose/registry.yaml
pkgs/rancher/k3d/registry.yaml
pkgs/rancher/kim/registry.yaml
pkgs/rancher/rke/registry.yaml
pkgs/roboll/helmfile/registry.yaml
pkgs/ryane/kfilt/registry.yaml
pkgs/sahilm/yamldiff/registry.yaml
pkgs/sbstp/kubie/registry.yaml
pkgs/scaleway/scaleway-cli/registry.yaml
pkgs/segmentio/chamber/registry.yaml
pkgs/siderolabs/conform/registry.yaml
pkgs/siderolabs/talos/registry.yaml
pkgs/siderolabs/theila/registry.yaml
pkgs/sigstore/cosign/registry.yaml
pkgs/sigstore/rekor/registry.yaml
pkgs/slok/sloth/registry.yaml
pkgs/snyk/driftctl/registry.yaml
pkgs/spinnaker/spin/registry.yaml
pkgs/sqshq/sampler/registry.yaml
pkgs/squat/kilo/registry.yaml
pkgs/stedolan/jq/registry.yaml
pkgs/stepchowfun/docuum/registry.yaml
pkgs/talos-systems/conform/registry.yaml
pkgs/talos-systems/talos/registry.yaml
pkgs/telepresenceio/telepresence/registry.yaml
pkgs/tmccombs/hcl2json/registry.yaml
pkgs/up9inc/mizu/registry.yaml
pkgs/uptrace/uptrace/registry.yaml
pkgs/vi/websocat/registry.yaml
pkgs/vmware-tanzu/carvel-imgpkg/registry.yaml
pkgs/vmware-tanzu/carvel-kapp/registry.yaml
pkgs/vmware-tanzu/carvel-kbld/registry.yaml
pkgs/vmware-tanzu/carvel-kwt/registry.yaml
pkgs/windvalley/gossh/registry.yaml
pkgs/zricethezav/gitleaks/registry.yaml
registry.yaml
4513ECHO commented 2 years ago

Oh, the registry already has fx. I didn't know. I removed directory which was installed fx, and aqua works well. It is invalid issue, Sorry.

suzuki-shunsuke commented 2 years ago

FYI, you can search packages with aqua g command. https://aquaproj.github.io/docs/tutorial-basics/search-packages

4513ECHO commented 2 years ago

Yes, I'll take it to heart to search standard registry before adding new package to local registry ;)