All notes tagged with asdf.

April 14, 2024

elixir asdf

Install Elixir with asdf

The following is what I use to setup Elixir on my machines, where I want to make sure that I can jump to all definitions of Elixir library functions.

First, I install asdf. I go the Homebrew and Fish route, but you can also do it from the source and use your shell of choice.

Before I install Erlang, I make sure to set the right flags, because I don’t want Java or build any GUI stuff:

KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac --without-wx"

After that, I go to the asdf-erlang repository, check that I have all the build requirements and install Erlang with:

asdf plugin add erlang

# check available Erlang versions
asdf list all erlang

# install the latest version
asdf install erlang 26.2.4

# enable it globally
asdf global erlang 26.2.4

Now, let’s install Elixir. Go to the asdf-elixir repository, make sure you have unzip installed, and do the following.

asdf plugin-add elixir

# check all available versions
asdf list all elixir

# install the latest version, but! Install by source, so we can jump to the definition of Elixir functions
asdf install elixir ref:v1.16.2

# enable elixir globally
asdf global elixir ref:v1.16.2

Now, it says it in the comments, but the important difference is that I install Elixir by reference instead of the pre-compiled versions because I also like to be able to jump to definitions of Elixir library functions.

May 10, 2022

lisp asdf

Switch the current working directory in the REPL

If you start a REPL in the wrong directory, you can switch it by using UIOP.

UIOP is the portability layer of ASDF, supplying an abstraction on top of different implementations or OS’es.

For example, to change to a new project do:

(uiop:chdir "~/lisp/fangorn/")

Make your own packages available to Quicklisp

In Lisp it’s quite common to have your own helper libraries, which are packaged as ASDF packages. To be able to use your libraries in other projects, you need to let ASDF know how to find them.

First create the directory ~/.config/common-lisp/source-registry.conf.d/

There create a file with any name of your choice but with the type conf, for instance 50-petar-lisp.conf.

In this file, add the following line to tell ASDF to recursively scan all the subdirectories under /home/petar/lisp/ for .asd files: (:tree "/home/petar/lisp/").