From unknown Tue Jun 17 20:09:53 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#68964] [PATCH] gnu: elixir: Remove wrap for mix. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 07 Feb 2024 06:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68964 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68964@debbugs.gnu.org Cc: Pierre-Henry =?UTF-8?Q?Fr=C3=B6hring?= , Liliana Marie Prikler , Andrew Tropin X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170728820922708 (code B ref -1); Wed, 07 Feb 2024 06:44:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Feb 2024 06:43:29 +0000 Received: from localhost ([127.0.0.1]:55607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXbeb-0005uB-0E for submit@debbugs.gnu.org; Wed, 07 Feb 2024 01:43:29 -0500 Received: from lists.gnu.org ([2001:470:142::17]:44006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXbeY-0005tw-Ne for submit@debbugs.gnu.org; Wed, 07 Feb 2024 01:43:27 -0500 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 1rXbeB-0007JU-On for guix-patches@gnu.org; Wed, 07 Feb 2024 01:43:04 -0500 Received: from out-189.mta1.migadu.com ([95.215.58.189]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXbe7-0004bd-RZ for guix-patches@gnu.org; Wed, 07 Feb 2024 01:43:01 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=key1; t=1707288175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=bcCLhOrE5ML3TOMN+I1i3AuiTyd3US3xutK4ExRnZGc=; b=TT8LG/Du9dFr24bSsSXq91Of6dXNDqTqgDSWY/ktSTEyz1hfGmkT5HQ5Ndh91yrcWa9n44 /1J3kO/I5QxdsFXD83aCvziWSPUZAuYRyPFHHz0WfvAXhXaRcgL2rwAxllwa5TXfUQuty1 rSoe6I9p3HNg4qL9S0TuF306TnXe0r4zfeOYM0VrQExqtxg73e7Ejs6MjI1RJkorCTosz6 K8VVNZQOfSwcb4O00oZF33q1pp16OZgO1ID2b/ApUrY8FPsE7lsf+cR+lCel1pIm26u2w2 kwSwFOm2x7+k9WLSte9Q6qQ9B9BaGbQOuxJUYIViIaR81ORyiPrjnECzt/aWpg== From: Andrew Tropin Date: Wed, 7 Feb 2024 09:39:22 +0300 Message-ID: <0be1b4f12499d6bf415b4c81971c21ad290cae07.1707287957.git.andrew@trop.in> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=95.215.58.189; envelope-from=andrew@trop.in; helo=out-189.mta1.migadu.com 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) * gnu/packages/elixir.scm (elixir)[#:phases]: Instead of wrapping mix into shell script, which sets environment variables, we patch mix itself and set environmnet variables via elixir code. Change-Id: Ia4643e18fe927491242a0541938b7570bd56fca1 --- gnu/packages/elixir.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gnu/packages/elixir.scm b/gnu/packages/elixir.scm index ef8c39d0d7..70a8fad5e8 100644 --- a/gnu/packages/elixir.scm +++ b/gnu/packages/elixir.scm @@ -101,7 +101,18 @@ (define-public elixir (add-after 'install 'wrap-programs (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) - (programs '("elixir" "elixirc" "iex" "mix"))) + (programs '("elixir" "elixirc" "iex"))) + ;; mix can be sourced as an elixir script by other elixir + ;; program, for example `iex -S mix`, so we should not wrap + ;; mix into shell script. + (substitute* (string-append out "/bin/mix") + (("Mix.start\\(\\)") "\ +~w[GUIX_ELIXIR_LIBS ERL_LIBS] +|> Enum.map(&System.get_env/1) +|> Enum.reject(&is_nil/1) +|> Enum.join(\":\") +|> case do \"\" -> :ok; erl_libs -> System.put_env(\"ERL_LIBS\", erl_libs) end +Mix.start()")) (for-each (lambda (program) (wrap-program (string-append out "/bin/" program) '("ERL_LIBS" prefix ("${GUIX_ELIXIR_LIBS}")))) base-commit: cce7a6d2d2b18f51d1fcab67b02a38c11d6f4f2d -- 2.41.0 From unknown Tue Jun 17 20:09:53 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#68964] [PATCH v2] gnu: elixir: Remove wrap for mix. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 07 Feb 2024 08:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68964 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68964@debbugs.gnu.org Cc: Pierre-Henry =?UTF-8?Q?Fr=C3=B6hring?= , Ivan Sokolov , Liliana Marie Prikler , Andrew Tropin X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170729375632756 (code B ref -1); Wed, 07 Feb 2024 08:16:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Feb 2024 08:15:56 +0000 Received: from localhost ([127.0.0.1]:55656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXd64-0008WF-Dd for submit@debbugs.gnu.org; Wed, 07 Feb 2024 03:15:56 -0500 Received: from lists.gnu.org ([2001:470:142::17]:52462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXd5z-0008Vk-Tr for submit@debbugs.gnu.org; Wed, 07 Feb 2024 03:15:54 -0500 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 1rXd5U-0006QU-GM for guix-patches@gnu.org; Wed, 07 Feb 2024 03:15:27 -0500 Received: from out-177.mta1.migadu.com ([95.215.58.177]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXd5P-0005M0-Ib for guix-patches@gnu.org; Wed, 07 Feb 2024 03:15:20 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=key1; t=1707293711; h=from:from: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; bh=TOEHrZDnPe7P0BYAMOFhyu/tgqUm4uvV6axckTLssLs=; b=e9q6/RHGuJr3xHFbbTpah3x+kMZqmj1gaauaB5SHTbC02umXC3/NfR5SrRZFvZGQRQQhXU OScyANmVicQUsziFCdlwOkz1UdbDvKRzhCfkibJxdb2ZPKLdLW027Y4lGlEy7g8IV+adFj kLt9V3w9NTMnXtH8W1TBYnnuwf6iFdoL68unZUVd5vuC6DNk/F8BM8RBs5Pz3O2UebK6uo msg2SB0yMseMBLiZExM1xw7bkEi7TfD2VEvbdqCJQUr/7tBX2in0AdJTd4qzVOGGJC1LlD xjnwwope+TxSdWJaODGWzy/fqrouWbvzBLrvmBI0hAD0SLZ/xifZhdOoA8bFSQ== From: Andrew Tropin Date: Wed, 7 Feb 2024 11:13:06 +0300 Message-ID: In-Reply-To: <0be1b4f12499d6bf415b4c81971c21ad290cae07.1707287957.git.andrew@trop.in> References: <0be1b4f12499d6bf415b4c81971c21ad290cae07.1707287957.git.andrew@trop.in> MIME-Version: 1.0 Content-Type: text/plain; charset=en_US.utf8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=95.215.58.177; envelope-from=andrew@trop.in; helo=out-177.mta1.migadu.com X-Spam_score_int: 3 X-Spam_score: 0.3 X-Spam_bar: / X-Spam_report: (0.3 / 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, MIME_CHARSET_FARAWAY=2.45, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) * gnu/packages/elixir.scm (elixir)[#:phases]: Instead of wrapping mix into shell script, which sets environment variables, we patch mix itself and set environmnet variables via elixir code. Change-Id: Ia4643e18fe927491242a0541938b7570bd56fca1 Co-authored-by: Ivan Sokolov Change-Id: I29d2c61299a8a54125f0e15190c526a860d501da --- Changes since v1: Added Ivan's copyright and co-authored-by. gnu/packages/elixir.scm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gnu/packages/elixir.scm b/gnu/packages/elixir.scm index ef8c39d0d7..2d11707711 100644 --- a/gnu/packages/elixir.scm +++ b/gnu/packages/elixir.scm @@ -7,6 +7,8 @@ ;;; Copyright © 2018 Nikita ;;; Copyright © 2021 Oskar Köök ;;; Copyright © 2021 Cees de Groot +;;; Copyright © 2024 Andrew Tropin +;;; Copyright © 2024 Ivan Sokolov ;;; ;;; This file is part of GNU Guix. ;;; @@ -101,7 +103,18 @@ (define-public elixir (add-after 'install 'wrap-programs (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) - (programs '("elixir" "elixirc" "iex" "mix"))) + (programs '("elixir" "elixirc" "iex"))) + ;; mix can be sourced as an elixir script by other elixir + ;; program, for example `iex -S mix`, so we should not wrap + ;; mix into shell script. + (substitute* (string-append out "/bin/mix") + (("Mix.start\\(\\)") "\ +~w[GUIX_ELIXIR_LIBS ERL_LIBS] +|> Enum.map(&System.get_env/1) +|> Enum.reject(&is_nil/1) +|> Enum.join(\":\") +|> case do \"\" -> :ok; erl_libs -> System.put_env(\"ERL_LIBS\", erl_libs) end +Mix.start()")) (for-each (lambda (program) (wrap-program (string-append out "/bin/" program) '("ERL_LIBS" prefix ("${GUIX_ELIXIR_LIBS}")))) base-commit: cce7a6d2d2b18f51d1fcab67b02a38c11d6f4f2d -- 2.41.0 From unknown Tue Jun 17 20:09:53 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#68964] [PATCH v2] gnu: elixir: Remove wrap for mix. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 07 Feb 2024 18:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68964 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Andrew Tropin , 68964@debbugs.gnu.org Cc: Pierre-Henry =?UTF-8?Q?Fr=C3=B6hring?= , Ivan Sokolov Received: via spool by 68964-submit@debbugs.gnu.org id=B68964.170733019720933 (code B ref 68964); Wed, 07 Feb 2024 18:24:02 +0000 Received: (at 68964) by debbugs.gnu.org; 7 Feb 2024 18:23:17 +0000 Received: from localhost ([127.0.0.1]:57892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXmZp-0005RZ-5q for submit@debbugs.gnu.org; Wed, 07 Feb 2024 13:23:17 -0500 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]:54501) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXmZm-0005R3-6c for 68964@debbugs.gnu.org; Wed, 07 Feb 2024 13:23:15 -0500 Received: by mail-ed1-x544.google.com with SMTP id 4fb4d7f45d1cf-56025fcaebaso1122800a12.0 for <68964@debbugs.gnu.org>; Wed, 07 Feb 2024 10:23:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707330174; x=1707934974; darn=debbugs.gnu.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=GloB/pbFl9T3LT1g/25nFhZKu+EdTjxjObIBsyH099w=; b=EKNsAS+zwI5f1wL2/M0gAHTEFrn6+RkNjaJ97D+gydhYRaAbNN4EILMtwq7jgMhxFT /mdWDZ+2TtzNZdn7L2IVdtut8zvzlc7+B/lsTo94tSUipdApl4hjwknr5/MzwA2drJLi MMPiB3CzNKMAVXF4admIMNSzgIgQSxLivCrMZLR5m8RLXJpaYNrvKg3DOEaLgiXbTd8A Zj22iK1EBdttIpoYv0z6sQ4mK2ARSu7DAcawHWT7WNrRNf3PrLqazNoa3y+LFEYZmd2u qJb3r7I8gKmnxN5vCscfmsA5t1IDO6TYW9bffQAdAlheeYVvvU9ABFqGX3HRw+lfZhdc n2jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707330174; x=1707934974; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=GloB/pbFl9T3LT1g/25nFhZKu+EdTjxjObIBsyH099w=; b=TJYhO8Vaj1O1UQslJwoFmwE2ljOHfGYX25Fu11fHmhYrpxlkgYipWc1P7ejVELiJxW CBCzEk6acXOe29cosejt2S3XBlmEcl9bq0au7HRZ/Y6d3kHoOsolKTEud0+4VL51uOux scnTdt23W7KsGqF/tUFYK9+YRyIx1Jyd1YiSUus6d6lYRJBm5+u+rQG4OtS7qhMJQ8uC Xb29K0h3JFVBPkTcdMV9CnjjGWSyxrEp9nE86GEO5ja49qBouzi1mpuiroAVocwdp7Ge cum9jomTQZS5NHOaL+F+boBFynCAlgaHydSU6vw/Jw6sWIK2CHcxhXMJFrzGDVmJJbQP WhnQ== X-Gm-Message-State: AOJu0YzamaQ0ztIBoVEkoV9kSz0HrcymtyleCqGW+iitOqbzDYI/f/Hn Xc3/jN/XvbFZZyZwqrMsKIQSPZuTwcNARLkYpmYQ2h0DJOjBK/3r X-Google-Smtp-Source: AGHT+IFcvBesk6CjrgOpBgwo5TPsLw9I3OA+QvRftOoKSrqdfAcBXDCrD+9uxUTzXrhQu3aevNLmHg== X-Received: by 2002:aa7:c6cd:0:b0:560:5f1e:f5b5 with SMTP id b13-20020aa7c6cd000000b005605f1ef5b5mr4141631eds.41.1707330173808; Wed, 07 Feb 2024 10:22:53 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVTBUbFNjf6vg9bJvngZju1efWMc8t8xubWd7r2fvJoq1n0vbtBZc/XT/azt/W7U2JeSCZQoXq9SxoanYaLSklUrNWdTCcMCA1PkdJEYIdovqxAJBs1lIF6Fib5 Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id g15-20020a056402090f00b00557aa8d72c9sm538484edz.25.2024.02.07.10.22.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 10:22:53 -0800 (PST) Message-ID: <21ba50dd6d81b48644fb4f1d0145b41e348dc7d0.camel@gmail.com> From: Liliana Marie Prikler Date: Wed, 07 Feb 2024 19:22:51 +0100 In-Reply-To: References: <0be1b4f12499d6bf415b4c81971c21ad290cae07.1707287957.git.andrew@trop.in> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 MIME-Version: 1.0 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Am Mittwoch, dem 07.02.2024 um 11:13 +0300 schrieb Andrew Tropin: > * gnu/packages/elixir.scm (elixir)[#:phases]: Instead of wrapping mix > into > shell script, which sets environment variables, we patch mix itself > and set > environmnet variables via elixir code. >=20 > Change-Id: Ia4643e18fe927491242a0541938b7570bd56fca1 >=20 > Co-authored-by: Ivan Sokolov > Change-Id: I29d2c61299a8a54125f0e15190c526a860d501da > --- > Changes since v1: Added Ivan's copyright and co-authored-by. >=20 > =C2=A0gnu/packages/elixir.scm | 15 ++++++++++++++- > =C2=A01 file changed, 14 insertions(+), 1 deletion(-) >=20 > diff --git a/gnu/packages/elixir.scm b/gnu/packages/elixir.scm > index ef8c39d0d7..2d11707711 100644 > --- a/gnu/packages/elixir.scm > +++ b/gnu/packages/elixir.scm > @@ -7,6 +7,8 @@ > =C2=A0;;; Copyright =C2=A9 2018 Nikita > =C2=A0;;; Copyright =C2=A9 2021 Oskar K=C3=B6=C3=B6k > =C2=A0;;; Copyright =C2=A9 2021 Cees de Groot > +;;; Copyright =C2=A9 2024 Andrew Tropin > +;;; Copyright =C2=A9 2024 Ivan Sokolov > =C2=A0;;; > =C2=A0;;; This file is part of GNU Guix. > =C2=A0;;; > @@ -101,7 +103,18 @@ (define-public elixir > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (add-after '= install 'wrap-programs > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = (lambda* (#:key inputs outputs #:allow-other-keys) > =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 (let* ((out (assoc-ref outputs "out")) > -=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 (programs '("elixir" "elix= irc" "iex" "mix"))) > +=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 (programs '("elixir" "elix= irc" "iex"))) > +=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 ;; mix can be sourced as an elixir script by other > elixir > +=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 ;; program, for example `iex -S mix`, so we should > not wrap > +=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 ;; mix into shell script. > +=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 (substitute* (string-append out "/bin/mix") > +=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 (("Mix.start\\(\\)") "\ > +~w[GUIX_ELIXIR_LIBS ERL_LIBS] > +|> Enum.map(&System.get_env/1) > +|> Enum.reject(&is_nil/1) > +|> Enum.join(\":\") > +|> case do \"\" -> :ok; erl_libs -> System.put_env(\"ERL_LIBS\", > erl_libs) end > +Mix.start()")) You might want to make a patch for that. I don't speak Elixir, but from what I understand, this LGTM. Cheers From unknown Tue Jun 17 20:09:53 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Andrew Tropin Subject: bug#68964: closed (Re: [PATCH v2] gnu: elixir: Remove wrap for mix.) Message-ID: References: <875xyz8fcv.fsf@trop.in> <0be1b4f12499d6bf415b4c81971c21ad290cae07.1707287957.git.andrew@trop.in> X-Gnu-PR-Message: they-closed 68964 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 68964@debbugs.gnu.org Date: Thu, 08 Feb 2024 09:40:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1707385202-24836-1" This is a multi-part message in MIME format... ------------=_1707385202-24836-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #68964: [PATCH] gnu: elixir: Remove wrap for mix. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 68964@debbugs.gnu.org. --=20 68964: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D68964 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1707385202-24836-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 68964-done) by debbugs.gnu.org; 8 Feb 2024 09:39:45 +0000 Received: from localhost ([127.0.0.1]:59154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rY0sj-0006Ru-8Q for submit@debbugs.gnu.org; Thu, 08 Feb 2024 04:39:45 -0500 Received: from out-170.mta0.migadu.com ([91.218.175.170]:59128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rY0sg-0006Rf-4x for 68964-done@debbugs.gnu.org; Thu, 08 Feb 2024 04:39:44 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=key1; t=1707385161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/pdvQcRT6NvWO1rBI6CXigrN2LpS9fF7AjKIkdRXKlM=; b=mnejQotk/QBowXdQ1ehZuiLmjbD5qEwbHBp29mw/PMZDGdz5HqtTkIOJSwHiQ4dqY1hjRw +FXYb30716Gt+bGAQCCNHJogVpeZuqweiM+glT7hI63GHmAzSsmc0zFroJjMVNghRJfil5 zdRGMr7c47/ADUm8nV0QuMF3D8Qmsw6cM/jxQEkfT35erLnQ6Zo66VAmGFvtXytVMDl29U kCT+nIegsF6++tXqR/5f/QeXCMVFg4rQRGvsP7vlGHvO3+K5O77F2Fc7u8AEM7jpdzKwtF Wj6kNM7zA9OheFksM9ND15S0oCDYdS3mr47S0y2LDjxt7EAt4NgOU3Mmdd8ztw== From: Andrew Tropin To: Liliana Marie Prikler , 68964-done@debbugs.gnu.org Subject: Re: [PATCH v2] gnu: elixir: Remove wrap for mix. In-Reply-To: <21ba50dd6d81b48644fb4f1d0145b41e348dc7d0.camel@gmail.com> References: <0be1b4f12499d6bf415b4c81971c21ad290cae07.1707287957.git.andrew@trop.in> <21ba50dd6d81b48644fb4f1d0145b41e348dc7d0.camel@gmail.com> Date: Thu, 08 Feb 2024 12:39:12 +0300 Message-ID: <875xyz8fcv.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 68964-done Cc: Pierre-Henry =?utf-8?Q?Fr=C3=B6hring?= , Ivan Sokolov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2024-02-07 19:22, Liliana Marie Prikler wrote: > Am Mittwoch, dem 07.02.2024 um 11:13 +0300 schrieb Andrew Tropin: >> * gnu/packages/elixir.scm (elixir)[#:phases]: Instead of wrapping mix >> into >> shell script, which sets environment variables, we patch mix itself >> and set >> environmnet variables via elixir code. >>=20 >> Change-Id: Ia4643e18fe927491242a0541938b7570bd56fca1 >>=20 >> Co-authored-by: Ivan Sokolov >> Change-Id: I29d2c61299a8a54125f0e15190c526a860d501da >> --- >> Changes since v1: Added Ivan's copyright and co-authored-by. >>=20 >> =C2=A0gnu/packages/elixir.scm | 15 ++++++++++++++- >> =C2=A01 file changed, 14 insertions(+), 1 deletion(-) >>=20 >> diff --git a/gnu/packages/elixir.scm b/gnu/packages/elixir.scm >> index ef8c39d0d7..2d11707711 100644 >> --- a/gnu/packages/elixir.scm >> +++ b/gnu/packages/elixir.scm >> @@ -7,6 +7,8 @@ >> =C2=A0;;; Copyright =C2=A9 2018 Nikita >> =C2=A0;;; Copyright =C2=A9 2021 Oskar K=C3=B6=C3=B6k >> =C2=A0;;; Copyright =C2=A9 2021 Cees de Groot >> +;;; Copyright =C2=A9 2024 Andrew Tropin >> +;;; Copyright =C2=A9 2024 Ivan Sokolov >> =C2=A0;;; >> =C2=A0;;; This file is part of GNU Guix. >> =C2=A0;;; >> @@ -101,7 +103,18 @@ (define-public elixir >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (add-after = 'install 'wrap-programs >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (lambda* (#:key inputs outputs #:allow-other-keys) >> =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 (let* ((out (assoc-ref outputs "out")) >> -=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 (programs '("elixir" "e= lixirc" "iex" "mix"))) >> +=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 (programs '("elixir" "e= lixirc" "iex"))) >> +=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 ;; mix can be sourced as an elixir script by other >> elixir >> +=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 ;; program, for example `iex -S mix`, so we should >> not wrap >> +=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 ;; mix into shell script. >> +=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 (substitute* (string-append out "/bin/mix") >> +=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 (("Mix.start\\(\\)") "\ >> +~w[GUIX_ELIXIR_LIBS ERL_LIBS] >> +|> Enum.map(&System.get_env/1) >> +|> Enum.reject(&is_nil/1) >> +|> Enum.join(\":\") >> +|> case do \"\" -> :ok; erl_libs -> System.put_env(\"ERL_LIBS\", >> erl_libs) end >> +Mix.start()")) > You might want to make a patch for that. I don't speak Elixir, but > from what I understand, this LGTM. Thank you for reply! Patch make sense for the consistency with similiar fixes for other applications, however, it is also reasonable to keep the logic of adding support for GUIX_ELIXIR_LIBS to all elixir binaries in one build phase. Both options seems viable to me, I'll stick with substitute solution for now. Applied and pushed as https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3Da903558577 =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmXEoUAACgkQIgjSCVjB 3rCjSA//U7CdHwbwHdyySp9R2OtEwGgYeMIwNCtYDiR4CdNOH+iWq9qC3MUcOUEv epNCFddatdR1AIdjIuPGdSuclyuBq6qI8hA84B5JsvTgqymTS7VexD9n1wbLdogg GTd6C2SAke59DtXYx+QnXOITV1oBZiXLHL+LzH9WYIYiGcfXVuNIjtWdbwnooY++ 3hMD8PCXUjXBJNrBZcPG+UPlb8/YVeFq8Wh9ihQ0Kg28ZbQ//NHM8oFFxdxwjYXP iNCpYsz5tRDZVc0QWROjyF6BdNoL0k9C3kc6BqEFgXXSp4nhgEVvLnY60C+5UC5f jClUZLqfoaZSg6PMEBGqMH2w+ME/ZYb6JSUmb9YNdgw+0YxxDT/7CJfyEFLDDcRR MZIWeNRlubJtOY3g9UQ2xjBLRBdGATR1Gwv55NT1vC6qceyPq2rv2X+JlztgBp16 s1YfD3hczg3bImj8p6sHNOIOWheXnsepF/YHGXXHBnH0rn/lfK46k4Oq5DsMgtOv 2eYzMI7GJYEUXiRNW1C9JJE+UFniOXNZLnRXL9LLjac3mR6QdBaomjXhRmmxrRCU N6OiGPzW8VVFAvcUQf3Em1jTPdI9pKTpHrN32S/gZ99ByET3hk7Zh1uG5M/7KapZ 9akiWOdLrFlXaog/5VBAL04+NxiI2S8+bJiqqqTYu4yYtLtq17I= =lnIs -----END PGP SIGNATURE----- --=-=-=-- ------------=_1707385202-24836-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 7 Feb 2024 06:43:29 +0000 Received: from localhost ([127.0.0.1]:55607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXbeb-0005uB-0E for submit@debbugs.gnu.org; Wed, 07 Feb 2024 01:43:29 -0500 Received: from lists.gnu.org ([2001:470:142::17]:44006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXbeY-0005tw-Ne for submit@debbugs.gnu.org; Wed, 07 Feb 2024 01:43:27 -0500 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 1rXbeB-0007JU-On for guix-patches@gnu.org; Wed, 07 Feb 2024 01:43:04 -0500 Received: from out-189.mta1.migadu.com ([95.215.58.189]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXbe7-0004bd-RZ for guix-patches@gnu.org; Wed, 07 Feb 2024 01:43:01 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=key1; t=1707288175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=bcCLhOrE5ML3TOMN+I1i3AuiTyd3US3xutK4ExRnZGc=; b=TT8LG/Du9dFr24bSsSXq91Of6dXNDqTqgDSWY/ktSTEyz1hfGmkT5HQ5Ndh91yrcWa9n44 /1J3kO/I5QxdsFXD83aCvziWSPUZAuYRyPFHHz0WfvAXhXaRcgL2rwAxllwa5TXfUQuty1 rSoe6I9p3HNg4qL9S0TuF306TnXe0r4zfeOYM0VrQExqtxg73e7Ejs6MjI1RJkorCTosz6 K8VVNZQOfSwcb4O00oZF33q1pp16OZgO1ID2b/ApUrY8FPsE7lsf+cR+lCel1pIm26u2w2 kwSwFOm2x7+k9WLSte9Q6qQ9B9BaGbQOuxJUYIViIaR81ORyiPrjnECzt/aWpg== From: Andrew Tropin To: guix-patches@gnu.org Subject: [PATCH] gnu: elixir: Remove wrap for mix. Date: Wed, 7 Feb 2024 09:39:22 +0300 Message-ID: <0be1b4f12499d6bf415b4c81971c21ad290cae07.1707287957.git.andrew@trop.in> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=95.215.58.189; envelope-from=andrew@trop.in; helo=out-189.mta1.migadu.com 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Pierre-Henry=20Fr=C3=B6hring?= , Liliana Marie Prikler , Andrew Tropin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) * gnu/packages/elixir.scm (elixir)[#:phases]: Instead of wrapping mix into shell script, which sets environment variables, we patch mix itself and set environmnet variables via elixir code. Change-Id: Ia4643e18fe927491242a0541938b7570bd56fca1 --- gnu/packages/elixir.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gnu/packages/elixir.scm b/gnu/packages/elixir.scm index ef8c39d0d7..70a8fad5e8 100644 --- a/gnu/packages/elixir.scm +++ b/gnu/packages/elixir.scm @@ -101,7 +101,18 @@ (define-public elixir (add-after 'install 'wrap-programs (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) - (programs '("elixir" "elixirc" "iex" "mix"))) + (programs '("elixir" "elixirc" "iex"))) + ;; mix can be sourced as an elixir script by other elixir + ;; program, for example `iex -S mix`, so we should not wrap + ;; mix into shell script. + (substitute* (string-append out "/bin/mix") + (("Mix.start\\(\\)") "\ +~w[GUIX_ELIXIR_LIBS ERL_LIBS] +|> Enum.map(&System.get_env/1) +|> Enum.reject(&is_nil/1) +|> Enum.join(\":\") +|> case do \"\" -> :ok; erl_libs -> System.put_env(\"ERL_LIBS\", erl_libs) end +Mix.start()")) (for-each (lambda (program) (wrap-program (string-append out "/bin/" program) '("ERL_LIBS" prefix ("${GUIX_ELIXIR_LIBS}")))) base-commit: cce7a6d2d2b18f51d1fcab67b02a38c11d6f4f2d -- 2.41.0 ------------=_1707385202-24836-1--