Getada Has Been Released

What is Getada?

I’ve been working on Getada.dev since around mid-2022 as an attempt to create something similar to rustup.rs – a simple copy-paste installer to get alire working on unix systems (currently mac and windows).

It’s a simple app written in Ada that downloads the latest version of alire via github, extracts it, and adds the binary’s directory to your path. You can specify where to put the config file (defaults to ~/.geta), binary (~/.getada/bin) and where it downloads alire (usually /tmp or whatever mktmp gives on MacOS). You can get other versions like 2.0.0 by passing e.g. --alire-version=2.0.0 or -a 2.0.0

If you like putting your bins in ~/bin but would rather keep the env file in the config dir, just pass --bin=~/bin.

You can run it with the -h option for full command line arguments, and I try to be thorough in the readme, but please don’t hesitate to ask any questions.

I had some really good feedback last time around on Matrix and Telegram, so thanks for those who did the testing already.

Getada also points new users to Ada in the right direction after installation, sending them to the ada-lang.io tutorial, and the uninstaller is easier to run, via getada --uninstall (you should just be able to run that since the getada will be in $PATH).

The command to install it is a simple one-liner that can be pasted into your linux or macos terminal:

curl --proto '=https' -sSf https://www.getada.dev/init.sh | sh

This is the same command currently listed on https://www.getada.dev and the source for the sh file and the installer itself is on github:

If you already installed alire via getada from a previous test, simply just run getada again. Once you do, it should correctly add itself to $PATH, and then you can run getada --uninstall to uninstall itself again.

Assuming everything looks good, I think it’s ready for release!

Please test on different (linux/mac but non-musl) systems if you can (VM if you don’t trust it-- I have it on all my computers for what it’s worth, but I haven’t tested every use case), thank you!

GetAda has been released!

P.S. On Mac it still only uses the x86_64 version of alr, and I hope this changes very soon, as alire should theoretically be releasing an apple silicon version since github actions can build it now.

Here’s the output of running getada on my debian server:

aj@scratch:~$ curl --proto '=https' -sSf https://www.getada.dev/init.sh | sh
info: downloading installer
Welcome to the unofficial Alire Installer ("GetAda") v1.0.0-rc!
Alire is the official Ada Package Manager. For more information
please visit https://ada-lang.io or https://alire.ada.dev
Copyright (C) 2022-2024 A.J. Ianozi licensed GPL3.

No version has been specified. Will attempt to install the latest version of Alire.
(To specify a version, pass --version=x.y.z)
Temporary files will be stored in a folder in: 
/tmp

(This can be changed with the "TMPDIR" environment variable or passing --tmp=/directory/here)

Any of alire's scripts or helper files will store in the following location:
/home/aj/.getada

(This can be changed either by setting the "GETADA_CFG" environment variable or passing --cfg=/directory/here)

Alire's binary will be installed as "alr" in the following location:
/home/aj/.getada/bin

(This can be changed either by setting the "GETADA_BIN" environment variable or passing --bin=/directory/here)

This path will be added to your local PATH variable by modifying the following files:
/home/aj/.profile
(This can be changed by passing --no-path)

You can revert everything that was done by re-running GetAda with the --uninstall option.

Continue with installation? [y/n]  (press "enter" with no input for interactive mode) >yes
Downloading https://github.com/alire-project/alire/releases/download/v2.0.1/alr-2.0.1-bin-x86_64-linux.zip to /tmp/tmp.K1P2RoYXIkXlrrrZ/alr-2.0.1-bin-x86_64-linux.zip
Creating Directory: /home/aj/.getada
Creating Directory: /home/aj/.getada/bin
Extracting: /tmp/tmp.K1P2RoYXIkXlrrrZ/alr-2.0.1-bin-x86_64-linux.zip to /home/aj/.getada/bin
Copying /tmp/tmp.sTw6B0Mnai/getada to /home/aj/.getada/bin/getada
Testing binary by running "/home/aj/.getada/bin/alr --version"
Unable to run binary... Attempting to troubleshoot.
Attempting "/bin/chmod +x /home/aj/.getada/bin/alr"
Testing binary by running "/home/aj/.getada/bin/alr --version"
alr 2.0.1
Sucessfully able to run binary.
Testing binary by running "/home/aj/.getada/bin/getada --version"
Unable to run binary... Attempting to troubleshoot.
Attempting "/bin/chmod +x /home/aj/.getada/bin/getada"
Testing binary by running "/home/aj/.getada/bin/getada --version"
getada 1.0.0-rc
Sucessfully able to run binary.
Adding '. "/home/aj/.getada/env.sh"' to /home/aj/.profile
/home/aj/.getada/bin not detected in Path.  You may need to reinitate your session.

Alire is now installed.  It can be called via "alr"

To uninstall alire, simply run:
"getada --uninstall"

To create a new ada project, simply run:
"alr init --bin new_project"
This will create a new ada in the folder "new_project"
To build an ada project, run "alr build"
Have a tutorial to start on your first project:
https://ada-lang.io/docs/learn/tutorial/hello-world

You may need to restart your shell.
Doing so should add "/home/aj/.getada/bin" to $PATH.
To configure your current shell without restarting, please run the following
command in your terminal (note the leading DOT):
. "/home/aj/.getada/env.sh"

aj@scratch:~$ . "/home/aj/.getada/env.sh" # I'm just typing this in so I can use it on my own shell.
aj@scratch:~$ alr --version
alr 2.0.1
aj@scratch:~$ getada -h
Welcome to the unofficial Alire Installer ("GetAda") v1.0.0-rc!
Alire is the official Ada Package Manager. For more information
please visit https://ada-lang.io or https://alire.ada.dev
Copyright (C) 2022-2024 A.J. Ianozi licensed GPL3.
Options: 
-h --help: Print this message and exit.
-v --version: Print the version of this binary and exit.
-p --no-path: Don't update path.
-n --non-interactive: Suppress prompts; answer with defaults.
-q --quiet: Be quiet (does not suppress propmts)
-t /directory --tmp=/directory: Location of tmp directory 
-c /directory --cfg=/directory: Set config directory 
-b /directory --bin=/directory: Set binary directory 
-a x.y.z --alire-version=x.y.z: Download version x.y.z of alire.
-u --uninstall: Uninstall Alire. This only works if Alire was
                installed with GetAda.  Works out of the box if
                default directory was used, otherwise you must
                pass --cfg= so the uninstaller can find the log.
You can also set the version and tmp/cfg/binary directories by 
setting the following environment variables:
 * "GETADA_ALIRE_VERSION" for Alire's version
 * "TMPDIR" for location of temp directory
 * "GETADA_CFG" for config directory
 * "GETADA_BIN" for binary directory
That's it for right now!
aj@scratch:~$ 

Uninstalling results in:

aj@scratch:~$ getada --uninstall
Welcome to the unofficial Alire Installer ("GetAda") v1.0.0-rc!
Alire is the official Ada Package Manager. For more information
please visit https://ada-lang.io or https://alire.ada.dev
Copyright (C) 2022-2024 A.J. Ianozi licensed GPL3.
The following will be preformed to uninstall Alire and Getada:
Remove line `. "/home/aj/.getada/env.sh"` from: /home/aj/.profile
Remove: /home/aj/.getada/env.sh
Remove: /home/aj/.getada/bin/alr
Remove: /home/aj/.getada/bin/getada
Remove: /home/aj/.getada/bin
Remove: /home/aj/.getada/log.dat
Remove: /home/aj/.getada
Do you wish to continue? [y/N]  >y
Copying getada from /home/aj/.getada/bin/getada to /tmp/tmp.zJxdaml2cLnMedwl/getada
getada 1.0.0-rc
Restarting Uninstaller.
aj@scratch:~$ Welcome to the unofficial Alire Installer ("GetAda") v1.0.0-rc!
Alire is the official Ada Package Manager. For more information
please visit https://ada-lang.io or https://alire.ada.dev
Copyright (C) 2022-2024 A.J. Ianozi licensed GPL3.
Uninstalling...
Removing line `. "/home/aj/.getada/env.sh"` from: /home/aj/.profile
Removing: /home/aj/.getada/env.sh
Removing: /home/aj/.getada/bin/alr
Removing: /home/aj/.getada/bin/getada
Removing: /home/aj/.getada/bin
Removing: /home/aj/.getada/log.dat
Removing: /home/aj/.getada
Alire has (hopefully) been uninstalled.
To reinstall, please visit https://www.getada.dev/
Please press any key to continue.

aj@scratch:~$ 
4 Likes

Getada 1.0.0 has been released!

3 Likes

Well done, it looks like there’s been a lot of good response to this.

The link for “Get started with Ada-lang.io’s tutorial” is broken, since there’s a double https://.

Nice catch! Just fixed it.

1 Like