From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UEQWLfYwRmPT7QAAbAwnHQ (envelope-from ) for ; Wed, 12 Oct 2022 05:13:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id qCkfLfYwRmPxswAAauVa8A (envelope-from ) for ; Wed, 12 Oct 2022 05:13:58 +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 6F3443AFD5 for ; Wed, 12 Oct 2022 05:13:58 +0200 (CEST) Received: from localhost ([::1]:39854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiSBx-0003Rj-EP for larch@yhetil.org; Tue, 11 Oct 2022 23:13:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiSBk-0003Ra-Ii for help-guix@gnu.org; Tue, 11 Oct 2022 23:13:44 -0400 Received: from mx1.dismail.de ([78.46.223.134]:6024) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiSBi-0000a7-0j; Tue, 11 Oct 2022 23:13:44 -0400 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id d7f415e8; Wed, 12 Oct 2022 05:13:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=date :message-id:from:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s= 20190914; bh=LbjaJgBwLckVlgm0T9eGl2+z8n9fkifRihlHAOKdlfs=; b=mFJ 3qEoqTZcgXN9zS7GamUhIFwZoJCcB+EoXM9K50JjWw1C3plFt8vtX1BtO38GJVm8 XyVEdl0byVtxcDucoI4TDcmn4xQ62/rw4TdyGP0R1bPjPumP/j7VKrXVmJQ8d5Pt 1g8DVqyneDwzjRaXPQ11l5nIagnCkkfea3NVBTZCeyXSREkb6E+TjK/BInidzgC7 C7hjNrZsMOzfLF2xDRtQxAdDZb+f1N3xdsF5GpuPfY51pDwV85jMLxQ4dOQwY3zj k6ZGEHCCrgNfUpdK1tI67FqjWWSCkmefV5b83UfXv2jq+cNQZscLBfTY+013mZUd F7yRYudQsUDdfCRgglw== Received: from smtp2.dismail.de ( [10.240.26.12]) by mx1.dismail.de (OpenSMTPD) with ESMTP id eb564da0; Wed, 12 Oct 2022 05:13:35 +0200 (CEST) Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id 359a7680; Wed, 12 Oct 2022 05:13:35 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id f7a89d56 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 12 Oct 2022 05:13:34 +0200 (CEST) Date: Tue, 11 Oct 2022 22:13:31 -0500 Message-ID: <20221011221331.GB23996@dismail.de> From: jgart To: Hartmut Goebel Cc: Guix Help Subject: Re: Erlang Development with Guix In-Reply-To: References: <20220629202745.GC1909@gac> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=78.46.223.134; envelope-from=jgart@dismail.de; helo=mx1.dismail.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665544438; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=u8uXHJ1Tbqg/G35/v2IcWrMe0jXml7d3OeYpDuduKIg=; b=XRnNYiOTUctQX+iAMhaEGCW/Mrml6f0XaxIV3hSaub7++RsxrPu2xiz899xFG2aVMCjwrH wn9BL7W3hFJ9mywnLxz6U5UJlMLsFjxzdd14BJMFCg33STXW1ag3nJ7lp3VZ1IYqu9ARhr ehXDpLGMuOQ5k0pnOR9nW5kQAx+IZ9aZmHaqDbRwlEKw8JvaQHQJDsw5KaKfawo0XTmg9E +/eh0IxZw0K0rKs38kmw8cpr3oAfO4xkDwLT5uZt4KQ7EkweQs0+cFCH1LeguMEJ9jWA9e YHTP2uN1P6lMBOLAXIPDibJCT/HZYg0yoepclJn4V1oqhifw1Qk6WMA2r8Pm4A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665544438; a=rsa-sha256; cv=none; b=ZTPYPxfACTxg9GCwKWMiiZGSY+GFjMHdppdGSuAGULasszaQ6Yf3XUgRpCmyte/2wEJKF7 dth763RvFWvDygH+zvUMnFdi0oUes/OCGQfqX8OvwrfqbGlWOw3gq5BMH7R0Zbeo0vfoK/ ABqyi3nNbUBH0RBvT+uJbqZkRgdAdUBibzOA8BW9EZceTIZbCY9pH8tHjR/qudUfwDYOTK hKFzBqfvwnRq/8EQFXYnJKlsOdbXOtAXwqmgOdmnRtYqymQ3uh1gMzREcxcA06eXbtmjYG Z2ragreCpGbuZDN2wd1WZsSq/8iZBEAv0ujZi78ZydZFtnSdjkVL/w2x8B0yGw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=dismail.de header.s=20190914 header.b="mFJ 3qEo"; dmarc=pass (policy=reject) header.from=dismail.de; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.00 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=dismail.de header.s=20190914 header.b="mFJ 3qEo"; dmarc=pass (policy=reject) header.from=dismail.de; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 6F3443AFD5 X-Spam-Score: -5.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: XslmwWVI42J2 On Thu, 30 Jun 2022 11:00:03 +0200 Hartmut Goebel wrote: > The rebar-build-system I created was published just a few weeks ago. > Anyhow, I'm not a Erlang/OTP user, so this build-system might still need > improvement. Any help on this is welcome. Hi Hartmut, Good News! I found out what environment variable we need to set in order for Guix to find Erlang libraries: It's ERL_LIBS that needs to be set in order for Erlang to find installed libraries in /guix/store/.../lib/erlang/lib/ Here's an example of what Nix does: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/beam-modules/hex/default.nix#L21 I tested this with a guix shell and erlang-jsx: https://issues.guix.gnu.org/58458 All I did was enter an erlang repl (erl) and run the following code: λ guix shell -D guix --pure hint: Consider passing the `--check' option once to make sure your shell does not clobber environment variables. guix-shell ./pre-inst-env guix shell erlang erlang-jsx --search-paths --pure ;;; note: source file /home/jgart/7a41616f-b6b7-4643-898b-5771ddf02d32-guix/gnu/packages/python.scm ;;; newer than compiled /home/jgart/7a41616f-b6b7-4643-898b-5771ddf02d32-guix/gnu/packages/python.go ;;; note: source file /home/jgart/7a41616f-b6b7-4643-898b-5771ddf02d32-guix/gnu/packages/python.scm ;;; newer than compiled /home/jgart/.guix-profile/lib/guile/3.0/site-ccache/gnu/packages/python.go ;;; note: source file /home/jgart/7a41616f-b6b7-4643-898b-5771ddf02d32-guix/gnu/packages/erlang.scm ;;; newer than compiled /home/jgart/7a41616f-b6b7-4643-898b-5771ddf02d32-guix/gnu/packages/erlang.go ;;; note: source file /home/jgart/7a41616f-b6b7-4643-898b-5771ddf02d32-guix/gnu/packages/erlang.scm ;;; newer than compiled /home/jgart/.guix-profile/lib/guile/3.0/site-ccache/gnu/packages/erlang.go ;;; note: source file /home/jgart/7a41616f-b6b7-4643-898b-5771ddf02d32-guix/guix/build-system/rebar.scm ;;; newer than compiled /home/jgart/7a41616f-b6b7-4643-898b-5771ddf02d32-guix/guix/build-system/rebar.go ;;; note: source file /home/jgart/7a41616f-b6b7-4643-898b-5771ddf02d32-guix/guix/build-system/rebar.scm ;;; newer than compiled /home/jgart/.guix-profile/lib/guile/3.0/site-ccache/guix/build-system/rebar.go ;;; note: source file /home/jgart/7a41616f-b6b7-4643-898b-5771ddf02d32-guix/gnu/packages/entr.scm ;;; newer than compiled /home/jgart/7a41616f-b6b7-4643-898b-5771ddf02d32-guix/gnu/packages/entr.go ;;; note: source file /home/jgart/7a41616f-b6b7-4643-898b-5771ddf02d32-guix/gnu/packages/entr.scm ;;; newer than compiled /home/jgart/.guix-profile/lib/guile/3.0/site-ccache/gnu/packages/entr.go ;;; Ignore this. This was printed courtesy of the pk macro ;() ;;; (#) export PATH="/gnu/store/95i56pzs3g1hysaj32c8jzchw5n30fhz-profile/bin" export XDG_DATA_DIRS="/gnu/store/95i56pzs3g1hysaj32c8jzchw5n30fhz-profile/share" guix-shell ls /gnu/store/95i56pzs3g1hysaj32c8jzchw5n30fhz-profile/bin ct_run erl fc-cache fc-list fc-query freetype-config png-fix-itxt to_erl dialyzer erlc fc-cat fc-match fc-scan libpng-config pngfix typer epmd escript fc-conflist fc-pattern fc-validate libpng16-config run_erl xmlwf guix-shell erl bash: erl: command not found (reverse-i-search)`s': ./pre-inst-env guix shell erlang erlang-jsx --search-path^C--pure guix-shell export ERL_LIBS=/gnu/store/95i56pzs3g1hysaj32c8jzchw5n30fhz-profile/lib/erlang/lib guix-shell /gnu/store/95i56pzs3g1hysaj32c8jzchw5n30fhz-profile/bin/erl Erlang/OTP 25 [erts-13.0.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns] Eshell V13.0.4 (abort with ^G) 1> jsx:decode(<<"{\"library\": \"jsx\", \"awesome\": true}">>, []). #{<<"awesome">> => true,<<"library">> => <<"jsx">>} As you can see above we don't need to import anything into the repl because we just namespace with installed library in order to use it. I think this may be what erlangers normally do at the repl instead of importing. See the erlang-jsx README: https://github.com/talentdeficit/jsx#to-convert-a-utf8-binary-containing-a-json-string-into-an-erlang-term I'll try to find the time to add setting this environment variable to the rebar-build-system, otherwise if you'd like to proceed with adding it that is also fine by me :) all best, jgart