IDIOLIB

IDIOLIB is a simple colon-separated list of directories for Idio to look for library files in.

Non-absolute directories are ignored.

When idio starts it will modify any user-supplied IDIOLIB:

  1. by prepending the lib directory that corresponds with the actual executable being run

  2. if you used a virtualenv-style setup (where the idio found on your PATH is a symlink to a real executable) then idio will prepend the lib directory that corresponds with the virtualenv being used

In both cases, a .../lib will only be prepended if the executable/symlink name was .../bin/name, ie. the immediate directory name must be bin.

Suppose we’ve been saving our example files in /tmp and running them from there using $HOME/.local/bin/idio as the executable:

/tmp/print-IDIOLIB.idio
printf "IDIOLIB is %s\n" IDIOLIB
$ IDIOLIB=/tmp idio print-IDIOLIB
IDIOLIB is /home/idf/.local/lib/idio/0.3:/tmp

Let’s rearrange things into a virtualenv. We need to symlink idio:

$ mkdir -p /tmp/venv/bin
$ ln -s $HOME/.local/bin/idio /tmp/venv/bin

$ IDIOLIB=/tmp /tmp/venv/bin/idio print-IDIOLIB
WARNING: extend-IDIOLIB: /tmp/venv/lib/idio/0.3 is not accessible
IDIOLIB is /tmp/venv/lib/idio/0.3:/home/idf/.local/lib/idio/0.3:/tmp

Now that we have a venv we might as well put our example files in it and then not have to set IDIOLIB:

$ mkdir -p /tmp/venv/lib/idio/0.3
$ mv /tmp/print-IDIOLIB.idio /tmp/venv/lib/idio/0.3

$ /tmp/venv/bin/idio print-IDIOLIB
IDIOLIB is /tmp/venv/lib/idio/0.3:/home/idf/.local/lib/idio/0.3

The overall result is virtualenv libdir:executable libdir:user's IDIOLIB.

Last built at 2024-05-21T06:11:37Z+0000 from 77077af (dev) for Idio 0.3