From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28855 invoked from network); 30 Mar 2021 20:30:30 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 30 Mar 2021 20:30:30 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 6efcd909 for ; Tue, 30 Mar 2021 15:30:24 -0500 (EST) Received: from scc-mailout-kit-01.scc.kit.edu (scc-mailout-kit-01.scc.kit.edu [129.13.231.81]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id b79b39b3 for ; Tue, 30 Mar 2021 15:30:24 -0500 (EST) Received: from hekate.asta.kit.edu ([141.3.145.153] helo=hekate.usta.de) by scc-mailout-kit-01.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1lRL0I-0006AB-5Y; Tue, 30 Mar 2021 22:30:22 +0200 Received: from donnerwolke.asta.kit.edu ([141.3.145.61] helo=donnerwolke.usta.de) by hekate.usta.de with esmtp (Exim 4.92.2) (envelope-from ) id 1lRL0G-0001ma-Gr; Tue, 30 Mar 2021 22:30:20 +0200 Received: from athene.asta.kit.edu ([141.3.145.60] helo=athene.usta.de) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1lRL0G-0005Gu-AO; Tue, 30 Mar 2021 22:30:20 +0200 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 57d7abfd; Tue, 30 Mar 2021 22:30:20 +0200 (CEST) Date: Tue, 30 Mar 2021 22:30:20 +0200 From: Ingo Schwarze To: sternenseemann@systemli.org Cc: tech@mandoc.bsd.lv Subject: Re: [PATCH makewhatis] add NIXSTOREDIR configuration variable to support NixOS Message-ID: <20210330203020.GA94101@athene.usta.de> References: <8bce7cc9-954e-1c28-ee25-13969f66eb20@systemli.org> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8bce7cc9-954e-1c28-ee25-13969f66eb20@systemli.org> User-Agent: Mutt/1.12.2 (2019-09-21) Hi Lukas, Earendil wrote on Tue, Mar 30, 2021 at 09:49:49PM +0200: > On NixOS there is a similar situation as with Hombrew: The actual > man pages are installed into custom prefixes for each package under > /nix/store and then symlinked to in the global share/man directory > (which is /run/current-system/sw/share/man for NixOS). This of course > makes makewhatis skip every installed man page when indexing because > /nix/store is considered outside of the man directory. Uh oh. I must admit i found this "cellar" concept so weird and unusual that i didn't anticipate any other system doing anything similar, and hence the overly specific naming of the feature. Then again, if i read the commit logs correctly, it did take six years until the second system (among about two dozen being actively maintained) turned up that uses such a method... > To fix this issue I've followed the implementation of HOMEBREWDIR. The > drawback of this being that more or less the same code is duplicated for > this purpose. However there may be a (arguably very small) group of > users who would possibly want to use both configuration variables at the > same time as the nix package manager can also be installed on macOS, but > it would probably also not do any harm merging the two variables into one. Indeed. Using two package managers on the same machine at the same time is no doubt a recipe for disaster, and i expect getting the manual pages indexed will be the least of your worries... So i'm not really convinced having *two* such variables with identical functionality makes anything better. Would simply setting HOMEBREWDIR=/nix/store be OK with you? We could of course rename the variable to something more generic, *if* a generic name for this concepts exists or can be invented in a reasonable way. > This patch is necessary to provide a mandoc-based alternative to the > current documentation.man module in NixOS which uses GNU's man-db > package. I have a working implementation of this (using a cvs version of > mandoc with this patch applied) here: Nice. :-) > https://github.com/openlab-aux/vuizvui/blob/master/modules/user/sternenseemann/documentation/mandoc.nix To speed up the reply - i caused enough delay already - i refrained from studying your code so far. > A side note: During testing I haven't been able to trigger the code path > of the ifdef in filescan. I've added it anyways because HOMEBREWDIR also > has been added there, but didn't seem to be a situation where basedir is > set and filescan is called, but maybe I missed something. To reach the filescan() function, you need to call makewhatis with the -d, -u, or -t option. Unless i misunderstand my own code (after it required little maintenance effort for a number of years), using -d or -u will indeed frst call set_basedir() and then filescan() shortly afterwards, see the function mandocdb() in the file mandocdb.c. Yours, Ingo -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv