all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Simon Streit <simon@netpanic.org>
To: 52976@debbugs.gnu.org
Subject: bug#52976: Some tools in Samba fail to find modules, and a missing dependency
Date: Mon, 03 Jan 2022 14:07:04 +0100	[thread overview]
Message-ID: <yguk0fh7ytj.fsf@netpanic.org> (raw)

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

While experimenting with Samba, I noticed that some tools, especially
samba-tools will not run, and crash:
--8<---------------cut here---------------start------------->8---
root@motor ~# samba-tool
Traceback (most recent call last):
  File "/run/current-system/profile/bin/samba-tool", line 33, in <module>
    from samba.netcmd.main import cmd_sambatool
  File "/gnu/store/78baaab8085rd5xnfrpdkxdf07zkmin9-samba-mod-4.13.14/lib/python3.9/site-packages/samba/__init__.py", line 29, in <module>
    import samba.param
ModuleNotFoundError: No module named 'talloc'
--8<---------------cut here---------------end--------------->8---

Doing more testing, other tools appear to not find the libraries they
need too.  The combination is as folows:
 - samba-tool, fails when tdb missing.
 - samba-gpupdate Idem.
 - samba_dnsupdate requires dnspython, but fails when talloc missing.
 - samba_downgrade_db" fails when tdb missing.
 - samba_kcc Idem.
 - samba_spnupdate" Idem.
 - samba_upgradedns" dns not found when talloc missing.

I prepared a small patch to wrap up the inputs appropriately.  I hope it
is acceptable that they are all combined in one wrap procedure.

dnspython was added as a new input too.


Kind regards
Simon


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-samba-Use-PYTHONPATH.patch --]
[-- Type: text/x-patch, Size: 2409 bytes --]

From 201dc8e01fa4484e24b3e088ab6a4211e9839f33 Mon Sep 17 00:00:00 2001
From: Simon Streit <simon@netpanic.org>
Date: Mon, 3 Jan 2022 13:08:23 +0100
Subject: [PATCH] gnu: samba: Use PYTHONPATH.

* gnu/packages/samba.scm (samba): Use PYTHONPATH in 'wrap-program phase..
---
 gnu/packages/samba.scm | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm
index bb5b402eee..33a39eb3be 100644
--- a/gnu/packages/samba.scm
+++ b/gnu/packages/samba.scm
@@ -235,7 +235,30 @@ (define-public samba
            (lambda _
              (substitute* "dynconfig/wscript"
                (("bld\\.INSTALL_DIR.*") ""))
-             #t)))
+             #t))
+         (add-after 'install 'wrap-program
+           ;; Some samba tools selectively fail to find talloc, tdb
+           ;; and dnspython.
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (string-append (assoc-ref outputs "out")))
+                   (talloc (string-append (assoc-ref inputs "talloc")
+                                          "/lib/python3.9/site-packages"))
+                   (tdb (string-append (assoc-ref inputs "tdb")
+                                       "/lib/python3.9/site-packages"))
+                   (python-dnspython (string-append
+                                      (assoc-ref inputs "python-dnspython")
+                                      "/lib/python3.9/site-packages")))
+               (for-each
+                (lambda (bin)
+                  (wrap-program (string-append out bin)
+                    `("PYTHONPATH" prefix (,talloc ,tdb ,python-dnspython))))
+                '("/bin/samba-tool"
+                  "/sbin/samba-gpupdate"
+                  "/sbin/samba_dnsupdate"
+                  "/sbin/samba_downgrade_db"
+                  "/sbin/samba_kcc"
+                  "/sbin/samba_spnupdate"
+                  "/sbin/samba_upgradedns"))))))
        ;; FIXME: The test suite seemingly hangs after failing to provision the
        ;; test environment.
        #:tests? #f))
@@ -258,7 +281,8 @@ (define-public samba
            python
            popt
            readline
-           tdb))
+           tdb
+           python-dnspython))
     (propagated-inputs
      ;; In Requires or Requires.private of pkg-config files.
      (list ldb talloc tevent))
-- 
2.34.0


             reply	other threads:[~2022-01-03 13:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-03 13:07 Simon Streit [this message]
2022-01-14  3:36 ` bug#52976: Some tools in Samba fail to find modules, and a missing dependency Maxim Cournoyer
2022-01-17 13:10   ` Simon Streit
2022-01-17 15:53     ` Simon Streit

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=yguk0fh7ytj.fsf@netpanic.org \
    --to=simon@netpanic.org \
    --cc=52976@debbugs.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.