From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uEOtLhU8eGFboAAAgWs5BA (envelope-from ) for ; Tue, 26 Oct 2021 19:34:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 8NNmKhU8eGEAKgAA1q6Kng (envelope-from ) for ; Tue, 26 Oct 2021 17:34:13 +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 7C42D10281 for ; Tue, 26 Oct 2021 19:34:13 +0200 (CEST) Received: from localhost ([::1]:35066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfQKy-000063-M1 for larch@yhetil.org; Tue, 26 Oct 2021 13:34:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfQKp-000050-VF for guix-patches@gnu.org; Tue, 26 Oct 2021 13:34:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfQKo-0002hS-En for guix-patches@gnu.org; Tue, 26 Oct 2021 13:34:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mfQKo-0006Yy-82 for guix-patches@gnu.org; Tue, 26 Oct 2021 13:34:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51416] [PATCH] profiles: Build the man database only if 'man-db' is in the profile. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 26 Oct 2021 17:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51416 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51416@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163526962625203 (code B ref -1); Tue, 26 Oct 2021 17:34:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 Oct 2021 17:33:46 +0000 Received: from localhost ([127.0.0.1]:47448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfQKY-0006YR-2L for submit@debbugs.gnu.org; Tue, 26 Oct 2021 13:33:46 -0400 Received: from lists.gnu.org ([209.51.188.17]:38234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfQKW-0006YJ-DK for submit@debbugs.gnu.org; Tue, 26 Oct 2021 13:33:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfQKW-0008NK-6Q for guix-patches@gnu.org; Tue, 26 Oct 2021 13:33:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfQKU-0002WV-UB; Tue, 26 Oct 2021 13:33:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=eCodT/LNswAzcJh1vnigMQw5lzE49f/P4URfsvGufSs=; b=nutXGnPWad6OxF 9nzCYS87VuCafXbMW/sWf20anL57Ra2J6nwl2PY5ux6nw6VvDaa1HG89enfnR4MeS1tsG7fD6PCWj Q8G1RzWNxLbQEfqWj1TMCyfLpGX7JK4BKjwzhRsvCrnQje8zLhGvl9voeQlCmX3HbtObl2YzB9zXO /sVO5umAAUSznGcMdjA+TPph5WFR0QcSaaxNuYhYZNySr4o8H8P7RHym4SRF0Wv5hsh2uBdLHpU2J Cd33VijcMvcKe8BPf+4kE6/8xLtGNNYBYU/IGXvLbnhxXpGZ14ATRyO2/FHvpZ+ejvnhcvmXyPjDO PzlIdZc5oeHBzkFLukkQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:54222 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfQKT-0005rP-H9; Tue, 26 Oct 2021 13:33:41 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 26 Oct 2021 19:33:28 +0200 Message-Id: <20211026173328.21511-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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=1635269653; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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=eCodT/LNswAzcJh1vnigMQw5lzE49f/P4URfsvGufSs=; b=Mwu5PGaP0mgHQO2bvO9ANBEAy2iRSbnuK9dT4epa97bXqFm5rTDtKUN7nl6PZ1algSf/yB PXwjCSfIvUGPqREFXtXU3PyWnBJuYmrHch8O41zF1Jm56EuQpWpr/Er3WLm6FxnyFLBpt8 cg0Y5+o6mNKF/vHjGY7qZZisi/T+R1vrHHtelFIL/jXei7NdRxTq5TGX5Z+xu9ny0nU7WY l9eLAdREa6cwfv+N81VYJXqutOuOqcDlS/3c7NsvN3BB6zCrL/8Pv8TzytVd3UcE0cZwbV lbTQSuZW63DmSCfCzgmjhq9mPrUlaIcIqhGQcTzaCnrzoUgcCG8nt5Peee6b6w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635269653; a=rsa-sha256; cv=none; b=r2lOAGBI5YIjqcZn9amX3puUA6ttmdCuow3Hj+8+AdIpdTf4+7zSXNszdQPKSNAZKoKFg2 3Bx3OCb3vshTMEfoMxMiJVgKvB0b/r/jhpkj889C02BM/M/oyfslOHXTGGrNOgoc3xwV1V hwLD0/W9yFObw0KtfRChILIjZnaloxsyMazWAYODELju1UBaqrPWce7Jo4hZr1ksnXaWBm ITFd6tIGKCOS84CFIe3P5wIX59uSe2DFU/vGIfr4tRikHonFgY3MabYgwkKrVQJBzgqFEs Ks1L6OkMPwd0RC+o4SIMHpMraHDSRCfRcTM7fYYO1lQ4qUVdtt2lCP38NUWLZA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nutXGnPW; dmarc=pass (policy=none) header.from=gnu.org; 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: -1.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nutXGnPW; dmarc=pass (policy=none) header.from=gnu.org; 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: 7C42D10281 X-Spam-Score: -1.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: KkL7LvTPvXva This allows us to skip the expensive man-db profile hook in most cases. Suggested by Liliana Marie Prikler . * guix/profiles.scm (manual-database/optional): New procedure. (%default-profile-hooks): Use it instead of 'manual-database'. --- guix/profiles.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) Hi! As y’all know, computing the manual page database is CPU- and I/O-intensive and thus a good candidate for removal, as discussed earlier¹. I would prefer to provide a replacement for the ‘man -k’ functionality, such as a Xapian-based full-text search². Now, this hasn’t materialized yet, but I feel it’s about time to remove that hook. The other day Liliana came with a smart idea on IRC: to build the database only when ‘man-db’ is also in the profile. It’s a good way to not quite make a decision :-), but it’s going to address the main pain point. Thoughts? Thanks, Ludo’. ¹ https://lists.gnu.org/archive/html/guix-devel/2020-12/msg00052.html Thread continues in January and March. ² https://lists.gnu.org/archive/html/guix-devel/2021-04/msg00027.html diff --git a/guix/profiles.scm b/guix/profiles.scm index 9f30349c69..ffdd5f57f6 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1682,6 +1682,16 @@ (define man-directory `((type . profile-hook) (hook . manual-database)))) +(define (manual-database/optional manifest) + "Return a derivation to build the manual database of MANIFEST, but only if +MANIFEST contains the \"man-db\" package. Otherwise, return #f." + ;; Building the man database (for "man -k") is expensive and rarely used. + ;; Build it only if the profile also contains "man-db". + (mlet %store-monad ((man-db (manifest-lookup-package manifest "man-db"))) + (if man-db + (manual-database manifest) + (return #f)))) + (define (texlive-configuration manifest) "Return a derivation that builds a TeXlive configuration for the entries in MANIFEST." @@ -1784,7 +1794,7 @@ (define %default-profile-hooks ;; This is the list of derivation-returning procedures that are called by ;; default when making a non-empty profile. (list info-dir-file - manual-database + manual-database/optional fonts-dir-file ghc-package-cache-file ca-certificate-bundle base-commit: 0a42998a50e8bbe9e49142b21a570db00efe7491 -- 2.33.0