NetBSD Problem Report #55334

From www@netbsd.org  Mon Jun  1 17:45:43 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 4100A1A9218
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  1 Jun 2020 17:45:43 +0000 (UTC)
Message-Id: <20200601174542.368651A921A@mollari.NetBSD.org>
Date: Mon,  1 Jun 2020 17:45:42 +0000 (UTC)
From: rich.neswold@gmail.com
Reply-To: rich.neswold@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Some packages seem to need access to root directory
X-Send-Pr-Version: www-1.0

>Number:         55334
>Category:       pkg
>Synopsis:       Some packages seem to need access to root directory
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 01 17:50:00 +0000 2020
>Last-Modified:  Fri Oct 16 20:15:01 +0000 2020
>Originator:     Rich Neswold
>Release:        pkgsrc-2020Q1
>Organization:
>Environment:
NetBSD 9.0_BETA (GENERIC) evbarm
>Description:
I'm running NetBSD9 on a RaspberryPi 3. My SD card is mounted read-only so my pkgsrc and /usr/pkg is NFS-mounted on a NAS. I build packages unprivileged.

Most packages build and install fine using this configuration. However some dependencies had issues. Specifically devel/libffi, textproc/libxml2, and www/nghttp2. These packages failed in the exact same way while running their configure script.

The config.log, that gets generated, said the error was due to a read-only filesystem and mentioning using "--disable-dependency-tracking", which is how I worked around the problem.

It seemed strange that PKGSRC was touching something outside its directory tree so I took a brief look at the script. It tried to make temporary files for some of its tests and the general form used in the commands was "$tmp/filename". My hunch is 'tmp' was empty so it was creating the files in the root directory.
>How-To-Repeat:
Try to build these packages as non-root (not sure whether the read-only root directory is necessary.)
>Fix:
I was able to work around the problem by adding

CONFIGURE_ARGS+=    --disable-dependency-tracking

to each Makefile. This may be the easiest fix -- especially since it's not clear that "dependency tracking" speeds the build up when you're building everything.

>Audit-Trail:
From: Tobias Nygren <tnn@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/55334: Some packages seem to need access to root directory
Date: Mon, 1 Jun 2020 20:24:18 +0200

 The proposed fix is likely not right. Many bulk builders including
 myself have used read-only / for a long time without encountering
 such issues.
 Is your /tmp and/or /var/tmp read only?
 Consider mounting tmpfs on them.

From: Rich Neswold <rich.neswold@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/55334
Date: Fri, 16 Oct 2020 15:10:57 -0500

 --00000000000081c4e605b1cf5d69
 Content-Type: text/plain; charset="UTF-8"

 It turns out /var/tmp was read-only and seems to be the default for PKGSRC.
 I was able to build the packages using

     export TMPDIR=/tmp

 --00000000000081c4e605b1cf5d69
 Content-Type: text/html; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable

 <div dir=3D"auto">It turns out /var/tmp was read-only and seems to be the d=
 efault for PKGSRC. I was able to build the packages using<div dir=3D"auto">=
 <br></div><div dir=3D"auto">=C2=A0 =C2=A0 export TMPDIR=3D/tmp</div></div>

 --00000000000081c4e605b1cf5d69--

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.