From debbugs-submit-bounces@debbugs.gnu.org Thu May 04 03:53:45 2017 Received: (at submit) by debbugs.gnu.org; 4 May 2017 07:53:45 +0000 Received: from localhost ([127.0.0.1]:53498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d6Ba5-0004zn-9o for submit@debbugs.gnu.org; Thu, 04 May 2017 03:53:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53903) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d6Ba3-0004zb-VG for submit@debbugs.gnu.org; Thu, 04 May 2017 03:53:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6BZx-00010z-DD for submit@debbugs.gnu.org; Thu, 04 May 2017 03:53:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57207) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6BZx-00010t-90 for submit@debbugs.gnu.org; Thu, 04 May 2017 03:53:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6BZv-0003KN-OA for guix-patches@gnu.org; Thu, 04 May 2017 03:53:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6BZs-0000z8-LI for guix-patches@gnu.org; Thu, 04 May 2017 03:53:35 -0400 Received: from mail-pf0-x231.google.com ([2607:f8b0:400e:c00::231]:33745) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d6BZs-0000yn-Ce for guix-patches@gnu.org; Thu, 04 May 2017 03:53:32 -0400 Received: by mail-pf0-x231.google.com with SMTP id q20so3991531pfg.0 for ; Thu, 04 May 2017 00:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:user-agent:date:message-id:mime-version; bh=bswwznG18qKmjslpLHW+Xl+R5KaMB8yAbjvl1IlsoLw=; b=QbdetFZOml3AOFgmTeg/WQobVd0t2EpIfrtf4MimOxKcGcJZUFYwR/Jwl9Lm5aVVuJ cEH+2qhWKuRVvEJUrU7coIWeoHLFcjnUemET1+23GHXq7mtX3a88bPvkUVTkmiKxRqh9 XsGYEYsFS97/CWkBKCStBVbsfFzuMtjJkspObdLBTxg0PlPZ4RT+6fC1zxM4KA2kImmp tr8mzfVmUclZJELKNY6Ib1opNHjPjtrxuROF+kBzxdB6dw6K7AWa8kBWbqv+3jDTdDj6 h5ixj+u88xNtMQO8Mz/DONd+g0KBp8pirkid7A8M0rvka+rNANrs8G38DLwWWzqTGFMW y6Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:user-agent:date:message-id :mime-version; bh=bswwznG18qKmjslpLHW+Xl+R5KaMB8yAbjvl1IlsoLw=; b=tXmEVw79KKSxInVUbfawLZv/dJFev7PWNHrDY0MaP3zDemDq3QbBUIse4ehS9jKwiC 8YZ6tjQUOUWxhtkASA7pp4J8FFEBECo2i4oli4eGou8xgZS2PkVQllPhB6s2QnBZlBJi TkAF60udcskdMJezeAz2QFLIw6sMRPppPOOPuWd3yRAJE7W//L6jINg2mSZ68CUcZODe XIftHCZvNYbFjWWOOr+C2obrjMSwxNfOu/6Tq2oDz0aumzf8ZP43gQoh1TA0krKWCL0m QM1QsqhoBeywGmIxOI2gXY+7wa97Zt2IbrBAWEYQcO1/Jtgw4M2D/Tqn8vcVUSUBvTOL xKXA== X-Gm-Message-State: AN3rC/4R7zdK0bHB4S0f8FT19ogEJI+70wJx8Zw2y66nVic3h1KEDpC+ An8aktluZf8syOMD X-Received: by 10.84.178.131 with SMTP id z3mr27687508plb.122.1493884410967; Thu, 04 May 2017 00:53:30 -0700 (PDT) Received: from apteryx (c-73-231-189-138.hsd1.ca.comcast.net. [73.231.189.138]) by smtp.gmail.com with ESMTPSA id s18sm2454221pfi.16.2017.05.04.00.53.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 May 2017 00:53:30 -0700 (PDT) From: Maxim Cournoyer To: guix-patches@gnu.org Subject: [PATCH] build-system/gnu: Fix compress-documentation phase User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Date: Thu, 04 May 2017 00:53:24 -0700 Message-ID: <87h9116osr.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) 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: -4.0 (----) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello Guix! This patch fixes a small defect in compress-documentation phase of our gnu-build-system. The phase could create dangling manual page symlinks in the case those were recursive. One package which exhibited the issue is Gimp; you might have noticed the `find-files' error message when the manual page database gets created on a profile generation as a consequence of that. Here's the Gimp example in some more details: * The manual pages under share/man/man1 before the documentation is compressed: =20=20 gimp.1 -> gimp-2.8.1=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20 gimp-2.8.1=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 gimp-console.1 -> gimp-console-2.8.1=20=20 gimp-console-2.8.1 -> gimp-2.8.1=20=20=20=20=20=20 gimptool-2.0.1 * After the documentation is compressed: gimp.1 -> gimp-2.8.1.gz gimp-2.8.1.gz gimp-console.1 -> gimp-console-2.8.1.gz gimp-console-2.8.1 -> gimp-2.8.1.gz gimptool-2.0.1.gz We can see that the gimp-console.1 link now points to an unexisting file. To correct the problem, a `points-to-symbolic-link?' predicate is added and its negation is used to filter out the links which shouldn't be retargetted. I didn't test this by rebuilding the world; rather, I exercised the `compress-documentation' function at the REPL, feeding it a copied gimp derivation output as it appeared before the problematic compress-documentation phase. It should be applied to core-updates since it triggers a rebuild of all the packages using the GNU build system. Maxim --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-build-system-gnu-Fix-compress-documentation-phase.patch Content-Transfer-Encoding: quoted-printable From=2081b5ade74a7debbde30a98ac5dc884844f6dfeb7 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 25 Apr 2017 01:46:05 +0900 Subject: [PATCH] build-system/gnu: Fix compress-documentation phase The compress-documentation phase was breaking recursive symbolic links used for manuals, which was made visible by the `find-files' call in the recently added `manual-database' profile hook. * guix/build/gnu-build-system.scm (retarget-symblink)[link]: Rename to `symbolic-link' (`link' is a Guile function). (points-to-symbolic-link?): Add predicate. (maybe-compress-directory): Rename `symlinks' to `symbolic-links', use `points-to-symbolic-link?' to filter out symbolic links which shouldn't be retargetted and re-order the calls to `retarget-symlink' and `documentation= -compressor'. =2D-- guix/build/gnu-build-system.scm | 47 ++++++++++++++++++++++++++++++-------= ---- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.= scm index 1786e2e3c9..778b514375 100644 =2D-- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -511,16 +511,34 @@ and 'man/'. This phase moves directories to the righ= t place if needed." "When COMPRESS-DOCUMENTATION? is true, compress man pages and Info files found in OUTPUTS using DOCUMENTATION-COMPRESSOR, called with DOCUMENTATION-COMPRESSOR-FLAGS." =2D (define (retarget-symlink link) =2D (let ((target (readlink link))) =2D (delete-file link) =2D (symlink (string-append target compressed-documentation-extension) =2D link))) + (define (retarget-symlink symbolic-link) + (let ((target (readlink symbolic-link))) + (delete-file symbolic-link) + (symlink (string-append target + compressed-documentation-extension) + symbolic-link))) =20 (define (has-links? file) ;; Return #t if FILE has hard links. (> (stat:nlink (lstat file)) 1)) =20 + (define (points-to-symbolic-link? symbolic-link) + ;; Return #t if SYMBOLIC-LINK points to another symbolic link. + (let* ((target (readlink symbolic-link)) + (target-absolute (if (string-prefix? "/" target) + (target) + (string-join `(,(dirname symbolic-link) ,t= arget) + "/")))) + (catch 'system-error + (lambda () + (symbolic-link? target-absolute)) + (lambda args + (if (=3D ENOENT (system-error-errno args)) + (format (current-error-port) "The symbolic link '~a' target = is +missing: '~a'\n" symbolic-link target-absolute) + (apply throw args)) + #f)))) + (define (maybe-compress-directory directory regexp) (or (not (directory-exists? directory)) (match (find-files directory regexp) @@ -534,16 +552,21 @@ DOCUMENTATION-COMPRESSOR-FLAGS." (call-with-values (lambda () (partition symbolic-link? files)) =2D (lambda (symlinks regular-files) + (lambda (symbolic-links regular-files) ;; Compress the non-symlink files, and adjust symlinks to r= efer ;; to the compressed files. Leave files that have hard lin= ks ;; unchanged ('gzip' would refuse to compress them anyway.) =2D (and (zero? (apply system* documentation-compressor =2D (append documentation-compressor-flags =2D (remove has-links? regular-fil= es)))) =2D (every retarget-symlink =2D (filter (cut string-match regexp <>) =2D symlinks))))))))) + ;; Also, do not retarget symbolic links pointing to other + ;; symbolic links, since these are not compressed. + (and (every retarget-symlink + (filter (lambda (s) + (and (not (points-to-symbolic-link? s= )) + (string-match regexp s))) + symbolic-links)) + (zero? + (apply system* documentation-compressor + (append documentation-compressor-flags + (remove has-links? regular-files))))))= ))))) =20 (define (maybe-compress output) (and (maybe-compress-directory (string-append output "/share/man") =2D-=20 2.12.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAlkK3fQACgkQEmDkZILm NWJeaBAAnW2fw/tM8au+/35OiB+ezwLtPxpSR87rDF/fa5m67Z4Xt2t0epKgC5FJ nBg6jhdPo515FQ8XRoD6fk3v4TPefSL1TTnZbT29j/u2mFgNHWqnEW395FJKBKEM nL+8pVB5khWbR8v7lkCfuUGfG2c3EC2Xf8zeY2KVTQi57ock+oo+zRHBre8DmLnm G888LJkCJ/BjSJZbjhGu4ujhAkD+d3DfrtN6ODlN3eXBNrfMnzXiwfqe+INdbtmp llsbPr/IAkhLLDm/Yuu8Mj4xSbCVakpZcuhNOSwj95kzrC0S9rjYkJhjKVU3/PPI QLncwFmgAg9ZYKapoyz5jjzk2favrMgL4KXJUkMc+3PO7eKRWqsdojhTjryYAeC9 IVbo4iCnW7xEqEHsAu85jJAmGKlYdxmE4nIKAYymMrU9Zyqneg73r5+ElEZCxCSw f2f77bLXw/Ji7RvFECMbsuscCC+3upwqA1Afft/8904LPrCQ5sJaelEeks2iKxHI KvDv0wogiAFE0aVEktJJFP5FBtnNZgxzKuatt5Q+3LyUdDYtLyoGtR41xF6Ju1ZA djWh1OI4GAReAcNSyf7eimoMrBHmmNjgH9xZtq5O+wRyepv1JlHdcQvfAcvM9ZTt 5p2jC9hcj9hVCEXxTnZn/Pn2jImVZTV/zg1i47f9M6HeGzTrur4= =o41X -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 30 15:59:25 2017 Received: (at 26771-done) by debbugs.gnu.org; 30 May 2017 19:59:25 +0000 Received: from localhost ([127.0.0.1]:45704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFnIb-00040Q-HF for submit@debbugs.gnu.org; Tue, 30 May 2017 15:59:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48633) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFnIZ-00040B-J3 for 26771-done@debbugs.gnu.org; Tue, 30 May 2017 15:59:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFnIQ-0003rQ-2n for 26771-done@debbugs.gnu.org; Tue, 30 May 2017 15:59:18 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFnIQ-0003rL-0J; Tue, 30 May 2017 15:59:14 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:59722 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dFnIP-0005Gm-5L; Tue, 30 May 2017 15:59:13 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Maxim Cournoyer Subject: Re: bug#26771: [PATCH] build-system/gnu: Fix compress-documentation phase References: <87h9116osr.fsf@gmail.com> Date: Tue, 30 May 2017 21:59:10 +0200 In-Reply-To: <87h9116osr.fsf@gmail.com> (Maxim Cournoyer's message of "Thu, 04 May 2017 00:53:24 -0700") Message-ID: <87ziduf75d.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26771-done Cc: 26771-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: -5.0 (-----) Hi Maxim, Maxim Cournoyer skribis: > This patch fixes a small defect in compress-documentation phase of our > gnu-build-system. The phase could create dangling manual > page symlinks in the case those were recursive. > > One package which exhibited the issue is Gimp; you might have noticed > the `find-files' error message when the manual page database gets > created on a profile generation as a consequence of that. > > Here's the Gimp example in some more details: > > * The manual pages under share/man/man1 before the documentation is > compressed: >=20=20=20 > gimp.1 -> gimp-2.8.1=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20 > gimp-2.8.1=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 > gimp-console.1 -> gimp-console-2.8.1=20=20 > gimp-console-2.8.1 -> gimp-2.8.1=20=20=20=20=20=20 > gimptool-2.0.1 > > * After the documentation is compressed: > > gimp.1 -> gimp-2.8.1.gz > gimp-2.8.1.gz > gimp-console.1 -> gimp-console-2.8.1.gz > gimp-console-2.8.1 -> gimp-2.8.1.gz > gimptool-2.0.1.gz > > We can see that the gimp-console.1 link now points to an unexisting > file. To correct the problem, a `points-to-symbolic-link?' predicate is > added and its negation is used to filter out the links which shouldn't > be retargetted. > > I didn't test this by rebuilding the world; rather, I exercised the > `compress-documentation' function at the REPL, feeding it a copied gimp > derivation output as it appeared before the problematic > compress-documentation phase. Thanks for the detailed analysis and patch! > From 81b5ade74a7debbde30a98ac5dc884844f6dfeb7 Mon Sep 17 00:00:00 2001 > From: Maxim Cournoyer > Date: Tue, 25 Apr 2017 01:46:05 +0900 > Subject: [PATCH] build-system/gnu: Fix compress-documentation phase > > The compress-documentation phase was breaking recursive symbolic links us= ed > for manuals, which was made visible by the `find-files' call in the recen= tly > added `manual-database' profile hook. > > * guix/build/gnu-build-system.scm (retarget-symblink)[link]: Rename to > `symbolic-link' (`link' is a Guile function). > (points-to-symbolic-link?): Add predicate. > (maybe-compress-directory): Rename `symlinks' to `symbolic-links', use > `points-to-symbolic-link?' to filter out symbolic links which shouldn't be > retargetted and re-order the calls to `retarget-symlink' and `documentati= on-compressor'. I pushed it as facac292808d11d5e6ea528cc7dbe93595f62c9b, where I removed the =E2=80=9Csymbolic-link=E2=80=9D renames, which I thought were unnecessa= ry and unrelated. Apologies for the delay! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue May 30 23:52:15 2017 Received: (at 26771-done) by debbugs.gnu.org; 31 May 2017 03:52:15 +0000 Received: from localhost ([127.0.0.1]:46018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFugB-0005LX-9C for submit@debbugs.gnu.org; Tue, 30 May 2017 23:52:15 -0400 Received: from mail-pg0-f47.google.com ([74.125.83.47]:33713) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFug9-0005LL-EF for 26771-done@debbugs.gnu.org; Tue, 30 May 2017 23:52:13 -0400 Received: by mail-pg0-f47.google.com with SMTP id u187so1605421pgb.0 for <26771-done@debbugs.gnu.org>; Tue, 30 May 2017 20:52:13 -0700 (PDT) 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:content-transfer-encoding; bh=LlDuSWvV0RT9JopXd7RjsIaWZNIPXo+u15cqlDW3UDI=; b=m4pduSJU58KLmofJfD3tN3KHCSmJDlNKameHiXIfvIMzWBVq12btZJgfhIQ+Vr2B8P bt3XdJLNvFiBOKhOXCBtLEJNmRc5K9V55uKm4q7u4YaRuwauhXHhesm9A0boKyR8YFDO FrCjsptr+wCd/Zf2Dc96hg9veI1kJrW/lhtyEAKhtyKAsqDtS76YXd+u+ZdbP8O/O+rs n6ewb9oXRxI10igJYe6Il3uH68/r2gbDKuPc5/6Y3yK9SFUoS6s8n1Wjr+e3Dq6V9zYS 6eOpk2kJjDEYZ/WDDmg04zdfJ50arf0SKKv/03E1BQn1+hDrB8bFFcf9P+eKQbYl0cdj 9f0Q== 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:content-transfer-encoding; bh=LlDuSWvV0RT9JopXd7RjsIaWZNIPXo+u15cqlDW3UDI=; b=WA1wRs2wuZpPLkLXv54jaL84uSShO8sXjaDaP4RMdUQAIv1KFCnj2YiR8Kiyci4gVr 5zBMCjndwtKEY15v5Mk12RZKtm7ZV7A/y847pL7wJdwc8FpIr8dcMtWIDQW6A5+ZnA5o 7kTN1PGuISf3ubuE2uNKENMVyr0qlZ8FZQZXrs+dCGojyp+F0zWMxUEY+fLNI+6u67RK yI4GJBbTfYCQjObOXXJoTQn/BH9FCDFu+3khLXH0rhyGZcMyDPCCrCNCfmMz5k0i92rP lg7VZaVBFuUzVIx/nBWIXPVT7Huyh88KISq8UdZ+1FoP6a/Vk3j6PCZQooeGlvXJNLYw HESg== X-Gm-Message-State: AODbwcDYgRD4tL33LY6W0Cbb4ltlMtBLK+njPuOrf/N8ILaYv/P3yv6x 2Sp5qsSprr+6KNEM X-Received: by 10.101.87.206 with SMTP id q14mr4765746pgr.153.1496202727289; Tue, 30 May 2017 20:52:07 -0700 (PDT) Received: from apteryx ([2601:647:4a01:bacd:c2f8:daff:fe5d:2f2f]) by smtp.gmail.com with ESMTPSA id x71sm25932152pgd.6.2017.05.30.20.52.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 May 2017 20:52:06 -0700 (PDT) From: Maxim Cournoyer To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: bug#26771: [PATCH] build-system/gnu: Fix compress-documentation phase References: <87h9116osr.fsf@gmail.com> <87ziduf75d.fsf@gnu.org> Date: Tue, 30 May 2017 20:52:05 -0700 In-Reply-To: <87ziduf75d.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 30 May 2017 21:59:10 +0200") Message-ID: <878tldsmxm.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 26771-done Cc: 26771-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: -2.3 (--) Hi Ludovic, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hi Maxim, > > Maxim Cournoyer skribis: > >> This patch fixes a small defect in compress-documentation phase of our >> gnu-build-system. The phase could create dangling manual >> page symlinks in the case those were recursive. >> >> One package which exhibited the issue is Gimp; you might have noticed >> the `find-files' error message when the manual page database gets >> created on a profile generation as a consequence of that. >> >> Here's the Gimp example in some more details: >> >> * The manual pages under share/man/man1 before the documentation is >> compressed: >>=20=20=20 >> gimp.1 -> gimp-2.8.1=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 >> gimp-2.8.1=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 >> gimp-console.1 -> gimp-console-2.8.1=20=20 >> gimp-console-2.8.1 -> gimp-2.8.1=20=20=20=20=20=20 >> gimptool-2.0.1 >> >> * After the documentation is compressed: >> >> gimp.1 -> gimp-2.8.1.gz >> gimp-2.8.1.gz >> gimp-console.1 -> gimp-console-2.8.1.gz >> gimp-console-2.8.1 -> gimp-2.8.1.gz >> gimptool-2.0.1.gz >> >> We can see that the gimp-console.1 link now points to an unexisting >> file. To correct the problem, a `points-to-symbolic-link?' predicate is >> added and its negation is used to filter out the links which shouldn't >> be retargetted. >> >> I didn't test this by rebuilding the world; rather, I exercised the >> `compress-documentation' function at the REPL, feeding it a copied gimp >> derivation output as it appeared before the problematic >> compress-documentation phase. > > Thanks for the detailed analysis and patch! > >> From 81b5ade74a7debbde30a98ac5dc884844f6dfeb7 Mon Sep 17 00:00:00 2001 >> From: Maxim Cournoyer >> Date: Tue, 25 Apr 2017 01:46:05 +0900 >> Subject: [PATCH] build-system/gnu: Fix compress-documentation phase >> >> The compress-documentation phase was breaking recursive symbolic links u= sed >> for manuals, which was made visible by the `find-files' call in the rece= ntly >> added `manual-database' profile hook. >> >> * guix/build/gnu-build-system.scm (retarget-symblink)[link]: Rename to >> `symbolic-link' (`link' is a Guile function). >> (points-to-symbolic-link?): Add predicate. >> (maybe-compress-directory): Rename `symlinks' to `symbolic-links', use >> `points-to-symbolic-link?' to filter out symbolic links which shouldn't = be >> retargetted and re-order the calls to `retarget-symlink' and `documentat= ion-compressor'. > > I pushed it as facac292808d11d5e6ea528cc7dbe93595f62c9b, where I removed > the =E2=80=9Csymbolic-link=E2=80=9D renames, which I thought were unneces= sary and > unrelated. Thanks! > Apologies for the delay! No need for apologies! I can't say my responses are very timely either, so I understand. I'm rather amazed at how you seemingly manage to keep pace with all the activity happening around here (same goes for rekado, lfam and the other most active maintainers/contributors). Hats off to all of you! Maxim From unknown Sat Sep 20 13:35:45 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 28 Jun 2017 11: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