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

Modern unix #2

Merged
merged 21 commits into from May 10, 2022
Merged

Modern unix #2

merged 21 commits into from May 10, 2022

Conversation

candrewlee14
Copy link
Owner

@candrewlee14 candrewlee14 commented May 4, 2022

PR for #1
This will resolve:

Pre-Requisites:

Packages

  • bat
  • exa
  • lsd
  • delta
  • dust
  • duf
  • broot
  • fd
  • rg
  • ag (* no web-linked distributed binaries)
  • fzf
  • mcfly
  • choose
  • jq
  • sd
  • cheat
  • tldr (* no web-linked distributed binaries, can be installed with npm)
  • bottom
  • glances (* no web-linked distributed binaries, can be installed with pip)
  • gtop (* no web-linked distributed binaries, can be installed with npm)
  • hyperfine
  • gping
  • procs
  • httpie (* no web-linked distributed binaries, can be installed with pip)
  • curlie
  • xh
  • zoxide
  • dog

@candrewlee14 candrewlee14 marked this pull request as draft May 4, 2022 20:58
@candrewlee14
Copy link
Owner Author

candrewlee14 commented May 7, 2022

broot (https://dystroy.org/broot/install/) has a tricky release format:

  • download link has linux and windows releases for only latest version
  • previous versions are zipped all together, not individually, on Github releases.

The options to handle this are:

  1. add feature to unzip release bundle and select individual extracted folder
  2. force latest download

I think forcing the latest download is probably my pick.
It's easy to implement and avoids wasting too much time on these one-off tricky cases.
There'd be an option added to the yaml file like force_latest: true, and the installation process would quit if the version argument is not the latest version.

Edit: Handled with force_latest option

@candrewlee14
Copy link
Owner Author

ag (https://github.com/ggreer/the_silver_searcher) is another tricky one. It doesn't really look like there are OS/Arch-specific downloads anywhere? Maybe I'm just not seeing them...

@candrewlee14
Copy link
Owner Author

candrewlee14 commented May 7, 2022

choose (https://github.com/theryangeary/choose/) distributes an uncompressed binary directly. I need a way to handle that.

Edit: solved with latest webman commit adding is_binary option.

@AndrusGerman
Copy link
Contributor

The Silver Searcher, @candrewlee14 maybe for these cases if you have to add a preparation label,
Something that allows you to run commands if some packages need to be compiled.

base_download_url: https://github.com/ggreer/the_silver_searcher/archive/refs/tags/2.2.0.tar.gz
requirement:
  - windows:
      - webman:mingw-ge # Example auto install webman package
  - linux:
      - system:gcc # Example alert please install external need package 

prepare_linux:
  - build step 1
  - build step 2
  - make
 
prepare_windows:
  - mingw-get install gcc
  - build step 2
  - make

@candrewlee14
Copy link
Owner Author

cheat has a strange format. On linux and darwin, it is a directly gzipped binary, but on Windows, it is a zipped folder that has a root dist folder that contains a cheat-windows-amd64.exe. Linux and darwin work correctly, and Windows installs but the binary link is cheat-windows-amd64 when it probably should be cheat.
I could probably add a bin_rename dictionary field that matches a regex and renames accordingly...any other ideas?

@candrewlee14
Copy link
Owner Author

candrewlee14 commented May 8, 2022

The Silver Searcher, @candrewlee14 maybe for these cases if you have to add a preparation label, Something that allows you to run commands if some packages need to be compiled.

base_download_url: https://github.com/ggreer/the_silver_searcher/archive/refs/tags/2.2.0.tar.gz
requirement:
  - windows:
      - webman:mingw-ge # Example auto install webman package
  - linux:
      - system:gcc # Example alert please install external need package 

prepare_linux:
  - build step 1
  - build step 2
  - make
 
prepare_windows:
  - mingw-get install gcc
  - build step 2
  - make

@AndrusGerman Hmm, that's an interesting idea.
For security reasons and simplicity, I'd prefer to not allow package recipes to run commands.
I think if a package doesn't distribute a binary for a specific arch & platform, webman should not attempt to build from source. I may revisit this later, but for now, it'll be better to focus on building recipes for already-distributed binaries.

@candrewlee14
Copy link
Owner Author

glances has no web-linked distributed binaries. It is easily installable with pip though. This is a similar situation as with ag.

Now the question is: do we support running commands to install binaries (with dependencies), OR do not support running arbitrary package installation commands.

For now, I'm going to choose the latter. I think for security and simplicity, it's better to just support packages with distributed binaries. This makes sure that exec() is not called for any package script. It also means that we can guarantee all the installed binaries are located inside the webmanDir (default: ~/.webman).

@candrewlee14 candrewlee14 reopened this May 10, 2022
@candrewlee14 candrewlee14 marked this pull request as ready for review May 10, 2022 05:05
@candrewlee14 candrewlee14 merged commit 38c056e into main May 10, 2022
@candrewlee14
Copy link
Owner Author

candrewlee14 commented May 10, 2022

The majority of the packages are added, and the ones that aren't had no binaries but are installable with language-specific package managers. They also have use cases that are filled by other packages here:

  • tldr: use cheat
  • httpie: use curlie or xh
  • glances & gtop: use bottom

Merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants