From: Mathieu Othacehe <m.othacehe@gmail.com>
To: 41734@debbugs.gnu.org
Cc: Mathieu Othacehe <othacehe@gnu.org>
Subject: [bug#41734] [PATCH] gnu: sudo: Separate Python output.
Date: Sat, 6 Jun 2020 11:00:14 +0200 [thread overview]
Message-ID: <20200606090014.12578-1-othacehe@gnu.org> (raw)
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
next reply other threads:[~2020-06-06 9:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-06 9:00 Mathieu Othacehe [this message]
2020-06-06 9:20 ` [bug#41734] [PATCH] gnu: sudo: Separate Python output Tobias Geerinckx-Rice via Guix-patches via
2020-06-08 8:56 ` bug#41734: " Mathieu Othacehe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200606090014.12578-1-othacehe@gnu.org \
--to=m.othacehe@gmail.com \
--cc=41734@debbugs.gnu.org \
--cc=othacehe@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.