From unknown Fri Jun 13 09:58:54 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#33777 <33777@debbugs.gnu.org> To: bug#33777 <33777@debbugs.gnu.org> Subject: Status: ansible: Work around issues with Guix wrapper scripts Reply-To: bug#33777 <33777@debbugs.gnu.org> Date: Fri, 13 Jun 2025 16:58:54 +0000 retitle 33777 ansible: Work around issues with Guix wrapper scripts reassign 33777 guix-patches submitter 33777 Arun Isaac severity 33777 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 17 09:11:34 2018 Received: (at submit) by debbugs.gnu.org; 17 Dec 2018 14:11:34 +0000 Received: from localhost ([127.0.0.1]:50987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gYtcM-0006gq-6w for submit@debbugs.gnu.org; Mon, 17 Dec 2018 09:11:34 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gYtcK-0006gc-78 for submit@debbugs.gnu.org; Mon, 17 Dec 2018 09:11:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gYtc8-00028r-Oj for submit@debbugs.gnu.org; Mon, 17 Dec 2018 09:11:26 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=BAYES_40,RCVD_IN_SORBS_WEB autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58309) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gYtc3-00023v-JG for submit@debbugs.gnu.org; Mon, 17 Dec 2018 09:11:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYtbx-0003F0-Cu for guix-patches@gnu.org; Mon, 17 Dec 2018 09:11:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gYtbs-0001tw-7e for guix-patches@gnu.org; Mon, 17 Dec 2018 09:11:09 -0500 Received: from vultr.systemreboot.net ([45.77.148.100]:50372) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gYtbr-0001oy-GV for guix-patches@gnu.org; Mon, 17 Dec 2018 09:11:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HK+G99OXO3dMmf/2chOKqO1+IV2cj52bx4L4KXCPu0Q=; b=FoP+/x3fc+fxLrJJV9fUVzbvsJ yMUNjkI6EG0HS6GLEv3q4S6gljYt1WZzF/9lbMm+O62JMKLZP3fedr8ojdJtexchxDzoGr3OOJQA8 5I3c3/vuq0BgAJlvjrHKH1bMtKFm5+6eIPFrT5U7iwiai+2b8YdiSHxy5j17Y5KM0V74=; Received: from [103.5.134.173] (helo=steel) by systemreboot.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gYtbm-0004rf-G1 for guix-patches@gnu.org; Mon, 17 Dec 2018 19:40:59 +0530 From: Arun Isaac To: guix-patches@gnu.org Subject: ansible: Work around issues with Guix wrapper scripts Date: Mon, 17 Dec 2018 19:40:51 +0530 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.6 (---) --=-=-= Content-Type: text/plain This patch works around ansible's issues with Guix wrapper scripts. The earlier system using ansible-wrap-program-hack.patch was not working as expected. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-ansible-Work-around-issues-with-Guix-wrapper-scr.patch >From 2a8d3b46aac378b077fb9ef296909c840fa9c42a Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 17 Dec 2018 19:32:05 +0530 Subject: [PATCH] gnu: ansible: Work around issues with Guix wrapper scripts. * gnu/packages/admin.scm (ansible)[source]: Remove ansible-wrap-program-hack.patch from patches. [arguments]: Add hide-wrapping and fix-symlinks phases. * gnu/packages/patches/ansible-wrap-program-hack.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Unregister it. --- gnu/local.mk | 1 - gnu/packages/admin.scm | 38 ++++++++++++++++++- .../patches/ansible-wrap-program-hack.patch | 22 ----------- 3 files changed, 36 insertions(+), 25 deletions(-) delete mode 100644 gnu/packages/patches/ansible-wrap-program-hack.patch diff --git a/gnu/local.mk b/gnu/local.mk index 0e2316a69..0d60e9b75 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -579,7 +579,6 @@ dist_patch_DATA = \ %D%/packages/patches/aegisub-boost68.patch \ %D%/packages/patches/agg-am_c_prototype.patch \ %D%/packages/patches/amule-crypto-6.patch \ - %D%/packages/patches/ansible-wrap-program-hack.patch \ %D%/packages/patches/antiword-CVE-2014-8123.patch \ %D%/packages/patches/antlr3-3_1-fix-java8-compilation.patch \ %D%/packages/patches/antlr3-3_3-fix-java8-compilation.patch \ diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 3e41b456e..ec8da6dba 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -1608,8 +1608,7 @@ of supported upstream metrics systems simultaneously.") (uri (pypi-uri "ansible" version)) (sha256 (base32 - "1fsif2jmkrrgiawsd8r6sxrqvh01fvrmdhas0p540a6i9fby3yda")) - (patches (search-patches "ansible-wrap-program-hack.patch")))) + "1fsif2jmkrrgiawsd8r6sxrqvh01fvrmdhas0p540a6i9fby3yda")))) (build-system python-build-system) (native-inputs `(("python-bcrypt" ,python-bcrypt) @@ -1626,6 +1625,41 @@ of supported upstream metrics systems simultaneously.") ("python-jinja2" ,python-jinja2) ("python-pyyaml" ,python-pyyaml) ("python-paramiko" ,python-paramiko))) + (arguments + `(#:phases + (modify-phases %standard-phases + ;; Several ansible commands (ansible-config, ansible-console, etc.) + ;; are just symlinks to a single ansible executable. The ansible + ;; executable behaves differently based on the value of + ;; sys.argv[0]. This does not work well with our wrap phase, and + ;; therefore the following two phases are required as a workaround. + (add-after 'unpack 'hide-wrapping + (lambda _ + ;; Overwrite sys.argv[0] to hide the wrapper script from it. + (substitute* "bin/ansible" + (("import traceback" all) + (string-append all " +import re +sys.argv[0] = re.sub(r'\\.([^/]*)-real$', r'\\1', sys.argv[0]) +"))) + #t)) + (add-after 'wrap 'fix-symlinks + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (for-each + (lambda (subprogram) + ;; The symlinks point to the ansible wrapper script. Make + ;; them point to the real executable (.ansible-real). + (delete-file (string-append out "/bin/.ansible-" subprogram "-real")) + (symlink (string-append out "/bin/.ansible-real") + (string-append out "/bin/.ansible-" subprogram "-real")) + ;; The wrapper scripts of the symlinks invoke the ansible + ;; wrapper script. Fix them to invoke the correct executable. + (substitute* (string-append out "/bin/ansible-" subprogram) + (("/bin/ansible") (string-append "/bin/.ansible-" subprogram "-real")))) + (list "config" "console" "doc" "galaxy" + "inventory" "playbook" "pull" "vault"))) + #t))))) (home-page "https://www.ansible.com/") (synopsis "Radically simple IT automation") (description "Ansible is a radically simple IT automation system. It diff --git a/gnu/packages/patches/ansible-wrap-program-hack.patch b/gnu/packages/patches/ansible-wrap-program-hack.patch deleted file mode 100644 index c2e102839..000000000 --- a/gnu/packages/patches/ansible-wrap-program-hack.patch +++ /dev/null @@ -1,22 +0,0 @@ -Ansible changes its behaviour depending on the name of the script that it is -called as. Make it deal with guix' .real wrapper scripts. - -FIXME: Remove once wrapping ansible works properly. -See http://lists.gnu.org/archive/html/bug-guix/2017-05/msg00015.html. ---- ansible-2.3.0.0/bin/ansible 2017-04-12 16:08:05.000000000 +0200 -+++ ansible-2.3.0.0-fixed/bin/ansible 2017-05-21 20:11:18.720872385 +0200 -@@ -75,7 +75,13 @@ - # sometimes add that - target = target[:-1] - -- if len(target) > 1: -+ if target[-1] == "real" and target[0].startswith('.'): -+ target = target[:-1] -+ target[0] = target[0][1:] -+ if len(target) > 1 and target[1] != "real" : -+ sub = target[1] -+ myclass = "%sCLI" % sub.capitalize() -+ elif len(target) > 2 and target[2] == "real" : - sub = target[1] - myclass = "%sCLI" % sub.capitalize() - elif target[0] == 'ansible': -- 2.19.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 17 14:29:57 2018 Received: (at 33777) by debbugs.gnu.org; 17 Dec 2018 19:29:57 +0000 Received: from localhost ([127.0.0.1]:52173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gYyaS-0008Q3-Ic for submit@debbugs.gnu.org; Mon, 17 Dec 2018 14:29:56 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:41337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gYyaR-0008Pn-02 for 33777@debbugs.gnu.org; Mon, 17 Dec 2018 14:29:55 -0500 Received: by mail-pl1-f195.google.com with SMTP id u6so6584734plm.8 for <33777@debbugs.gnu.org>; Mon, 17 Dec 2018 11:29:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=jTLWtegX7XoqhCcZJo7reBgySoC5cJm2IEGzvifqU+s=; b=JZj+PN/4qvytRpvTC+SklySbgTq6nUTyAOHDpozJIP/qLmASEhLS50jTAExVRYaCwR A2xM0p4oFUqZOuHMlyY9b8FRBYwvNaVwHQZo/EXNeIIo28K4h7MGgcCI5Z84DgXfrHwc vMdSgUATfQvpNmtIQQ2TtO3X97CQziPeAXXsERAouiKBy6qOhuqdl7jbNZvMbKI8bLok MLx5aLouJYHV+2t8XhVMha8PJjPJPvzv8OP+LtK7ca/ThWVPDqDSSUXv8gJFmSKCuyk5 gefbchoEXs5Nq0JDnDTu0ScLUv1GFgT2lDQynxykZrPVQ+cDFpLASYYUDa/iFYKRAfPk DWJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=jTLWtegX7XoqhCcZJo7reBgySoC5cJm2IEGzvifqU+s=; b=KEthpvYITSw3BAF/rE9yRGS6sTXC7pnQcUcg3rLQV3JRkbH54HY7LsoLxP9Zyh+eFB 4FFnKzzSSqObDvMmcBJ41NzMFTBDSovm8nEVX+57/G2b9g3FN4B4ueKXSqi1g+l5S1nx FvOb/V7b+gYZmCNrrpXTny/2EVO2mZI0Zdq6xMUuT1KKrQ5aBo3R9MlB7XPxL2UsiLoD PPyHqBVOPJNyrvBqy/BZz0BsVosff4PNAceQR7B3/r9aF7VU7bG/c1HhmmG3gq+RLf7s ZoCsh7ERfx2QFVvQL9DddIrmLMXMbccY2Ulj7bc4iTvtfb/qOxY3G44Auycjsdj4sVPQ GBfg== X-Gm-Message-State: AA+aEWaqJevdG+Gkg12BipwYEmwi7uNxAmqo0YCY/xK17x7gTSmTigmD vkOTn82KAdTYvY+a0q84i3Ra8nD/ X-Google-Smtp-Source: AFSGD/XqvQZ8JTcJiiii+2ZORAIi9u1i18RdGXau1Zo2BYdCFYswgL1xBbFWZv8IV6K6rT6BqIQxBA== X-Received: by 2002:a17:902:209:: with SMTP id 9mr13995756plc.288.1545074988918; Mon, 17 Dec 2018 11:29:48 -0800 (PST) Received: from magnolia (92-100-172-177.dynamic.avangarddsl.ru. [92.100.172.177]) by smtp.gmail.com with ESMTPSA id a15sm19434558pgb.1.2018.12.17.11.29.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Dec 2018 11:29:47 -0800 (PST) From: Oleg Pykhalov To: Arun Isaac Subject: Re: [bug#33777] ansible: Work around issues with Guix wrapper scripts References: Date: Mon, 17 Dec 2018 22:29:39 +0300 In-Reply-To: (Arun Isaac's message of "Mon, 17 Dec 2018 19:40:51 +0530") Message-ID: <87efagost8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33777 Cc: 33777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Arun, Arun Isaac writes: > This patch works around ansible's issues with Guix wrapper scripts. The > earlier system using ansible-wrap-program-hack.patch was not working as > expected. > > From 2a8d3b46aac378b077fb9ef296909c840fa9c42a Mon Sep 17 00:00:00 2001 > From: Arun Isaac > Date: Mon, 17 Dec 2018 19:32:05 +0530 > Subject: [PATCH] gnu: ansible: Work around issues with Guix wrapper scrip= ts. > > * gnu/packages/admin.scm (ansible)[source]: Remove > ansible-wrap-program-hack.patch from patches. > [arguments]: Add hide-wrapping and fix-symlinks phases. > * gnu/packages/patches/ansible-wrap-program-hack.patch: Delete file. > * gnu/local.mk (dist_patch_DATA): Unregister it. > --- > gnu/local.mk | 1 - > gnu/packages/admin.scm | 38 ++++++++++++++++++- > .../patches/ansible-wrap-program-hack.patch | 22 ----------- > 3 files changed, 36 insertions(+), 25 deletions(-) > delete mode 100644 gnu/packages/patches/ansible-wrap-program-hack.patch [=E2=80=A6] Thank you for the patch! I succeeded to: * run a playbook with =E2=80=98ansible-playbook=E2=80=99; * ping a host with =E2=80=98ansible=E2=80=99 command; * check =E2=80=98ansible-vault --help=E2=80=99. I vote for a push. :-) Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAlwX+SMACgkQFn+OpQAa +pxg6g//cJophHhA6xc8+xiaXDIiqj5wNfypZZpd4JJZeJg4+Ijgzl+XjyGcnzUh 55XTtNqL/atvJkgv/OpwAtMBMKxYaY0OgONDPvpjfCK+c+kPZ28CrhhU9b0a0E5Z CEeqrQOxB+0NW64uhpmwqgdzA0iNo0eJ6/TueKi17Br0DqV78WFNzIt7SJ3R+T63 I4uVKaz3PEZKQg3q5lCY1NkNzd+McURz/Load5IwfQ4oITIhKEd+/d3mRYPkyQhm B/DOh/+bPSXugux9pBXfgd3tLvkh0aNHZ8uyQ43IEwX9v+tn5N6QrNNRNFrYh5wa spLsTD0pn+8JwCIc841HyreoU9K6iaFMKVSkFIbN9N6tVBRYN58l93DLjy2EORG5 a929s3TRDU64V/k2r0VC6kLexyXv77RsiFMqdtZo/AsBdu/iIpD/Ql3apEdoI0CP QDtXNUUSW0PY0hp4/xvAqPDjze/306VM5CWKmu+fzwrkxy0eA1cnlJ7XC4U7WO7p WNrIO8bxVmjRcO3GzzusZLHSfeXR0YOkbrGVxLxk2tP6b/rJmZ/gM4jzoqCCEhih F8I23lAXXiDuU/peFcA25TmucmMv9stt3yfUkL46y1x4oZmiK8KkkKZOSpCJwV+e HnW5ITyIh9KTlNY/W0Z4WfV632pDBS/FOQ/+Tba3+54iTwgp5Rw= =/0f2 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 18 01:22:25 2018 Received: (at 33777-done) by debbugs.gnu.org; 18 Dec 2018 06:22:25 +0000 Received: from localhost ([127.0.0.1]:52502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZ8ls-0002pN-OQ for submit@debbugs.gnu.org; Tue, 18 Dec 2018 01:22:24 -0500 Received: from vultr.systemreboot.net ([45.77.148.100]:36156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZ8lr-0002pF-K9 for 33777-done@debbugs.gnu.org; Tue, 18 Dec 2018 01:22:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QU09TXUs/xiM6Nbg2VlK6GkiKPz9KOtB566hL5iOki0=; b=NkJakej8kPThY/OGEf9Ltj1lz KouJnjsfTjr5cIGoj09DA9KpdlhDllXYd0gQhBvToIOm1WjGwMZcyg+Jz0GHQLwo5MTPjCgpSVRrv XbRbkXXoS6F2Q2vOAC110Uby+8f52dS9Wqa5viHdHNk4t2RRDIrD56Mn9U6gSGJsjDdb8=; Received: from [103.5.134.173] (helo=steel) by systemreboot.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gZ8ll-0008DT-EL; Tue, 18 Dec 2018 11:52:18 +0530 From: Arun Isaac To: Oleg Pykhalov Subject: Re: [bug#33777] ansible: Work around issues with Guix wrapper scripts In-Reply-To: <87efagost8.fsf@gmail.com> References: <87efagost8.fsf@gmail.com> Date: Tue, 18 Dec 2018 11:52:10 +0530 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Pushed to master. Thanks for the review! :-) Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [103.5.134.173 listed in dnsbl.sorbs.net] -0.0 SPF_PASS SPF: sender matches SPF record X-Debbugs-Envelope-To: 33777-done Cc: 33777-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Pushed to master. Thanks for the review! :-) From unknown Fri Jun 13 09:58:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 15 Jan 2019 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator