From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: bug#27811: net-tools patch has no effect? Date: Tue, 25 Jul 2017 13:52:02 -0400 Message-ID: <20170725175202.GA27528@jasmine.lan> References: <20170725041225.GA31642@jasmine.lan> <20170725045947.GA531@jasmine.lan> <87shhkncq3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kXdP64Ggrk/fb43R" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da47q-0001oB-Ob for bug-guix@gnu.org; Tue, 25 Jul 2017 14:00:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da47n-0001SU-J2 for bug-guix@gnu.org; Tue, 25 Jul 2017 14:00:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:53527) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1da47n-0001SO-F9 for bug-guix@gnu.org; Tue, 25 Jul 2017 14:00:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1da47n-0004Lx-7U for bug-guix@gnu.org; Tue, 25 Jul 2017 14:00:03 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Content-Disposition: inline In-Reply-To: <87shhkncq3.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 27811@debbugs.gnu.org --kXdP64Ggrk/fb43R Content-Type: multipart/mixed; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I've attached patches to fix this. First, a patch to create an otherwise equivalent package variant and to use it in GnuTLS, and a second patch to actually update the public net-tools variable. Is this the right way to create the test-only package variant for now? --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-gnu-net-tools-Add-a-test-only-variant-and-use-it-for.patch" Content-Transfer-Encoding: quoted-printable =46rom 5c738ab1ec5543981c9d5e512ee94d469bcca12b Mon Sep 17 00:00:00 2001 =46rom: Leo Famulari Date: Tue, 25 Jul 2017 00:19:56 -0400 Subject: [PATCH 1/2] gnu: net-tools: Add a test-only variant and use it for GnuTLS. * gnu/packages/linux.scm (net-tools-for-tests): Add net-tools variant for the GnuTLS test suite, et cetera. (net-tools): Inherit from net-tools-for-tests. * gnu/packages/tls.scm (gnutls)[native-inputs]: Use net-tools-for-tests instead of net-tools. --- gnu/packages/linux.scm | 5 ++++- gnu/packages/tls.scm | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 456909a94..4f9fa6d25 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -1187,7 +1187,7 @@ consists of several tools, of which the most importan= t are @command{ip} and messages and are accompanied by a set of manpages.") (license license:gpl2+))) =20 -(define-public net-tools +(define net-tools-for-tests ;; XXX: This package is basically unmaintained, but it provides a few ;; commands not yet provided by Inetutils, such as 'route', so we have to ;; live with it. @@ -1288,6 +1288,9 @@ network hardware types (plipconfig, slattach) and adv= anced aspects of IP configuration (iptunnel, ipmaddr).") (license license:gpl2+))) =20 +(define-public net-tools + (package (inherit net-tools-for-tests))) + (define-public libcap (package (name "libcap") diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index 0a81633aa..740f5a42e 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -140,6 +140,8 @@ coordinating the use of PKCS#11 by different components= or libraries living in the same process.") (license license:bsd-3))) =20 +;; TODO Add net-tools to #:disallowed-references when we can afford to reb= uild +;; GnuTLS. (define-public gnutls (package (name "gnutls") @@ -194,7 +196,7 @@ living in the same process.") "debug" "doc")) ;4.1 MiB of man pages (native-inputs - `(("net-tools" ,net-tools) + `(("net-tools" ,(@@ (gnu packages linux) net-tools-for-tests)) ("pkg-config" ,pkg-config) ("which" ,which))) (inputs --=20 2.13.3 --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0002-gnu-net-tools-Update-to-1.60-0.90da8a0.patch" Content-Transfer-Encoding: quoted-printable =46rom f57732d79ac265917f154da5791ff203c82c9733 Mon Sep 17 00:00:00 2001 =46rom: Leo Famulari Date: Tue, 25 Jul 2017 01:46:38 -0400 Subject: [PATCH 2/2] gnu: net-tools: Update to 1.60-0.90da8a0. Fixes . * gnu/packages/linux.scm (net-tools): Update to 1.60-0.90da8a0. [inputs]: Remove the Debian patch. [arguments]: Use modify-phases. Remove the 'patch' phase. Disable SELINUX and AFBLUETOOTH from build configuration. --- gnu/packages/linux.scm | 77 ++++++++++++++++++++++++++++++++++++++++++++++= +++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 4f9fa6d25..12c6a1241 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -106,6 +106,7 @@ #:use-module (guix build-system python) #:use-module (guix build-system trivial) #:use-module (guix download) + #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix utils) @@ -1187,6 +1188,18 @@ consists of several tools, of which the most importa= nt are @command{ip} and messages and are accompanied by a set of manpages.") (license license:gpl2+))) =20 +;; There are two packages for net-tools. This one, net-tools-for-tests, is +;; relatively old and buggy. It can be used in package test suites and sho= uld +;; never be referenced by a built package. Use #:disallowed-references to +;; enforce this. The second one, net-tools, is more recent and probably sa= fer to +;; use, and it is the one that is exported as a public variable. +;; +;; When we are able to rebuild many packages (i.e. core-updates), the +;; relationship of these two net-tools packages will be reversed. That is, +;; net-tools will become the primary package, and net-tools-from-tests will +;; inherit from it. +;; +;; See for more information. (define net-tools-for-tests ;; XXX: This package is basically unmaintained, but it provides a few ;; commands not yet provided by Inetutils, such as 'route', so we have to @@ -1270,6 +1283,10 @@ messages and are accompanied by a set of manpages.") =20 ;; Use the big Debian patch set (the thing does not even compile out of ;; the box.) + ;; XXX The patch is not actually applied, due to a bug in the 'patch' = phase + ;; above. However, this package variant is only used in GnuTLS's tests= =2E It + ;; will be adjusted when convenient for the build farm. + ;; See for more information. (inputs `(("patch" ,(origin (method url-fetch) (uri @@ -1289,8 +1306,66 @@ configuration (iptunnel, ipmaddr).") (license license:gpl2+))) =20 (define-public net-tools - (package (inherit net-tools-for-tests))) + (package (inherit net-tools-for-tests) + (version "1.60-0.90da8a0") + ;; This tarball from Debian is equivalent to a Git checkout of the ups= tream + ;; repo, , commit + ;; 90da8a01bd27a945bb85c7773e8174a6cb7037a1. + ;; Git depends on net-tools, transitively, so we fetch this tarball to= avoid + ;; a reference cycle. We should find a better workaround for this prob= lem so + ;; that we can use the latest upstream source. + (source (origin + (method url-fetch) + (uri (string-append "http://http.debian.net/debian/pool/main/= n/" + "net-tools/net-tools_1.60+git20161116.90d= a8a0" + ".orig.tar.gz")) + (sha256 + (base32 + "0ahrqhxrgqk0x785ghzlpcfgs7418cj1xcpbajxv46slf15mrhnk")))) + (arguments + '(#:modules ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-1) + (srfi srfi-26)) + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (mkdir-p (string-append out "/bin")) + (mkdir-p (string-append out "/sbin")) + + ;; Pretend we have everything... + (system "yes | make config") + + ;; ... except for the things we don't have. + ;; HAVE_AFDECnet requires libdnet, which we don't have. + ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers + ;; that have been removed. + ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we = should + ;; think about adding them later. + (substitute* '("config.make" "config.h") + (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ = =3D]1.*$") + ""))))) + (add-after 'install 'remove-redundant-commands + (lambda* (#:key outputs #:allow-other-keys) + ;; Remove commands and man pages redundant with Inetutils. + (let* ((out (assoc-ref outputs "out")) + (dup (append-map (cut find-files out <>) + '("^hostname" + "^(yp|nis|dns)?domainname")))) + (for-each delete-file dup) + #t)))) + ;; Binaries that depend on libnet-tools.a don't declare that + ;; dependency, making it parallel-unsafe. + #:parallel-build? #f =20 + #:tests? #f ; no test suite + #:make-flags (let ((out (assoc-ref %outputs "out"))) + (list "CC=3Dgcc" + (string-append "BASEDIR=3D" out) + (string-append "INSTALLNLSDIR=3D" out "/share/= locale") + (string-append "mandir=3D/share/man"))))))) (define-public libcap (package (name "libcap") --=20 2.13.3 --u3/rZRmxL6MmkK24-- --kXdP64Ggrk/fb43R Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAll3hUIACgkQJkb6MLrK fwhtbRAAw6q6yiEwlBgZuvqomwMUxXrehPrWW8BM5LA080jebZEq2aTKI9/kRA71 kxwROrPGUKQuoiWlYMtj6Mf+auBH8imbYi6AOoXWcv/IlUjwWiBK33q0JZQV3UH/ wucAdStxJowin5bbh37fbIypOru1Sxiqwo+vfDN5LtxIYesSz3bhvU13THn4cOhi rRwYls4LN8AqkPItd7jtu5hx/uwwSZEV9T++qNYypZMHuo2eqe6nIyt0XQkmPmKB dDLvfaZ39EbnyMPzM50RqIkTxtjVVMSD6y1UeJdZCe4IjeP2mo4HsOSRKecbjp7j H1Me+so4qn926TTGQz42tDKlOsdHR17674npIvAuu3geM9yEsNF+WcdyxZLob1H+ zvWUQEjqyjEKhvdhTGaD0otu9dKkeGmtfJgdJicUNPLgTeQFICZ4xJUelED8rRJg VydSFqEqWYm3iVmxyepQ1c1XYErZ8+7qsZDaUSI7MV2Uvik/3LvCxAj3ONjrDfXR QafeHcJcHhKWSOrdCvQ26BcHkwrXBNVddQIDfFccAirXYi2rmKEYuDT1xwbVdnf9 glBZc7AXovsVgtGQzafREUKsZAt16Nad8RgXZ+4NOvfIscvi2u90FalSuN5hatcH n1lG2eC+epMVsCyV2iRLxVAPYM1Qypm38lfj2zTj9zd1eZzb5Eg= =++BJ -----END PGP SIGNATURE----- --kXdP64Ggrk/fb43R--