From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id ME1IA0UQMmTVcQEASxT56A (envelope-from ) for ; Sun, 09 Apr 2023 03:09:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id OHtOA0UQMmStJAAA9RJhRA (envelope-from ) for ; Sun, 09 Apr 2023 03:09:25 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id ADC19389E1 for ; Sun, 9 Apr 2023 03:09:24 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1plJXz-0000Sr-W8; Sat, 08 Apr 2023 21:08:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1plJXy-0000Sg-8I for guix-devel@gnu.org; Sat, 08 Apr 2023 21:08:46 -0400 Received: from forward204a.mail.yandex.net ([178.154.239.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1plJXu-0001JB-T2 for guix-devel@gnu.org; Sat, 08 Apr 2023 21:08:46 -0400 Received: from mail-nwsmtp-smtp-production-main-52.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-52.vla.yp-c.yandex.net [IPv6:2a02:6b8:c29:f088:0:640:a36f:0]) by forward204a.mail.yandex.net (Yandex) with ESMTP id 53B8846CF1 for ; Sun, 9 Apr 2023 04:08:36 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-52.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id Z8HjKdlWwa60-HQeiWAVo; Sun, 09 Apr 2023 04:08:36 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1681002516; bh=Ull5XwNtNscfmal9WQR9EhMsDVXHHx7YkNaVAHXRSt0=; h=Message-ID:Date:Subject:To:From; b=A5+VWQRaFMYvqx19dyb7Tv8bECuXXF3/FLKG/1rLVYOEH+tH/Hoslsjgv5BlDV/Sl Y/xLPiWd0XWDwTDJXynTVd+4mMASLTmzmSqk9XYAoMVTmrTvcIYzzLzz8H5MjrtKeh mv4/E7wB2OrY3jDkvevoVs6vyzc8pbbhztc6LCK8= From: Ivan Sokolov To: guix-devel@gnu.org Subject: Help wanted: search paths for Erlang and Elixir Date: Sun, 09 Apr 2023 04:08:28 +0300 Message-ID: <87y1n1n9pv.fsf@ya.ru> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=178.154.239.89; envelope-from=ivan-p-sokolov@ya.ru; helo=forward204a.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681002564; a=rsa-sha256; cv=none; b=ahQwtuLbvcX16+TXH0gUVRTXdTfzN2F01e5S0cOfr1v8pyfvh0OIQtp680AhrmJVXRGjp2 IhZLnB8eR94bUGMPjTQQxtro8TsH+nYmGkz4lJkt7f7O2a9voGfrCc0FC9+CfyZLlzKERQ cY20TDeiDfyR+u3dNv6mP9Kzz0zIwr/7InXju0A4yfGFPVQEHbwRDda7o8IuLuIUdbucxS nx3l4GPNmrqG6rhVo2OtfBxefAzzIKOHenmYUoO70GGm90vwjxtgYBqDpoos7QigxPwlmM MfHmc/e2oSDF9lvWw0XiZt2QlFMxjVM02q1om3ZvtjN7Brqg251WlxzrxbXd5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=ya.ru header.s=mail header.b=A5+VWQRa; dmarc=pass (policy=none) header.from=ya.ru; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681002564; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Ull5XwNtNscfmal9WQR9EhMsDVXHHx7YkNaVAHXRSt0=; b=bWU+QrDEVHq95adnecGfdvgbxhlbai7dpVXUPqp9h09GHvCiccx+gkRSo9RQnXY+Hg/6nK Xz73X2JBDpQLq3CRZjxhsWf1Z9Qj8rDST2uyw7k6Al2fOPFYsKzM5cN5vZISr/bC1juZSq x+yEyyUhNcvqCBhATIpO/ZUjqf68pTH13IfQHePPPoOnRqMifmtQYYuntxUSgEajxZTkIO 1I93vFukb73Yp8fI1xyrR6yfJeRAMXgNz03rd7ZSuVtGa7gggUPXQ0YpjXXd2nOfmEGg3S jizROwwaU47pe/0exNmo+CicjgOHsa1KZ164H8i6dE9rMqopSJf9IRhyyv44Xg== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=ya.ru header.s=mail header.b=A5+VWQRa; dmarc=pass (policy=none) header.from=ya.ru; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -9.98 X-Spam-Score: -9.98 X-Migadu-Queue-Id: ADC19389E1 X-TUID: 5iXJNdfdjxID 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