all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#57317] [PATCH 0/2] Implicitly set GUIX_EXTENSIONS_PATH in profiles.
@ 2022-08-21 13:12 ( via Guix-patches via
  2022-08-21 13:16 ` [bug#57317] [PATCH 1/2] build: profiles: Always set GUIX_EXTENSIONS_PATH ( via Guix-patches via
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: ( via Guix-patches via @ 2022-08-21 13:12 UTC (permalink / raw)
  To: 57317; +Cc: (

Hi Guix!

This patchset allows Guix to automatically find extensions installed
in profiles. There's probably a more elegant way to do this, but this
is the simplest and easiest way I can think of.

( (2):
  build: profiles: Always set GUIX_EXTENSIONS_PATH.
  gnu: package-management: Remove mentions of GUIX_EXTENSIONS_PATH.

 gnu/packages/package-management.scm | 11 +----------
 guix/build/profiles.scm             |  4 ++++
 2 files changed, 5 insertions(+), 10 deletions(-)

-- 
2.37.2





^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#57317] [PATCH 1/2] build: profiles: Always set GUIX_EXTENSIONS_PATH.
  2022-08-21 13:12 [bug#57317] [PATCH 0/2] Implicitly set GUIX_EXTENSIONS_PATH in profiles ( via Guix-patches via
@ 2022-08-21 13:16 ` ( via Guix-patches via
  2022-08-21 13:16   ` [bug#57317] [PATCH 2/2] gnu: package-management: Remove mentions of GUIX_EXTENSIONS_PATH ( via Guix-patches via
  2022-08-21 15:43 ` [bug#57317] [PATCH v2 1/2] build: profiles: Implicitly set GUIX_EXTENSIONS_PATH ( via Guix-patches via
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: ( via Guix-patches via @ 2022-08-21 13:16 UTC (permalink / raw)
  To: 57317; +Cc: (

* guix/build/profiles.scm (build-etc/profile): Implicitly set
  GUIX_EXTENSIONS_PATH to ${GUIX_PROFILE}/share/guix/extensions.

This allows Guix to find extensions without any need for users to
set GUIX_EXTENSIONS_PATH manually.
---
 guix/build/profiles.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/guix/build/profiles.scm b/guix/build/profiles.scm
index 0c92f222b4..f8b2e72d9c 100644
--- a/guix/build/profiles.scm
+++ b/guix/build/profiles.scm
@@ -97,6 +97,10 @@ (define file
 # When GUIX_PROFILE is undefined, the various environment variables refer
 # to this specific profile generation.
 \n" port)
+      (format port "~a~%" (environment-variable-definition
+                           "GUIX_EXTENSIONS_PATH"
+                           (string-append output "/share/guix/extensions")
+                           #:kind 'prefix))
       (let ((variables (evaluate-search-paths search-paths
                                               (list output))))
         (for-each (write-environment-variable-definition port)
-- 
2.37.2





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#57317] [PATCH 2/2] gnu: package-management: Remove mentions of GUIX_EXTENSIONS_PATH.
  2022-08-21 13:16 ` [bug#57317] [PATCH 1/2] build: profiles: Always set GUIX_EXTENSIONS_PATH ( via Guix-patches via
@ 2022-08-21 13:16   ` ( via Guix-patches via
  0 siblings, 0 replies; 9+ messages in thread
From: ( via Guix-patches via @ 2022-08-21 13:16 UTC (permalink / raw)
  To: 57317; +Cc: (

* gnu/packages/package-management.scm (guix-modules)[description]:
  Remove instructions to set GUIX_EXTENSIONS_PATH.
---
 gnu/packages/package-management.scm | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 0469c73ff5..a4b0905b1b 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -726,16 +726,7 @@ (define-public guix-modules
 module} command.  The @command{guix module create} sub-command creates
 @dfn{environment modules}, allowing you to manipulate software environments
 with the @command{module} command commonly found on @acronym{HPC,
-high-performance computing} clusters.
-
-To use this extension, set the @env{GUIX_EXTENSIONS_PATH} environment
-variable, along these lines:
-
-@example
-export GUIX_EXTENSIONS_PATH=\"$HOME/.guix-profile/share/guix/extensions\"
-@end example
-
-Replace @code{$HOME/.guix-profile} with the appropriate profile.")
+high-performance computing} clusters.")
     (license license:gpl3+)))
 
 \f
-- 
2.37.2





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#57317] [PATCH v2 1/2] build: profiles: Implicitly set GUIX_EXTENSIONS_PATH.
  2022-08-21 13:12 [bug#57317] [PATCH 0/2] Implicitly set GUIX_EXTENSIONS_PATH in profiles ( via Guix-patches via
  2022-08-21 13:16 ` [bug#57317] [PATCH 1/2] build: profiles: Always set GUIX_EXTENSIONS_PATH ( via Guix-patches via
@ 2022-08-21 15:43 ` ( via Guix-patches via
  2022-08-21 15:43   ` [bug#57317] [PATCH v2 2/2] gnu: package-management: Remove mentions of GUIX_EXTENSIONS_PATH ( via Guix-patches via
  2022-08-21 19:38   ` [bug#57317] [PATCH v2 1/2] build: profiles: Implicitly set GUIX_EXTENSIONS_PATH Maxime Devos
  2022-08-21 19:41 ` [bug#57317] [PATCH 0/2] Implicitly set GUIX_EXTENSIONS_PATH in profiles Ricardo Wurmus
  2022-09-07  8:46 ` bug#57317: " Efraim Flashner
  3 siblings, 2 replies; 9+ messages in thread
From: ( via Guix-patches via @ 2022-08-21 15:43 UTC (permalink / raw)
  To: 57317; +Cc: (

* guix/build/profiles.scm (manifest-sexp->inputs+search-paths):
  Always return a search path for GUIX_EXTENSIONS_PATH.
* guix/search-paths.scm ($GUIX_EXTENSIONS_PATH): New variable.

This allows Guix to find extensions without any need for users to
set GUIX_EXTENSIONS_PATH manually.
---
 guix/build/profiles.scm |  7 ++++---
 guix/search-paths.scm   | 11 +++++++++++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/guix/build/profiles.scm b/guix/build/profiles.scm
index 0c92f222b4..b19d93f971 100644
--- a/guix/build/profiles.scm
+++ b/guix/build/profiles.scm
@@ -179,9 +179,10 @@ (define-syntax let-fields
          (()
           (values (reverse inputs)
                   (delete-duplicates
-                   (cons $PATH
-                         (map sexp->search-path-specification
-                              (reverse search-paths)))))))))))
+                   (cons* $PATH
+                          $GUIX_EXTENSIONS_PATH
+                          (map sexp->search-path-specification
+                               (reverse search-paths)))))))))))
 
 (define* (build-profile output manifest
                         #:key (extra-inputs '()) (symlink symlink))
diff --git a/guix/search-paths.scm b/guix/search-paths.scm
index 6b13a98946..5a0cddac8f 100644
--- a/guix/search-paths.scm
+++ b/guix/search-paths.scm
@@ -33,6 +33,7 @@ (define-module (guix search-paths)
             search-path-specification-file-pattern
 
             $PATH
+            $GUIX_EXTENSIONS_PATH
             $SSL_CERT_DIR
             $SSL_CERT_FILE
 
@@ -73,6 +74,16 @@ (define $PATH
    (variable "PATH")
    (files '("bin" "sbin"))))
 
+(define-public $GUIX_EXTENSIONS_PATH
+  ;; 'GUIX_EXTENSIONS_PATH' is used by Guix to locate extension commands.
+  ;; Like 'PATH', it's not attached to any package, so that users don't have
+  ;; to install the 'guix' package (which is not supposed to be installed,
+  ;; as it will mess up the 'guix pull' installation) or set the variable
+  ;; manually.
+  (search-path-specification
+   (variable "GUIX_EXTENSIONS_PATH")
+   (files '("share/guix/extensions"))))
+
 ;; Two variables for certificates (see (guix)X.509 Certificates),
 ;; respected by 'openssl', possibly GnuTLS in the future
 ;; (https://gitlab.com/gnutls/gnutls/-/merge_requests/1541)
-- 
2.37.2





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#57317] [PATCH v2 2/2] gnu: package-management: Remove mentions of GUIX_EXTENSIONS_PATH.
  2022-08-21 15:43 ` [bug#57317] [PATCH v2 1/2] build: profiles: Implicitly set GUIX_EXTENSIONS_PATH ( via Guix-patches via
@ 2022-08-21 15:43   ` ( via Guix-patches via
  2022-08-21 19:38   ` [bug#57317] [PATCH v2 1/2] build: profiles: Implicitly set GUIX_EXTENSIONS_PATH Maxime Devos
  1 sibling, 0 replies; 9+ messages in thread
From: ( via Guix-patches via @ 2022-08-21 15:43 UTC (permalink / raw)
  To: 57317; +Cc: (

* gnu/packages/package-management.scm (guix)[native-search-paths]:
  Remove GUIX_EXTENSIONS_PATH.
(guix-modules)[description]: Remove instructions to set
GUIX_EXTENSIONS_PATH.
---
 gnu/packages/package-management.scm | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 0469c73ff5..ec133a15dd 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -477,10 +477,7 @@ (define code
          ("guile-lzlib" ,guile-lzlib)
          ("guile-zstd" ,guile-zstd)))
       (native-search-paths
-       (list (search-path-specification
-              (variable "GUIX_EXTENSIONS_PATH")
-              (files '("share/guix/extensions")))
-             ;; (guix git) and (guix build download) honor this variable whose
+       (list ;; (guix git) and (guix build download) honor this variable whose
              ;; name comes from OpenSSL.
              $SSL_CERT_DIR))
       (home-page "https://www.gnu.org/software/guix/")
@@ -726,16 +723,7 @@ (define-public guix-modules
 module} command.  The @command{guix module create} sub-command creates
 @dfn{environment modules}, allowing you to manipulate software environments
 with the @command{module} command commonly found on @acronym{HPC,
-high-performance computing} clusters.
-
-To use this extension, set the @env{GUIX_EXTENSIONS_PATH} environment
-variable, along these lines:
-
-@example
-export GUIX_EXTENSIONS_PATH=\"$HOME/.guix-profile/share/guix/extensions\"
-@end example
-
-Replace @code{$HOME/.guix-profile} with the appropriate profile.")
+high-performance computing} clusters.")
     (license license:gpl3+)))
 
 \f
-- 
2.37.2





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#57317] [PATCH v2 1/2] build: profiles: Implicitly set GUIX_EXTENSIONS_PATH.
  2022-08-21 15:43 ` [bug#57317] [PATCH v2 1/2] build: profiles: Implicitly set GUIX_EXTENSIONS_PATH ( via Guix-patches via
  2022-08-21 15:43   ` [bug#57317] [PATCH v2 2/2] gnu: package-management: Remove mentions of GUIX_EXTENSIONS_PATH ( via Guix-patches via
@ 2022-08-21 19:38   ` Maxime Devos
  1 sibling, 0 replies; 9+ messages in thread
From: Maxime Devos @ 2022-08-21 19:38 UTC (permalink / raw)
  To: (, 57317


[-- Attachment #1.1.1: Type: text/plain, Size: 766 bytes --]

On 21-08-2022 17:43, ( via Guix-patches via wrote:

>   
> +(define-public $GUIX_EXTENSIONS_PATH
> +  ;; 'GUIX_EXTENSIONS_PATH' is used by Guix to locate extension commands.
> +  ;; Like 'PATH', it's not attached to any package, so that users don't have
> +  ;; to install the 'guix' package (which is not supposed to be installed,
> +  ;; as it will mess up the 'guix pull' installation) or set the variable
> +  ;; manually.
> +  (search-path-specification
> +   (variable "GUIX_EXTENSIONS_PATH")
> +   (files '("share/guix/extensions"))))

I have in the past proposed to add more implicit search paths 
(GUIX_LOCPATH, SSL_CERT_DIR and SSL_CERT_FILE), but that had been rejected.

v1 -> v2 1/2: looks a good change to me.

Greetings,
Maxime.


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#57317] [PATCH 0/2] Implicitly set GUIX_EXTENSIONS_PATH in profiles.
  2022-08-21 13:12 [bug#57317] [PATCH 0/2] Implicitly set GUIX_EXTENSIONS_PATH in profiles ( via Guix-patches via
  2022-08-21 13:16 ` [bug#57317] [PATCH 1/2] build: profiles: Always set GUIX_EXTENSIONS_PATH ( via Guix-patches via
  2022-08-21 15:43 ` [bug#57317] [PATCH v2 1/2] build: profiles: Implicitly set GUIX_EXTENSIONS_PATH ( via Guix-patches via
@ 2022-08-21 19:41 ` Ricardo Wurmus
  2022-08-22  9:20   ` Efraim Flashner
  2022-09-07  8:46 ` bug#57317: " Efraim Flashner
  3 siblings, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2022-08-21 19:41 UTC (permalink / raw)
  To: 57317; +Cc: GNU Guix maintainers

I agree with Maxime: this looks good, and I also think that other
variables could be set unconditionally.

Yes, it’s a little inelegant to set environment variables like this, but
for GUIX_EXTENSIONS_PATH I think it’s warranted, because Guix is special
anyway.

So +1 from me.

I’m CC’ing the maintainers to perhaps get a comment on the general
approach for the record.

-- 
Ricardo




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#57317] [PATCH 0/2] Implicitly set GUIX_EXTENSIONS_PATH in profiles.
  2022-08-21 19:41 ` [bug#57317] [PATCH 0/2] Implicitly set GUIX_EXTENSIONS_PATH in profiles Ricardo Wurmus
@ 2022-08-22  9:20   ` Efraim Flashner
  0 siblings, 0 replies; 9+ messages in thread
From: Efraim Flashner @ 2022-08-22  9:20 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 57317, GNU Guix maintainers

[-- Attachment #1: Type: text/plain, Size: 1581 bytes --]

On Sun, Aug 21, 2022 at 09:41:41PM +0200, Ricardo Wurmus wrote:
> I agree with Maxime: this looks good, and I also think that other
> variables could be set unconditionally.
> 
> Yes, it’s a little inelegant to set environment variables like this, but
> for GUIX_EXTENSIONS_PATH I think it’s warranted, because Guix is special
> anyway.
> 
> So +1 from me.
> 
> I’m CC’ing the maintainers to perhaps get a comment on the general
> approach for the record.
> 

Not with my maintainer hat on:

I tried to create an extension a while ago and it wasn't entirely clear
to me how to force loading extensions correctly when testing from a guix
environment.

By removing the notes about setting GUIX_EXTENSION_PATH to
~/.guix-profile/... we allow Guix to use actual search paths like we do
with other environment variables so we can use it with guix-home or
other alternate profiles, such as the OS config.


I took a minute to look at my extension; I had to set
GUIX_EXTENSION_PATH to an absolute location, not a relative one.

Normally we'd tell people they have to install a package to make use of
it's search paths, like reminding people to add python to their shell
invocation, not just python-pip. In this case we DON'T want people
installing the guix package, so we need to make the environment variable
available another way.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57317: [PATCH 0/2] Implicitly set GUIX_EXTENSIONS_PATH in profiles.
  2022-08-21 13:12 [bug#57317] [PATCH 0/2] Implicitly set GUIX_EXTENSIONS_PATH in profiles ( via Guix-patches via
                   ` (2 preceding siblings ...)
  2022-08-21 19:41 ` [bug#57317] [PATCH 0/2] Implicitly set GUIX_EXTENSIONS_PATH in profiles Ricardo Wurmus
@ 2022-09-07  8:46 ` Efraim Flashner
  3 siblings, 0 replies; 9+ messages in thread
From: Efraim Flashner @ 2022-09-07  8:46 UTC (permalink / raw)
  To: (; +Cc: 57317-done

[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]

On Sun, Aug 21, 2022 at 02:12:22PM +0100, ( via Guix-patches via wrote:
> Hi Guix!
> 
> This patchset allows Guix to automatically find extensions installed
> in profiles. There's probably a more elegant way to do this, but this
> is the simplest and easiest way I can think of.
> 
> ( (2):
>   build: profiles: Always set GUIX_EXTENSIONS_PATH.
>   gnu: package-management: Remove mentions of GUIX_EXTENSIONS_PATH.
> 
>  gnu/packages/package-management.scm | 11 +----------
>  guix/build/profiles.scm             |  4 ++++
>  2 files changed, 5 insertions(+), 10 deletions(-)
> 

I pushed the first patch from the second set to always set
GUIX_EXTENSIONS_PATH and the second patch from the first set, which only
modifies guix-modules but not the guix package itself. I'm pretty sure
that Guix still needs the search path for the extensions.

As a side note, should something be added to guix shell/environment  so
it finds the extensions too?

Thanks for the patches! Now it should be easier to add extensions.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-09-07  8:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-21 13:12 [bug#57317] [PATCH 0/2] Implicitly set GUIX_EXTENSIONS_PATH in profiles ( via Guix-patches via
2022-08-21 13:16 ` [bug#57317] [PATCH 1/2] build: profiles: Always set GUIX_EXTENSIONS_PATH ( via Guix-patches via
2022-08-21 13:16   ` [bug#57317] [PATCH 2/2] gnu: package-management: Remove mentions of GUIX_EXTENSIONS_PATH ( via Guix-patches via
2022-08-21 15:43 ` [bug#57317] [PATCH v2 1/2] build: profiles: Implicitly set GUIX_EXTENSIONS_PATH ( via Guix-patches via
2022-08-21 15:43   ` [bug#57317] [PATCH v2 2/2] gnu: package-management: Remove mentions of GUIX_EXTENSIONS_PATH ( via Guix-patches via
2022-08-21 19:38   ` [bug#57317] [PATCH v2 1/2] build: profiles: Implicitly set GUIX_EXTENSIONS_PATH Maxime Devos
2022-08-21 19:41 ` [bug#57317] [PATCH 0/2] Implicitly set GUIX_EXTENSIONS_PATH in profiles Ricardo Wurmus
2022-08-22  9:20   ` Efraim Flashner
2022-09-07  8:46 ` bug#57317: " Efraim Flashner

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.