unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#41734] [PATCH] gnu: sudo: Separate Python output.
@ 2020-06-06  9:00 Mathieu Othacehe
  2020-06-06  9:20 ` Tobias Geerinckx-Rice via Guix-patches via
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Othacehe @ 2020-06-06  9:00 UTC (permalink / raw)
  To: 41734; +Cc: Mathieu Othacehe

The Python plugin of "sudo" drag the Python interpreter to the closure of
Guix System. Put it in a separate output.

* gnu/packages/admin.scm (sudo)[arguments]: Add a 'separate-python-output
phase.
---
Hello,

Here's a patch to remove Python from the Guix Sytem closure. As Python
cross-compilation is broken, the "python" output cannot be populated when
cross-compiling. This is not great. An alternative would be not to provide
"python" output when cross-compiling but that requires to turn "output" into a
thunk field, and I been advised not to do that (for performance reasons) in
the past.

WDYT?

Thanks,

Mathieu

 gnu/packages/admin.scm | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 77981e520a..9d9d70c88d 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1375,6 +1375,7 @@ system administrator.")
                   (delete-file-recursively "lib/zlib")
                   #t))))
     (build-system gnu-build-system)
+    (outputs (list "out" "python"))
     (arguments
      `(#:configure-flags
        (list (string-append "--docdir=" (assoc-ref %outputs "out")
@@ -1432,7 +1433,23 @@ system administrator.")
              (substitute* "plugins/sudoers/Makefile.in"
                (("^pre-install:" match)
                 (string-append match "\ndisabled-" match)))
-             #t)))
+             #t))
+         (add-after 'install 'separate-python-output
+           (lambda* (#:key target outputs #:allow-other-keys)
+             (let ((out        (assoc-ref outputs "out"))
+                   (out:python (assoc-ref outputs "python")))
+               ;; Python cross-compilation is not working.
+               (if target
+                   (mkdir-p (string-append out:python "/empty"))
+                   (for-each
+                    (lambda (file)
+                      (let ((old (string-append out "/" file))
+                            (new (string-append out:python "/" file)))
+                        (mkdir-p (dirname new))
+                        (rename-file old new)))
+                    (list "libexec/sudo/python_plugin.so"
+                          "libexec/sudo/python_plugin.la")))
+               #t))))
 
        ;; XXX: The 'testsudoers' test series expects user 'root' to exist, but
        ;; the chroot's /etc/passwd doesn't have it.  Turn off the tests.
-- 
2.26.2





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

* [bug#41734] [PATCH] gnu: sudo: Separate Python output.
  2020-06-06  9:00 [bug#41734] [PATCH] gnu: sudo: Separate Python output Mathieu Othacehe
@ 2020-06-06  9:20 ` Tobias Geerinckx-Rice via Guix-patches via
  2020-06-08  8:56   ` bug#41734: " Mathieu Othacehe
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2020-06-06  9:20 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 41734

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

Mathieu,

Mathieu Othacehe 写道:
> * gnu/packages/admin.scm (sudo)[arguments]: Add a 
> 'separate-python-output
> phase.

Missing [outputs] entry.

> WDYT?

I like it!  In fact I suggest dropping the cross-compilation 
comment.  IMO this doesn't need to be reverted or reconsidered 
even when that's fixed.

Thanks,

T G-R

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

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

* bug#41734: [PATCH] gnu: sudo: Separate Python output.
  2020-06-06  9:20 ` Tobias Geerinckx-Rice via Guix-patches via
@ 2020-06-08  8:56   ` Mathieu Othacehe
  0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Othacehe @ 2020-06-08  8:56 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 41734-done


Hey Tobias,

> I like it!  In fact I suggest dropping the cross-compilation comment.  IMO
> this doesn't need to be reverted or reconsidered even when that's fixed.

Fixed and pushed, thanks for having a look!

Mathieu




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

end of thread, other threads:[~2020-06-08  8:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-06  9:00 [bug#41734] [PATCH] gnu: sudo: Separate Python output Mathieu Othacehe
2020-06-06  9:20 ` Tobias Geerinckx-Rice via Guix-patches via
2020-06-08  8:56   ` bug#41734: " Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).