all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ivan Sokolov <ivan-p-sokolov@ya.ru>
To: guix-devel@gnu.org
Subject: Help wanted: search paths for Erlang and Elixir
Date: Sun, 09 Apr 2023 04:08:28 +0300	[thread overview]
Message-ID: <87y1n1n9pv.fsf@ya.ru> (raw)

Hello, Guixers!

Erlang/OTP has notion of applications [1], they are usually installed in
$PREFIX/lib/erlang/lib in the form of directories named APP-VERSION,
e.g. asn1-5.0.19.

In order for the Erlang runtime to find the installed application it
must appear in the load path.  If there is ERL_ROOTDIR in the
environment, erl(1) will search for application directories in
$ERL_ROOTDIR/lib and will add them to the load path.  ([2] mentions
$OTPROOT but it's probably an error in the documentation.)  The
following will do for Erlang:

(search-path-specification
  (variable "ERL_ROOTDIR")
  (files '("lib/erlang"))
  (separator #f))

However, Elixir usually installs its applications in
$PREFIX/lib/elixir/lib, and $ERL_ROOTDIR cannot contain a list.  Thus,
the environment variable ERL_LIBS [2] seems to be the most fitting way
to compose the load path for our purpose.

Is there a way to write a search-path-specification that will only yield
application directories?  I could not write such.  Listing
$PREFIX/lib/erlang/lib recursively is a bad option, because OTP
application can contain arbitrary resources.  And it will probably slow
down modules resolution.

Thanks in advance!

[1]: https://www.erlang.org/doc/man/application.html
[2]: https://www.erlang.org/doc/man/code.html#code-path


             reply	other threads:[~2023-04-09  1:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-09  1:08 Ivan Sokolov [this message]
2023-04-19 20:28 ` Help wanted: search paths for Erlang and Elixir Ivan Sokolov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y1n1n9pv.fsf@ya.ru \
    --to=ivan-p-sokolov@ya.ru \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.