From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kIr1JhLXJ2KaJAAAgWs5BA (envelope-from ) for ; Tue, 08 Mar 2022 23:22:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id oKFdJBLXJ2LpjwAA9RJhRA (envelope-from ) for ; Tue, 08 Mar 2022 23:22:10 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 433233E261 for ; Tue, 8 Mar 2022 23:22:10 +0100 (CET) Received: from localhost ([::1]:52616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRiDZ-0002aS-Cr for larch@yhetil.org; Tue, 08 Mar 2022 17:22:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRiDS-0002a6-Ia for guix-patches@gnu.org; Tue, 08 Mar 2022 17:22:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRiDS-0000v3-AF for guix-patches@gnu.org; Tue, 08 Mar 2022 17:22:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRiDS-0002pD-6U for guix-patches@gnu.org; Tue, 08 Mar 2022 17:22:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54266] [PATCH] samba: wrap scripts with GUIX_PYTHONPATH Resent-From: fesoj000 Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Mar 2022 22:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54266 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54266@debbugs.gnu.org Received: via spool by 54266-submit@debbugs.gnu.org id=B54266.164677812010849 (code B ref 54266); Tue, 08 Mar 2022 22:22:02 +0000 Received: (at 54266) by debbugs.gnu.org; 8 Mar 2022 22:22:00 +0000 Received: from localhost ([127.0.0.1]:58078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRiDP-0002ou-Ov for submit@debbugs.gnu.org; Tue, 08 Mar 2022 17:22:00 -0500 Received: from mail-ej1-f48.google.com ([209.85.218.48]:43781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRiDN-0002oh-Nn for 54266@debbugs.gnu.org; Tue, 08 Mar 2022 17:21:58 -0500 Received: by mail-ej1-f48.google.com with SMTP id d10so934460eje.10 for <54266@debbugs.gnu.org>; Tue, 08 Mar 2022 14:21:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:references :content-language:reply-to:to:in-reply-to:content-transfer-encoding; bh=oNqoTSw7GjO1UbCbDqZLiRqcz4C8j0ZYt61kh7Dn/eU=; b=RzN5vBGGtQjpvl6xUSR/ntSCAgFUAG05NtyhiPe0uP+7morby0jljUioGkOdsl0GG9 cF8cQUxR24UwGS8muMZFVUa+m7l0Hx1GRBEUr6MRfoX2UT0hjYEe2+07ZqL4S9xCpUM5 dR7EM0jlhHu0pi9phe/sbXlAy6jxp3OViVZnFKnVK70Dag2RlemhuyaAstG4JUFZoeDy b6GhDg9839zU0/y/g4wcstnntcicnjtzODJGvpc1GCX0U+AQZ0uuJtLhWWSrdBLAFDF2 xfwGQrIfJSrdHO6Aqq0rfpcbKEOT20eEkRAmhUamSjS2VabWfe1In1qHnm21TLSS5oZZ krUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:references:content-language:reply-to:to:in-reply-to :content-transfer-encoding; bh=oNqoTSw7GjO1UbCbDqZLiRqcz4C8j0ZYt61kh7Dn/eU=; b=6LnVr14EQ9fsWceFBQ7NtLc8i8XmxQHqX+tRrqe9q8SCdWjRLN29xF+FEwW9Ej+sag rKoYK1LFDWgHlUwxhJMFwoR9RMLbg8XFiKja54rVsRvqWxNFaPBrNBHUMouQASuM64C8 0rmR1nI6pdFpUaHvKevay6fgDFe2GtViS1RY25pZTDhFfWL3iz1n//cyBNqbuKyj+bKS s9sLAVR5QhElPVzWtVHe+0ldyXmakwJCjLc+zGjvD+ObPYDPmSc/lfUlfQYF7pgisgBJ FlG85ZnppDvo5Y+yR09ZSeEZyz9fsZUX7gyR0WbnnrMMf63pBr9psFRlxzw0ybHfg6Ho aY8g== X-Gm-Message-State: AOAM531GMW0EbBSOGh/qgzy5EOU/0T1a1S419GeIWN4pssQgPZPngDI7 xj1IhBh+GVAfDZdJsfO2SvJr7S7o1lU= X-Google-Smtp-Source: ABdhPJzL43i3UNF+IiNkawcv/dtKmNpbHl8QbW0ruOwRWYzEyYKnBOw13wvYYW34KPLxg0NUQXKd+A== X-Received: by 2002:a17:906:fc10:b0:6cd:84e:7248 with SMTP id ov16-20020a170906fc1000b006cd084e7248mr15576915ejb.281.1646778111917; Tue, 08 Mar 2022 14:21:51 -0800 (PST) Received: from ?IPV6:2003:ee:af2f:e00:c2f9:c2bb:bf95:1fc5? (p200300eeaf2f0e00c2f9c2bbbf951fc5.dip0.t-ipconnect.de. [2003:ee:af2f:e00:c2f9:c2bb:bf95:1fc5]) by smtp.gmail.com with ESMTPSA id i22-20020a170906251600b006d6d9081f46sm20571ejb.150.2022.03.08.14.21.51 for <54266@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Mar 2022 14:21:51 -0800 (PST) Message-ID: <42365ae6-a63a-5825-8a96-59a54b706b15@gmail.com> Date: Tue, 8 Mar 2022 23:21:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 From: fesoj000 References: <07a2e445-f1b8-16dc-ba68-add645ba2588@gmail.com> Content-Language: en-US In-Reply-To: <07a2e445-f1b8-16dc-ba68-add645ba2588@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: fesoj000 Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646778130; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=oNqoTSw7GjO1UbCbDqZLiRqcz4C8j0ZYt61kh7Dn/eU=; b=YrU8DLyqrAY3vV5JvthY+drbqEeTW9pc3gVh6/GJCweKWYwugbz4yXco9NeB63sy/77wDs 6ktVRieMH53WrjfF7DrBdjyCg0Ms4OHEg853ceK1VOvOtjxaMACnJaXq7tbVH2rmGLqksP cwv+B26PG48vUTuQ7TNxz0qoTCwX04qWu/ThjxODIpoz6bPif3KZ0NkFIUblRcNPM5vwKJ vo5i3BwqVE/0G7xVqM6+GuBJHvE/7DgWosqSYvmUO0m5MXOzTpvOtRLSfBKdyM2P9z9hWr k/EIfZR8ffWsROYCTx2Uxh60sic/5GSNTaIftsjJPyOf2bfjDn/PCpUd5q8T8g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646778130; a=rsa-sha256; cv=none; b=Vr1jmn3C292YDI9AIfgLw2swg3BmxZajHgoqIn6N6Ap5nWSWeaLSNwKShUqbZXgwExBE10 KzYEgUC6w6u9YW0rw4uZOzkpWzfPpYH4jQ9EmZG2yROjVD/Kif0G2bwPv5mB7Y2Zsl86Aa YDQNd7hpJypCAsQpvzqWtVai+lutksmb4e1VAlpwYXftLXFXrvQ7VE3sPGwDjl+EmZVuTF LCrjNqc9V/eOPE+p0F0z4zztp+mnNMRalkaLrjydJe0CG6hOYaQaYuoYN8BNduVoHSpNsP KsQk+lNEP/jyncNBbPabtaBL3R83Vf5x6dtFfA+NWPaZfH3X/Py7Um4XZOIafQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=RzN5vBGG; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 4.79 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=RzN5vBGG; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 433233E261 X-Spam-Score: 4.79 X-Migadu-Scanner: scn0.migadu.com X-TUID: DaWfucshi2y2 On 3/8/22 9:44 PM, Maxime Devos wrote: > fesoj000 schreef op di 08-03-2022 om 20:26 [+0100]: >> +                            (wrap-program (string-append out file) >> +                              `("GUIX_PYTHONPATH" = >> +                                (,(guix-pythonpath >> +                                   (site-package-path >> +                                    (assoc-ref inputs "python"))))))) > > I would expect that python always puts its own site-packages in front > of the path, though I could be mistaken, so is this necessary?hm, "python3 -c 'import sys; print(sys.path)'" always includes its own site packages. If you talk about the samba package output then we can do this like the new diff below. > Also, it looks like some of the python stuf uses 'ldb', so 'ldb' might > need to be included as well. 'ldb' is included, you can look at the guix-pythonpath function which builds the pythonpath. In fact not only 'ldb' is need but further 'tdb' and 'talloc'. diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm index b775ad905c..fa8ff5b6bb 100644 --- a/gnu/packages/samba.scm +++ b/gnu/packages/samba.scm @@ -40,6 +40,7 @@ (define-module (gnu packages samba) #:use-module (gnu packages autotools) #:use-module (gnu packages backup) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages check) #:use-module (gnu packages crypto) #:use-module (gnu packages cups) @@ -195,6 +196,10 @@ (define-public samba (arguments (list #:make-flags #~(list "TEST_OPTIONS=--quick") ;some tests are very long + #:imported-modules `((guix build python-build-system) + ,@%gnu-build-system-modules) + #:modules `(((guix build python-build-system) #:select (python-version)) + ,@%gnu-build-system-modules) #:phases #~(modify-phases %standard-phases (add-before 'configure 'setup-docbook-stylesheets @@ -231,12 +236,36 @@ (define-public samba (add-before 'install 'disable-etc,var-samba-directories-setup (lambda _ (substitute* "dynconfig/wscript" - (("bld\\.INSTALL_DIR.*") ""))))) + (("bld\\.INSTALL_DIR.*") "")))) + (add-after 'install 'wrap-scripts + (lambda* (#:key inputs #:allow-other-keys) + (define (site-package-path python) + (string-append "/lib/python" (python-version python) + "/site-packages")) + (define (guix-pythonpath site-package-path) + (string-join + (append (list (string-append #$output site-package-path)) + (map (lambda (input) + (string-append (assoc-ref inputs input) + site-package-path)) + '("tdb" "ldb" "talloc"))) + ":")) + (for-each (lambda (file) + (wrap-program (string-append #$output file) + `("GUIX_PYTHONPATH" = + (,(guix-pythonpath + (site-package-path + (assoc-ref inputs "python"))))))) + '("/bin/samba-tool" "/sbin/samba_dnsupdate" + "/sbin/samba_downgrade_db" "/sbin/samba-gpupdate" + "/sbin/samba_kcc" "/sbin/samba_spnupdate" + "/sbin/samba_upgradedns"))))) ;; FIXME: The test suite seemingly hangs after failing to provision the ;; test environment. #:tests? #f)) (inputs (list acl + bash-minimal cmocka cups gamin -- 2.34.0