Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to run commands #1899

Closed
iilyak opened this issue Apr 21, 2023 · 3 comments
Closed

Ability to run commands #1899

iilyak opened this issue Apr 21, 2023 · 3 comments
Labels
enhancement New feature or request reject

Comments

@iilyak
Copy link

iilyak commented Apr 21, 2023

Feature Overview

Add either of the following features

  • ability to install tools distributed in the source form
  • ability to use aquaproj to download/verify into specified folder

If this can be somehow achieved already extend documentation to cover this use case.

Why is the feature needed?

I wanted to use aqua to build a tool from source. In particular I am interesting in building lua. The main distribution method for lua is a source tarball. I hope I can use aquaproj to fetch and validate digest and then run a build script. However, apparently it is not possible.

As I can see there are at least few things missing to support this use case:

  1. ability to specify checksum value (lua web site doesn't provide a checksum file all values are included in the html page) in yaml
  2. ability to download regardless of missing executable
  3. ability to run series of build commands
  4. pre-flight hook to execute a check which verify that all build dependencies are installed and complaining otherwise

Does the feature include Breaking Changes?

It shouldn't

Example Code

---
# aqua Policy
# https://aquaproj.github.io/docs/tutorial-extras/policy-as-code
registries:
  - type: standard
    ref: semver(">= 3.0.0")
  - name: main
    type: local
    path: ./registry.yaml
packages:
  - registry: main
  - registry: standard

aqua-checksums.json

{
    "checksums": [
      {
        "id": "https://www.lua.org/ftp/lua-5.4.4.tar.gz",
        "checksum": "164c7849653b80ae67bec4b7473b884bf5cc8d2dca05653475ec2ed27b9ebf61",
        "algorithm": "sha256"
      }
    ]
}

registry.yaml

packages:
  - name: lua/lua
    type: http
    repo_owner: Lua.org
    repo_name: lua
    url: https://www.lua.org/ftp/lua-{{trimV .Version}}.tar.gz
    description: Lua is a lightweight, high-level, multi-paradigm programming language

aqua.yaml

---
# aqua - Declarative CLI Version Manager
# https://aquaproj.github.io/
registries:
  - type: standard
    ref: v3.40.0 # renovate: depName=aquaproj/aqua-registry
  - name: main
    type: local
    path: registry.yaml
packages:
  - name: lua/lua@5.4.4
    registry: main
./aqua install lua/lua
ERRO[0000] check file_src is correct                     aqua_version=2.3.6 env=linux/amd64 error="check file_src is correct: exe_path isn't found: stat /home/iilyak/.local/share/aquaproj-aqua/pkgs/http/www.lua.org/ftp/lua-5.4.4.tar.gz/lua: no such file or directory" file_name=lua package_name=lua/lua package_version=5.4.4 program=aqua registry=main
ERRO[0000] executable files aren't found
Files in the unarchived package (Only 30 files are shown):
lua-5.4.4/Makefile
lua-5.4.4/doc/contents.html
lua-5.4.4/doc/index.css
lua-5.4.4/doc/logo.gif
lua-5.4.4/doc/lua.1
lua-5.4.4/doc/lua.css
lua-5.4.4/doc/luac.1
lua-5.4.4/doc/manual.css
lua-5.4.4/doc/manual.html
lua-5.4.4/doc/osi-certified-72x60.png
lua-5.4.4/doc/readme.html
lua-5.4.4/src/Makefile
lua-5.4.4/src/lapi.c
lua-5.4.4/src/lapi.h
lua-5.4.4/src/lauxlib.c
lua-5.4.4/src/lauxlib.h
lua-5.4.4/src/lbaselib.c
lua-5.4.4/src/lcode.c
lua-5.4.4/src/lcode.h
lua-5.4.4/src/lcorolib.c
lua-5.4.4/src/lctype.c
lua-5.4.4/src/lctype.h
lua-5.4.4/src/ldblib.c
lua-5.4.4/src/ldebug.c
lua-5.4.4/src/ldebug.h
lua-5.4.4/src/ldo.c
lua-5.4.4/src/ldo.h
lua-5.4.4/src/ldump.c
lua-5.4.4/src/lfunc.c
lua-5.4.4/src/lfunc.h
   aqua_version=2.3.6 env=linux/amd64 package_name=lua/lua package_version=5.4.4 program=aqua registry=main
ERRO[0000] install the package                           aqua_version=2.3.6 env=linux/amd64 error="check file_src is correct" package_name=lua/lua package_version=5.4.4 program=aqua registry=main
FATA[0000] aqua failed                                   aqua_version=2.3.6 env=linux/amd64 error="it failed to install some packages" program=aqua
@suzuki-shunsuke suzuki-shunsuke added the enhancement New feature or request label Apr 21, 2023
@suzuki-shunsuke
Copy link
Member

Thank you for your proposal.

ability to install tools distributed in the source form

aqua doesn't support executing any external commands to install tools.
This is a design and we have no plan to change this.

https://aquaproj.github.io/docs/reference/restriction/#aqua-doesnt-support-running-any-external-commands-to-install-tools

@iilyak
Copy link
Author

iilyak commented Feb 20, 2024

If running commands is not an option would it be possible to support the rest of missing (for my use case) features.

  1. ability to specify checksum value via one of the available config files registry.yaml
  2. ability to download regardless of missing executable

@suzuki-shunsuke
Copy link
Member

@iilyak Could you create new discussions and describe more details?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request reject
Projects
None yet
Development

No branches or pull requests

2 participants