From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 03 15:57:33 2015 Received: (at submit) by debbugs.gnu.org; 3 Feb 2015 20:57:33 +0000 Received: from localhost ([127.0.0.1]:33158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YIkXN-000264-Av for submit@debbugs.gnu.org; Tue, 03 Feb 2015 15:57:33 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34281) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YIkXH-00025o-J4 for submit@debbugs.gnu.org; Tue, 03 Feb 2015 15:57:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIkX7-0001Lw-JD for submit@debbugs.gnu.org; Tue, 03 Feb 2015 15:57:22 -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.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:37961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIkX7-0001Lg-Gj for submit@debbugs.gnu.org; Tue, 03 Feb 2015 15:57:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIkX6-0005x5-9N for bug-guix@gnu.org; Tue, 03 Feb 2015 15:57:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIkX1-0001Cx-P3 for bug-guix@gnu.org; Tue, 03 Feb 2015 15:57:16 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIkX1-0001Cr-LR; Tue, 03 Feb 2015 15:57:11 -0500 Received: from reverse-83.fdn.fr ([80.67.176.83]:33970 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YIkX0-0006aO-TW; Tue, 03 Feb 2015 15:57:11 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: sleep_walker@suse.cz Subject: Re: ignore trailing slash for `guix gc -d' /gnu/store/...something/ References: <20150202233426.GA28580@venom.fritz.box> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 15 =?utf-8?Q?Pluvi=C3=B4se?= an 223 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Tue, 03 Feb 2015 21:57:04 +0100 In-Reply-To: <20150202233426.GA28580@venom.fritz.box> (sleep walker's message of "Tue, 3 Feb 2015 00:34:26 +0100") Message-ID: <87wq3yogrj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (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: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: guix-devel@gnu.org, bug-guix@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (-----) sleep_walker@suse.cz skribis: > Package: guix > Version: 0.8.1 > > When I invoke `guix gc -d /path', success of the command depends whether = /path ends with slash or not: > > $ guix gc -d /gnu/store/mgqk0kv5jckrd7l5cwj68fp7cz2l4qqj-luajit-2.0.3/ > guix gc: error: build failed: path `/gnu/store/mgqk0kv5jckrd7l5cwj68fp7cz= 2l4qqj-luajit-2.0.3/' is not in the Nix store > > $ guix gc -d /gnu/store/mgqk0kv5jckrd7l5cwj68fp7cz2l4qqj-luajit-2.0.3 > finding garbage collector roots... > cannot read potential root `/var/guix/manifests' > deleting `/gnu/store/73b760g2nr9syhznydgly8r7vl2k9z11-profile' > deleting `/gnu/store/mgqk0kv5jckrd7l5cwj68fp7cz2l4qqj-luajit-2.0.3' > deleting `/gnu/store/trash' > deleting unused links... > note: currently hard linking saves 247.60 MiB > > > * with the misleading error message it is usability bug > * it should be safe always try to remove slash from the end > * other commands may be affected too and the behaviour should be consiste= nt for all commands What behavior do you think would be appropriate when running, say: guix gc -d /gnu/store/mgqk0kv5jckrd7l5cwj68fp7cz2l4qqj-luajit-2.0.3/bin/l= ua Should it be equivalent to: guix gc -d /gnu/store/mgqk0kv5jckrd7l5cwj68fp7cz2l4qqj-luajit-2.0.3 I would think so, but I=E2=80=99d like to have feedback. Thanks, Ludo=E2=80=99. PS: Make sure to use bug-guix@gnu.org for bug reports. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 25 15:25:01 2015 Received: (at submit) by debbugs.gnu.org; 25 Feb 2015 20:25:02 +0000 Received: from localhost ([127.0.0.1]:58075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQiVx-00031c-5H for submit@debbugs.gnu.org; Wed, 25 Feb 2015 15:25:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49448) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQiVv-00031O-5J for submit@debbugs.gnu.org; Wed, 25 Feb 2015 15:24:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQiVp-0008IX-3R for submit@debbugs.gnu.org; Wed, 25 Feb 2015 15:24:53 -0500 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_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQiVp-0008IT-0u for submit@debbugs.gnu.org; Wed, 25 Feb 2015 15:24:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQiVo-0007o5-1o for bug-guix@gnu.org; Wed, 25 Feb 2015 15:24:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQiVj-0008Hv-3a for bug-guix@gnu.org; Wed, 25 Feb 2015 15:24:52 -0500 Received: from cantor2.suse.de ([195.135.220.15]:60342 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQiVi-0008Hr-UX; Wed, 25 Feb 2015 15:24:47 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2538DAB09; Wed, 25 Feb 2015 20:24:46 +0000 (UTC) Date: Wed, 25 Feb 2015 21:24:45 +0100 From: =?utf-8?B?VG9tw6HFoSDEjGVjaA==?= To: guix-devel@gnu.org, bug-guix@gnu.org Subject: Re: ignore trailing slash for `guix gc -d' /gnu/store/...something/ Message-ID: <20150225202445.GA10407@venom> Mail-Followup-To: guix-devel@gnu.org, bug-guix@gnu.org References: <20150202233426.GA28580@venom.fritz.box> <87wq3yogrj.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <87wq3yogrj.fsf@gnu.org> User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (-----) --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Sorry for late response. On Tue, Feb 03, 2015 at 09:57:04PM +0100, Ludovic Court=C3=A8s wrote: >sleep_walker@suse.cz skribis: > >> Package: guix >> Version: 0.8.1 >> >> When I invoke `guix gc -d /path', success of the command depends whether= /path ends with slash or not: >> >> $ guix gc -d /gnu/store/mgqk0kv5jckrd7l5cwj68fp7cz2l4qqj-luajit-2.0.3/ >> guix gc: error: build failed: path `/gnu/store/mgqk0kv5jckrd7l5cwj68fp7c= z2l4qqj-luajit-2.0.3/' is not in the Nix store >> >> $ guix gc -d /gnu/store/mgqk0kv5jckrd7l5cwj68fp7cz2l4qqj-luajit-2.0.3 >> finding garbage collector roots... >> cannot read potential root `/var/guix/manifests' >> deleting `/gnu/store/73b760g2nr9syhznydgly8r7vl2k9z11-profile' >> deleting `/gnu/store/mgqk0kv5jckrd7l5cwj68fp7cz2l4qqj-luajit-2.0.3' >> deleting `/gnu/store/trash' >> deleting unused links... >> note: currently hard linking saves 247.60 MiB >> >> >> * with the misleading error message it is usability bug >> * it should be safe always try to remove slash from the end >> * other commands may be affected too and the behaviour should be consist= ent for all commands > >What behavior do you think would be appropriate when running, say: > > guix gc -d /gnu/store/mgqk0kv5jckrd7l5cwj68fp7cz2l4qqj-luajit-2.0.3/bin/= lua > >Should it be equivalent to: > > guix gc -d /gnu/store/mgqk0kv5jckrd7l5cwj68fp7cz2l4qqj-luajit-2.0.3 > >I would think so, but I=E2=80=99d like to have feedback. I think so as well. > >Thanks, >Ludo=E2=80=99. > >PS: Make sure to use bug-guix@gnu.org for bug reports. Sorry about that, I'm still getting used to GNU's bugtracker... --zYM0uCDKw75PZbzx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlTuL40ACgkQ37XrCapiVCO6CQCdEexeranGGgvtWcf+Ml3FhXC7 oqMAniZvJSkEhK4j42kP4uPshtxrYIOD =1xNK -----END PGP SIGNATURE----- --zYM0uCDKw75PZbzx-- From debbugs-submit-bounces@debbugs.gnu.org Sun May 24 13:13:20 2015 Received: (at 19757) by debbugs.gnu.org; 24 May 2015 17:13:20 +0000 Received: from localhost ([127.0.0.1]:54928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YwZSe-0001E6-Bw for submit@debbugs.gnu.org; Sun, 24 May 2015 13:13:20 -0400 Received: from mail-wg0-f42.google.com ([74.125.82.42]:36180) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YwUe5-0005Hf-NE for 19757@debbugs.gnu.org; Sun, 24 May 2015 08:04:49 -0400 Received: by wgbgq6 with SMTP id gq6so52765812wgb.3 for <19757@debbugs.gnu.org>; Sun, 24 May 2015 05:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type:content-disposition; bh=6kko9VXzZG+T/LXLzLq50aU8wIN4l4udc51vaGt1M1Q=; b=jokFcIeOABbqrdh4biqAu+06lR+bH6Lc5topUL3daoyXJOtgrWiM+ATF+rsta8pZO6 zq/c8CS6XgN5yHHf880q3x46NjT8fzR4p/cDI5y/SlOe3fWIgvD7F1hpgCBoq508c8lq Ey6DeTECSl36u7b7XozB7kQTwjTVk6wdQK7H9xpe3++kXAJLrBCtcSWRYCHwZE8hMUwb na2uXHLd+s8cqNceUUbehYFyLOPGvI14U1T4hZwLn3PWSSrabUjAJgNZkLQ4GrhY+uoc lEJaLEdJTiSMU9CX7wp2gihMt1OqitN3vMtFjucPsOQmQKvnJIQWKcjp2TGVSlkzhmNV 92/A== X-Received: by 10.194.91.176 with SMTP id cf16mr30497615wjb.141.1432469079930; Sun, 24 May 2015 05:04:39 -0700 (PDT) Received: from SIRIUS11.sirius11 ([2a02:120b:c3f1:1020:21f:16ff:fe32:d751]) by mx.google.com with ESMTPSA id mv11sm6927352wic.23.2015.05.24.05.04.38 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 24 May 2015 05:04:39 -0700 (PDT) From: Cyrill Schenkel To: bug-guix@gnu.org, 19757@debbugs.gnu.org Subject: [PATCH] gc: ignore trailing slash or subdirectories for `guix gc -d' References: <20150202233426.GA28580@venom.fritz.box> <87wq3yogrj.fsf@gnu.org> <20150225202445.GA10407@venom> Date: Sun, 24 May 2015 14:04:15 +0200 In-Reply-To: <20150225202445.GA10407@venom> (=?utf-8?B?IlRvbcOhxaEgxIxl?= =?utf-8?B?Y2giJ3M=?= message of "Wed, 25 Feb 2015 21:24:45 +0100") Message-ID: <87y4kekwqo.fsf_-_@SIRIUS11.sirius11> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gc-ignore-trailing-slash-or-subdirectories-for-guix-.patch X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19757 X-Mailman-Approved-At: Sun, 24 May 2015 13:13:14 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.7 (/) >From 7385c2ddd4ca50cb80afcd315287eaadff4d8421 Mon Sep 17 00:00:00 2001 From: Cyrill Schenkel Date: Sun, 24 May 2015 13:46:37 +0200 Subject: [PATCH] gc: ignore trailing slash or subdirectories for `guix gc -d' Fixes . * guix/scripts/gc.scm (guix-gc): Convert paths to direct store paths. * guix/store.scm (direct-store-path): Get rid of subdirectories in store path. * tests/guix-gc.sh: New tests. --- guix/scripts/gc.scm | 2 +- guix/store.scm | 7 +++++++ tests/guix-gc.sh | 20 ++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm index 4bae65a..a250cdc 100644 --- a/guix/scripts/gc.scm +++ b/guix/scripts/gc.scm @@ -168,7 +168,7 @@ Invoke the garbage collector.\n")) (collect-garbage store min-freed) (collect-garbage store)))) ((delete) - (delete-paths store paths)) + (delete-paths store (map direct-store-path paths))) ((list-references) (list-relatives references)) ((list-requisites) diff --git a/guix/store.scm b/guix/store.scm index fc2f8d9..98b293b 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -121,6 +121,7 @@ derivation-path? store-path-package-name store-path-hash-part + direct-store-path log-file)) (define %protocol-version #x10c) @@ -1038,6 +1039,12 @@ syntactically valid store path." (and=> (regexp-exec path-rx path) (cut match:substring <> 1)))) +(define (direct-store-path path) + "Return the direct store path part of PATH." + (let* ((minimal-prefix-length (+ (string-length (%store-prefix)) 35)) + (slash-index (string-index path #\/ minimal-prefix-length))) + (if slash-index (string-take path slash-index) path))) + (define (log-file store file) "Return the build log file for FILE, or #f if none could be found. FILE must be an absolute store file name, or a derivation file name." diff --git a/tests/guix-gc.sh b/tests/guix-gc.sh index eac9d82..c1eb66c 100644 --- a/tests/guix-gc.sh +++ b/tests/guix-gc.sh @@ -64,3 +64,23 @@ guix gc -C 1KiB # Check trivial error cases. if guix gc --delete /dev/null; then false; else true; fi + +# Bug #19757 +out="`guix build guile-bootstrap`" +test -d "$out" + +guix gc --delete "$out" + +! test -d "$out" + +out="`guix build guile-bootstrap`" +test -d "$out" + +guix gc --delete "$out/" + +! test -d "$out" + +out="`guix build guile-bootstrap`" +test -d "$out" + +guix gc --delete "$out/bin/guile" -- 2.1.4 From debbugs-submit-bounces@debbugs.gnu.org Tue May 26 16:27:45 2015 Received: (at 19757-done) by debbugs.gnu.org; 26 May 2015 20:27:45 +0000 Received: from localhost ([127.0.0.1]:57425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YxLRx-0002JK-15 for submit@debbugs.gnu.org; Tue, 26 May 2015 16:27:45 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:49178 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YxLRv-0002JD-90 for 19757-done@debbugs.gnu.org; Tue, 26 May 2015 16:27:44 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:49863 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YxLRu-0003zl-BG; Tue, 26 May 2015 16:27:42 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Cyrill Schenkel Subject: Re: bug#19757: [PATCH] gc: ignore trailing slash or subdirectories for `guix gc -d' References: <20150202233426.GA28580@venom.fritz.box> <87wq3yogrj.fsf@gnu.org> <20150225202445.GA10407@venom> <87y4kekwqo.fsf_-_@SIRIUS11.sirius11> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 Prairial an 223 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x3D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Tue, 26 May 2015 22:27:40 +0200 In-Reply-To: <87y4kekwqo.fsf_-_@SIRIUS11.sirius11> (Cyrill Schenkel's message of "Sun, 24 May 2015 14:04:15 +0200") Message-ID: <87y4kbkrsz.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 19757-done Cc: 19757-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (-----) Cyrill Schenkel skribis: > From 7385c2ddd4ca50cb80afcd315287eaadff4d8421 Mon Sep 17 00:00:00 2001 > From: Cyrill Schenkel > Date: Sun, 24 May 2015 13:46:37 +0200 > Subject: [PATCH] gc: ignore trailing slash or subdirectories for `guix gc= -d' > > Fixes . > > * guix/scripts/gc.scm (guix-gc): Convert paths to direct store paths. > * guix/store.scm (direct-store-path): Get rid of subdirectories in store = path. > * tests/guix-gc.sh: New tests. Applied, thank you! I tweaked =E2=80=98direct-store-path=E2=80=99 so that it gracefully handles= non-store file names such as =E2=80=9C/dev/null=E2=80=9D. Ludo=E2=80=99. From unknown Mon Jun 23 13:11:17 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, 24 Jun 2015 11:24:05 +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