From nobody Thu Nov 25 14:23:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A577018B55D9; Thu, 25 Nov 2021 14:23:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J0Kqd5BNYz3Lws; Thu, 25 Nov 2021 14:23:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (nours.eu [IPv6:2001:41d0:8:3a4d::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 570B0B416; Thu, 25 Nov 2021 14:23:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 3D20A5064B; Thu, 25 Nov 2021 15:23:39 +0100 (CET) Date: Thu, 25 Nov 2021 15:23:39 +0100 From: Baptiste Daroussin To: Andriy Gapon Cc: Fernando =?utf-8?Q?Apestegu=C3=ADa?= , Ed Maste , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 0a0f7486413c - main - man: Build manpages for all architectures Message-ID: <20211125142339.zxkjpbohkxk4hete@aniel.nours.eu> References: <202106300806.15U86pGq037942@gitrepo.freebsd.org> <20210706090311.aomxh4n45tkpktdc@aniel.nours.eu> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637850221; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=/hbw1hTKRzYyWPQ1dD/LmHcCKAOAEIslICKKtqXCv5A=; b=JO8v6Lks95DvuM++iF5hmb44/nFnjuQvNsykOuyCyOFrPrkVVyes85wKmdUsXXOhN3ZdVL ycniNvoj8KGzb9P+M6pnbh2Elexq45USRwzOi4q5Ov4PaAqWLp2/+nhs7MgKzbOZw+L1TD ChtUmnMdqQXNzaXcjlgqIehYkYzZ18ZqLAWZH4oc6LwspIA5E9dvMeWIbTyabhwkvUmfwv dJIDXrnMArJfjK6eA/dKQqTDJugV7QkF6EIRFTcVC4SdwH6ySppAGJnGBUcYQfPbnITwZh IZRF606x7Bqk0UA5/E0QRUwBGR6HueeSlzewBMN+SE2zTwVzieF1DRp5mhmG+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637850221; a=rsa-sha256; cv=none; b=NpbObUUmmHbEXf9CKHSYz1NBOkbjieMZfC6xtJz1AF9AxOpMyM9LCvYbqAcosWKrkfb3nr Q+WiofJvLxFOFTrs+KpPdGAfmlstSGzH1Obkc3IDoXVjlLfW3LyZZugMdm2gjmXGQOFthp VPor+bD2C1bj78dbJoKadFKh2vOBA9Hm1QT7RHAUNB4AHV86J2C8riS3eeGZw31aNyjBY/ ixSVUckR0CnPBwt45IMuxXh09nGBpWNYXnwSlWOChICcTJzSMK8+g5PKFeoiRoJay2PQzL FFp79FVSHHN1zzBygTxbR7oHmgdO2gWl0oUxoTyeF1pV76SRE1PPRhxCwQat+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Thu, Nov 25, 2021 at 03:57:41PM +0200, Andriy Gapon wrote: > On 06/07/2021 12:03, Baptiste Daroussin wrote: > > On Wed, Jun 30, 2021 at 08:06:51AM +0000, Fernando Apesteguía wrote: > > > The branch main has been updated by fernape (doc, ports committer): > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=0a0f7486413c147d56808b38055c40c64cff61f5 > > > > > > commit 0a0f7486413c147d56808b38055c40c64cff61f5 > > > Author: Fernando Apesteguía > > > AuthorDate: 2021-06-09 10:58:04 +0000 > > > Commit: Fernando Apesteguía > > > CommitDate: 2021-06-30 07:57:51 +0000 > > > > > > man: Build manpages for all architectures > > > Building and installing architecture-specific man pages only raises a number of > > > problems: > > > * The https://www.freebsd.org/cgi/man.cgi is incomplete. As an > > > example, it does not show results for pae(4). The reason for this is > > > that the cgi interface runs on FreeBSD amd64. > > > * In FreeBSD amd64 some manual pages have broken X-refs. See hptrr(4) > > > for an example. > > > * Also, we have broken links in our Release Notes. This is a > > > consequence of the first point. See > > > https://www.freebsd.org/releases/13.0R/hardware/#proc-i386. > > > Make MAN_ARCH default to 'all' so we build all the man pages for all the > > > architectures. The difference in disk space is negligible. Also link > > > architecture-specific man pages to their own section while keeping their own > > > namespace. > > > PR: 212290 > > > Reported by: mj@bsdops.com > > > Approved by: ceri@, wosch@ > > > MFC after: 4 weeks > > > --- > > > sbin/Makefile | 6 ++++++ > > > share/man/man4/Makefile | 4 +--- > > > share/man/man4/man4.aarch64/Makefile | 5 +++++ > > > share/man/man4/man4.arm/Makefile | 5 +++++ > > > share/man/man4/man4.i386/Makefile | 5 +++++ > > > share/man/man4/man4.powerpc/Makefile | 5 +++++ > > > share/man/man5/make.conf.5 | 2 +- > > > usr.sbin/Makefile | 7 +++++++ > > > usr.sbin/apm/Makefile | 4 ++++ > > > 9 files changed, 39 insertions(+), 4 deletions(-) > > > > > > diff --git a/sbin/Makefile b/sbin/Makefile > > > index 64840bae82bb..f53e2f037ebe 100644 > > > --- a/sbin/Makefile > > > +++ b/sbin/Makefile > > > @@ -90,6 +90,12 @@ SUBDIR.${MK_ZFS}+= zfsbootcfg > > > SUBDIR.${MK_TESTS}+= tests > > > +# Add architecture-specific manpages > > > +# to be included anyway > > > +MAN= sconfig/sconfig.8 > > > + > > > +.include > > > + > > > .include > > > SUBDIR_PARALLEL= > > > diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile > > > index 5051470edc71..9027fe7df841 100644 > > > --- a/share/man/man4/Makefile > > > +++ b/share/man/man4/Makefile > > > @@ -895,9 +895,7 @@ _cgem.4= cgem.4 > > > MLINKS+=cgem.4 if_cgem.4 > > > .endif > > > -.if empty(MAN_ARCH) > > > -__arches= ${MACHINE} ${MACHINE_ARCH} ${MACHINE_CPUARCH} > > > -.elif ${MAN_ARCH} == "all" > > > +.if empty(MAN_ARCH) || ${MAN_ARCH} == "all" > > > __arches= ${:!/bin/sh -c "/bin/ls -d ${.CURDIR}/man4.*"!:E} > > > .else > > > __arches= ${MAN_ARCH} > > > diff --git a/share/man/man4/man4.aarch64/Makefile b/share/man/man4/man4.aarch64/Makefile > > > index 6714a47011ef..ef5fcd84ccd4 100644 > > > --- a/share/man/man4/man4.aarch64/Makefile > > > +++ b/share/man/man4/man4.aarch64/Makefile > > > @@ -17,6 +17,11 @@ MAN= \ > > > rk_i2c.4 \ > > > rk_pinctrl.4 \ > > > +# Link files to the parent directory > > > +.for _manpage in ${MAN} > > > +MLINKS+=${_manpage} ../${_manpage} > > > +.endfor > > > > This breaks make -DNO_ROOT in a subtle manner and so likely pkgbase. > > > > The right way to do it is to add something that uses INSTALL_RSYMLINK or alike. > > I looked a bit into this and I think that the change does nothing wrong, we > just populate METALOG incorrectly. After all, for hardlinks the source and > target are interchangeable, they are two names for the same file. > > Maybe we could fix the issue in the place where mtree entries are created > for hardlinks? > > Baring that, one easy way to work around the issue of having .. in paths is > to install architecture manpage links in the opposite order: first install a > manpage to a main directory, then create a hardlink in an architecture > sub-directory. > > As a proof of concept, I implemented that idea for man4.arm and man4.aarch: > https://people.freebsd.org/~avg/man-arch-links.diff > > And here is a sample of entries from METALOG produced with the change: > ./usr/share/man/man4/rk_gpio.4.gz type=file uname=root gname=wheel mode=0444 > size=1075 tags=package=utilities > ./usr/share/man/man4/aarch64/rk_gpio.4.gz type=file uname=root gname=wheel > mode=0444 size=1075 tags=package=utilities > ./usr/share/man/man4/aw_gpio.4.gz type=file uname=root gname=wheel mode=0444 > size=1253 tags=package=utilities > ./usr/share/man/man4/imx_wdog.4.gz type=file uname=root gname=wheel > mode=0444 size=1867 tags=package=utilities > ./usr/share/man/man4/imxwdt.4.gz type=file uname=root gname=wheel mode=0444 > size=1867 tags=package=utilities > ./usr/share/man/man4/arm/imxwdt.4.gz type=file uname=root gname=wheel > mode=0444 size=1867 tags=package=utilities > ./usr/share/man/man4/arm/aw_gpio.4.gz type=file uname=root gname=wheel > mode=0444 size=1253 tags=package=utilities > ./usr/share/man/man4/arm/imx_wdog.4.gz type=file uname=root gname=wheel > mode=0444 size=1867 tags=package=utilities > > Looking at the output I got another thought: do we need architecture sub-dir > links at all now that we install manpages to a main directory? > Is there any benefit to having the same manpage in a directory (like man4) > and its immediate subdirectory (like man4/arm) ? > Hardlink not in the same directory is imho a fragile setup anyway, what if a user has different mount points here, the hardlink would be broken. while there is little chances someone is doing that, history told me people are doing weird things and if they haven't yet, they will soon. I continue to think this kind of links should be 1/ symlinks, 2/ relative symlinks if they are in a situation which can become a cross device issue. Best regards, Bapt