From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aEPAGzrZeGFYaQAAgWs5BA (envelope-from ) for ; Wed, 27 Oct 2021 06:44:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id kCl6FzrZeGENLgAAB5/wlQ (envelope-from ) for ; Wed, 27 Oct 2021 04:44:42 +0000 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 1D39C2A737 for ; Wed, 27 Oct 2021 06:44:42 +0200 (CEST) Received: from localhost ([::1]:42504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfZxZ-0006Pl-0z for larch@yhetil.org; Tue, 26 Oct 2021 23:50:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfZwx-0006Ov-71 for guix-patches@gnu.org; Tue, 26 Oct 2021 23:50:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36507) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfZww-0004vH-UA for guix-patches@gnu.org; Tue, 26 Oct 2021 23:50:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mfZww-0003G8-M1 for guix-patches@gnu.org; Tue, 26 Oct 2021 23:50:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51427] [PATCH] nix: libstore: Do not remove unused links when deleting specific items. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 Oct 2021 03:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51427 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51427@debbugs.gnu.org Cc: Maxim Cournoyer X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163530657612481 (code B ref -1); Wed, 27 Oct 2021 03:50:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Oct 2021 03:49:36 +0000 Received: from localhost ([127.0.0.1]:48053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfZwW-0003FF-8W for submit@debbugs.gnu.org; Tue, 26 Oct 2021 23:49:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:45178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfZwU-0003F5-7K for submit@debbugs.gnu.org; Tue, 26 Oct 2021 23:49:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfZwT-0005tm-Vi for guix-patches@gnu.org; Tue, 26 Oct 2021 23:49:33 -0400 Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b]:36748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfZwQ-0004tn-9B for guix-patches@gnu.org; Tue, 26 Oct 2021 23:49:32 -0400 Received: by mail-qv1-xf2b.google.com with SMTP id d6so969218qvb.3 for ; Tue, 26 Oct 2021 20:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=USc2GRKlyZftlRGTlOFFKvKPqCXluZ/pmB5TfjQX7WE=; b=bCDR8WY99Pou8uT3lDKvjBN5u/6W4B3lk4G7ZlbYFqBexSkLpEeXC6KRk21Aq7kSPd PtCwgAU4m+YWqbyL6xqwaamG9eabHAJjiWLWlZ8SlO+UopxijpvuVEvVrfMxbQ62ciaP d4iERC6+DJ9eynJeKukWD/WKN+htz67CdkBgbY753KdKtL60F8EuC5gkayUxa+KgTJq5 fsbq9ZQV94Csyn9mHjUicV3DWNe0jk/W9IfmyTsmX3mRj13WkWOfUVWmPzT+ONWDHhQn qt483AKIEoSrog5L/WtwaY592ULL5oqhVn5xXyiae0genWL12kgqYIxHjLELTGx5c+1e JRGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=USc2GRKlyZftlRGTlOFFKvKPqCXluZ/pmB5TfjQX7WE=; b=IZKDac5J/NNhQjbFMQrxCj9ykKxlfr2mMtyBQ1UumXb7aZ40iv/+/T17oQdO4OvIqx /cX0K9vUBnGBRbExdNr77e9lDGnNvuiKhYZAZZHQD0TxJCelDDNGPmOs7UF3y+iewPzY Imn70GlLLklCqLWTS9JjK1fJDHsIfQcu5qk++UXqr0hhr9HmTlzKKBd1d4dL3WtwnhtX e4JOSgKhRfpEO05haQlgSiwy1gNyk0u24L0hM1IRfjiWxeh1xKBX5ByP7/WkSrQlCWWw gCVKWKOhXEjOX/DhMb7VqRR58jkZ869lTzk2G4KUgCne5ItvuMECls+EXAtyJvj7mhqN bt2w== X-Gm-Message-State: AOAM533UnQGt6thXSrBRj+Q6po16cQTj+9QYMZmKQPQgRMret+ouQnoY DOR7KMe5nQaye9fFAjYfX1d0yzeZvOk= X-Google-Smtp-Source: ABdhPJxeScrHBJgPbN4GobvrNZtvlJjPcqjZBcaqt4818K90bM6ysGTOUp9xZZ6v+a1P3arUXZZAtg== X-Received: by 2002:a05:6214:80f:: with SMTP id df15mr4159708qvb.37.1635306568933; Tue, 26 Oct 2021 20:49:28 -0700 (PDT) Received: from localhost.localdomain (dsl-10-133-98.b2b2c.ca. [72.10.133.98]) by smtp.gmail.com with ESMTPSA id e4sm12715171qty.59.2021.10.26.20.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 20:49:28 -0700 (PDT) From: Maxim Cournoyer Date: Tue, 26 Oct 2021 23:49:18 -0400 Message-Id: <20211027034918.4591-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::f2b; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf2b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635309882; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=USc2GRKlyZftlRGTlOFFKvKPqCXluZ/pmB5TfjQX7WE=; b=RMAL6nAyvtI6kGBm4BsQgGyBsr0dxneoHbqza2oUmjlM3xmlA8peYWvSKqm9NJE1tmq113 rvQguaxHxhFgkR6AuZn5Gom/w3iKHg3zAjwgWCqMx9cupeiMJDeYd+feLAQrfnfoqW+7PJ iMcTW0OILKJLOH3mmeVZMcqV3mMJZ7owJL4oIbwwNzRtZHQD2wibwmZ5CJD4M+yjArCoHU YRz7dEuVUnrbYXNhfhi/Wdq+Jr/30zIA7MrNyRv0mvv/bFsSloaWeU2esnJbsu4PJjELsl fpEy0yU1t3+HlGdjQyv5YvaPpJBlapqOppECIcewaVQCuKKPq3u68PWyzaWZUA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635309882; a=rsa-sha256; cv=none; b=nahThe0l7iLu7eXr75aS5nknU9vfb0kfrWq8kmXpAhxef9mujkJgE/yN87ho8oJqXulTaR s5pzrpXDkcHq4r8ZPJ9e0m5JKXVcSOaYOztLO5uHgrv56X31nbZ9X6WwQQPNmlJQZg+u+3 F8nAdXOd4h7CjQOAwiJmOwYs+qgEPAtXzwuJ6Q1s+gl8+fHFqcXE4hKuI/gXI1O9g/vIDN U3MODj/B/Ex9flMqinUQcDE/47Q3EfrIcmIq0dSDJBkvvS/tLjYjRwau8mm+1KqkLZYmvg 4CCs3GHLjNn5NEYIUrgdSpy9RaCDpwaqRzM2WfIGxKThuDEkjo5fAtCznWlmmQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=bCDR8WY9; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 4.17 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=bCDR8WY9; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 1D39C2A737 X-Spam-Score: 4.17 X-Migadu-Scanner: scn0.migadu.com X-TUID: x/6BsTVv9qDS Deleting unused links can be a very costly operation, especially on rotative hard drives. As removing single store items is often used for experimentation rather than for cleaning purposes, this change allows it to run without the links cleanup. * nix/libstore/gc.cc (LocalStore::collectGarbage): Do not clean up links when the specified action is GCOptions::gcDeleteSpecific. --- nix/libstore/gc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/libstore/gc.cc b/nix/libstore/gc.cc index e1d0765154..7d872d8cc1 100644 --- a/nix/libstore/gc.cc +++ b/nix/libstore/gc.cc @@ -771,7 +771,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results) deleteGarbage(state, state.trashDir); /* Clean up the links directory. */ - if (options.action == GCOptions::gcDeleteDead || options.action == GCOptions::gcDeleteSpecific) { + if (options.action == GCOptions::gcDeleteDead) { printMsg(lvlError, format("deleting unused links...")); removeUnusedLinks(state); } -- 2.33.1