From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 2IiUKCFa9GbHawEAe85BDQ:P1 (envelope-from ) for ; Wed, 25 Sep 2024 18:44:49 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 2IiUKCFa9GbHawEAe85BDQ (envelope-from ) for ; Wed, 25 Sep 2024 20:44:49 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=O+r4WPP6; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=miP0Jnp9; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727289889; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=vVkHAj3qaA7s7dODk6x8P4mAS61+ljk/eiK9KYGaxlo=; b=u1DU+uInePTpt+H3KRQ3UQcw1ZS+aC/4XQyOXikTMey2R+fVBnBfqaNlkRewIwxXxQtfXB 7EWJFPn2N/PRUUCeQ3/0PhImseuz/NaXcy9l2IEaOJ8HHp6FQ4rUhzN/7afCAbo9M1TF4c +wHP25S8WDzxVtbV0TB4eEe1bXAiadINiv5Bwc3/PpSaCeXf1WigMbd0vvYFTKM9PVTosw wb0aMMAmFF5GMfwyArtk5oO8Kq8r5I2GMO9y10rS+NbFGyuTnnxj9kGD92FAAvnxYnk6jZ CQFFyQIwlugua7RiRgG49fLFeNUPn2pNn+xSxMJCgMg9SLNSOAKhRhkV3neTcA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=O+r4WPP6; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=miP0Jnp9; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727289889; a=rsa-sha256; cv=none; b=YYoI6e3U7ANb9ViURoG4QfdBeVMn/dTpErhfBxK34+7MtpLmqRoWtPX+R8xh0uuqMUeuQ4 RafmiWXhXX8a+nIiTQTQZ6rmD257PDg9UMQfwoJhZmYjPkV8DYGb+Va058oTAGD3Z1sj3v fgQ19RU99SXCgdOTyhgKxhXZbOuy9cFCa6V3TLP2vgccyumntixkhci6/INEAJ5WYgLPuM hPJc9w7NZDhNVgQ0/JS7+t27vn24f5fOv3OnhK2xtGYO5MEMuoOJAglLvPFIGnt2QSOzI8 GzSG+VqBhg83i7CIWJOEGV4VWoEWGigeeHKhTGfwcLmm/sehJtEY/fKNo6dF8A== 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 BFB937A120 for ; Wed, 25 Sep 2024 20:44:48 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stX0C-0001Nx-69; Wed, 25 Sep 2024 14:44:40 -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 1stX08-0001N5-OE for guix-patches@gnu.org; Wed, 25 Sep 2024 14:44:36 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1stX08-0003TO-Ev for guix-patches@gnu.org; Wed, 25 Sep 2024 14:44:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=vVkHAj3qaA7s7dODk6x8P4mAS61+ljk/eiK9KYGaxlo=; b=O+r4WPP6T6q6SiQz4zq6DlCHxwotrjqOMKFTCTxGT2U10hlGnw+kAwmOmWVQyWI4dbNLJ1tTUI266XtOIlWGCWNnK39zk5j4WM71f2zDwQu1zNbYaiX756T0TgiTfn4fdWELN4QEZVjDuR0VpWbJsrH4kNynTTLitZGAGMwB7e4fD8m4/hi4e7eI23Ai12ukkzp0gMrUateHnLs7qDLWLTE7EJ4b7D6vw0vmMm5ATl1j55u2WpR+uxdY+pP6ABttSCylObHZU+bzc5JFtJgEaQ9iOO/gE23HvXqPCtyRuBFLO4EY3wxw3MGvDwf2+RD8Xbu+M01lo3EMICftL27zZg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stX0Y-0000EY-Av for guix-patches@gnu.org; Wed, 25 Sep 2024 14:45:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73458] [PATCH 1/2] build-system: mix: Allow loading Erlang dependencies in Mix driven builds. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 25 Sep 2024 18:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73458 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Giacomo Leidi , 73458@debbugs.gnu.org Received: via spool by 73458-submit@debbugs.gnu.org id=B73458.1727289866829 (code B ref 73458); Wed, 25 Sep 2024 18:45:02 +0000 Received: (at 73458) by debbugs.gnu.org; 25 Sep 2024 18:44:26 +0000 Received: from localhost ([127.0.0.1]:48627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stWzy-0000DH-0R for submit@debbugs.gnu.org; Wed, 25 Sep 2024 14:44:26 -0400 Received: from mail-ej1-f66.google.com ([209.85.218.66]:48380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stWzt-0000Cx-P9 for 73458@debbugs.gnu.org; Wed, 25 Sep 2024 14:44:25 -0400 Received: by mail-ej1-f66.google.com with SMTP id a640c23a62f3a-a8a7b1c2f2bso29740766b.0 for <73458@debbugs.gnu.org>; Wed, 25 Sep 2024 11:43:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727289769; x=1727894569; darn=debbugs.gnu.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=vVkHAj3qaA7s7dODk6x8P4mAS61+ljk/eiK9KYGaxlo=; b=miP0Jnp9gNPA04iQt84cU006Ohvl+t2JBRSqBZ/1itDKbQSycegTq4ntxwzj3gs+D2 UDwJU8a71fzWbyXRRUSmTlnbRLfkp7NDQJiK9w41shyCpR6UthCiTnhhJy+SXqFtBEWR lr7DKZ56/AifA0IB5C55QRWHPEZrqMj4FiUltPeQ+yF2jNn73aQJZVW3wI5W4UTXfT8+ U7kB66X1MKYh9DFximh3V6u95KhEo3gYpZbT7656Us6r/ofIQM/C7YmV9KSK8j0tAgpa ORF5FAILeXj4DDGT3fu3kq/IFp23T2FAELgSVi61KUXJHyDxouBSbd0UzuiUUZDETTUU BT0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727289769; x=1727894569; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vVkHAj3qaA7s7dODk6x8P4mAS61+ljk/eiK9KYGaxlo=; b=pUau2MuMMos7xjo216IjO48aoN2xvgHpG2fIuc8+sIT+C5rtDyvEA/NIcCAGCdJxcB FGcB7BA9OAsojzqgSdYK5AULzQYlsTs/CMr+eqKEPuvMqJ3vFsvVIdhKPztumOZHRY9/ QzuwXzqBvLj32oYhjL7ia6OJhqcXoAvz8Y5Viavk6A6NNesO//C+17uAVGq6VKB4rvgK PSznhNGLE2YmqAS0iBYME2k1CUikCRAkGTfRt5c64Hn0Y4Y8JYRThaYUJvpKUVM7UTUm EUNBykKX9/5D4R/pkDciwOhlEcBdjpQRBzbRIh095nyrYe3jgPOA7iTpUH+srRk0iOQh OUSg== X-Forwarded-Encrypted: i=1; AJvYcCWX6UNrquR0WOUoID+jc6bTkxTgAdUllrkFw8ZjS3Q5gghZpMMdyqJdOfNj+fibfSIjvxQYRw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yx9KUatg6NfA/bJpFqY7r8WAbkAPdj5idYv/qGkyjsI6+GqPNxt 8QacBDWwhAVeBWFzFIGWHN0CLgLRbnLDCUke6ZRYkolzN3R0S46s X-Google-Smtp-Source: AGHT+IGHWnOaZjl6GboJ9ae/dhp5fezV/Fs/DQbBnHchGZ18n4O89FK5+vPaeAQ6320dZ1XvZFyDbA== X-Received: by 2002:a17:907:1c9a:b0:a8a:8c04:ce9f with SMTP id a640c23a62f3a-a93a05f20cemr338459566b.52.1727289769245; Wed, 25 Sep 2024 11:42:49 -0700 (PDT) Received: from lumine.fritz.box (85-127-114-32.dsl.dynamic.surfer.at. [85.127.114.32]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9392f34922sm241775866b.34.2024.09.25.11.42.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 11:42:48 -0700 (PDT) Message-ID: <6cf3afb19eb7e810b9b4c422c07246b99d15830f.camel@gmail.com> From: Liliana Marie Prikler Date: Wed, 25 Sep 2024 20:42:47 +0200 In-Reply-To: <58afb3593e28f5f670b2be516a165b59e2665276.1727252673.git.goodoldpaul@autistici.org> References: <58afb3593e28f5f670b2be516a165b59e2665276.1727252673.git.goodoldpaul@autistici.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.01 X-Spam-Score: -6.01 X-Migadu-Queue-Id: BFB937A120 X-Migadu-Scanner: mx10.migadu.com X-TUID: /LWv4ldC+Vbe Am Mittwoch, dem 25.09.2024 um 10:24 +0200 schrieb Giacomo Leidi: > Fixes Note: It's not official yet, but Fixes: is nice for a trailer.=20 If it fits into 80 columns, you can also do Fixes: [shortdoc] . > * guix/build/mix-build-system.scm (elixir-relative-libdir): New > variable; > (elixir-libdir): call elixir-relative-libdir; Use full sentences, end each with a period (dot). > (set-erl-env): this new phase sets ERL_LIBS to allow Erlang's virtual > machine to load Erlang dependencies in Mix builds, in addition to > Elixir > ones; > (%standard-phases): add set-erl-env phases. >=20 > Change-Id: Ic1ef5db20680bfd265fbac72bafb760d21135f68 > --- > =C2=A0guix/build/mix-build-system.scm | 20 +++++++++++++++++++- > =C2=A01 file changed, 19 insertions(+), 1 deletion(-) >=20 > diff --git a/guix/build/mix-build-system.scm b/guix/build/mix-build- > system.scm > index 0b021da791..41f6061444 100644 > --- a/guix/build/mix-build-system.scm > +++ b/guix/build/mix-build-system.scm > @@ -1,6 +1,7 @@ > =C2=A0;;; GNU Guix --- Functional package management for GNU > =C2=A0;;; Copyright =C2=A9 2023 Pierre-Henry Fr=C3=B6hring > =C2=A0;;; Copyright =C2=A9 2024 Igor Goryachev > +;;; Copyright =C2=A9 2024 Giacomo Leidi > =C2=A0;;; > =C2=A0;;; This file is part of GNU Guix. > =C2=A0;;; > @@ -39,10 +40,15 @@ (define-module (guix build mix-build-system) > =C2=A0;; minor version number of the Elixir used in the build. > =C2=A0(define %elixir-version (make-parameter "X.Y")) > =C2=A0 > +(define (elixir-relative-libdir version) > +=C2=A0 "Return the relative path inside a package namespace in the store > where all > +libraries for a specified Elixir VERSION are installed." > +=C2=A0 (string-append "lib/elixir/" version)) > + > =C2=A0(define* (elixir-libdir path #:optional (version (%elixir-version))= ) > =C2=A0=C2=A0 "Return the path where all libraries under PATH for a specif= ied > Elixir > =C2=A0VERSION are installed." > -=C2=A0 (string-append path "/lib/elixir/" version)) > +=C2=A0 (string-append path "/" (elixir-relative-libdir version))) Rather than having two procedures here, I think calling elixir-libdir on "lib/erlang/lib" does what you want. > =C2=A0(define* (strip-prefix name #:optional (prefix "elixir-")) > =C2=A0=C2=A0 "Return NAME without the prefix PREFIX." > @@ -94,6 +100,17 @@ (define* (set-mix-env #:key inputs mix-path mix- > exs #:allow-other-keys) > =C2=A0=C2=A0 (setenv "MIX_PATH" (or mix-path "")) > =C2=A0=C2=A0 (setenv "MIX_REBAR3" (string-append (assoc-ref inputs "rebar= 3") > "/bin/rebar3"))) > =C2=A0 > +(define* (set-erl-env #:key inputs #:allow-other-keys) > +=C2=A0 "Add dependencies in Elixir's load path." > +=C2=A0 (setenv "ERL_LIBS" > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (string-join (sea= rch-path-as-list > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `("lib/e= rlang/lib" > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 ,(elixir-relative-libdir (elixir-version > inputs))) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (map (ma= tch-lambda > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((label . package) package)) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 inputs)) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ":"))) > + > =C2=A0(define* (set-elixir-version #:key inputs #:allow-other-keys) > =C2=A0=C2=A0 "Store the version number of the Elixir input in a parameter= ." > =C2=A0=C2=A0 (%elixir-version (elixir-version inputs)) > @@ -152,6 +169,7 @@ (define %standard-phases > =C2=A0=C2=A0=C2=A0=C2=A0 (delete 'configure) > =C2=A0=C2=A0=C2=A0=C2=A0 (add-after 'install-locale 'set-mix-env set-mix-= env) > =C2=A0=C2=A0=C2=A0=C2=A0 (add-after 'set-mix-env 'set-elixir-version set-= elixir-version) > +=C2=A0=C2=A0=C2=A0 (add-after 'set-elixir-version 'set-erl-env set-erl-e= nv) I think we can reorder this so that set-elixir-version is called first and set-erl-env can be inlined into set-mix-env. Cheers