NetBSD Problem Report #56299

From triaxx@netbsd.org  Tue Jul  6 06:53:08 2021
Return-Path: <triaxx@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_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 25EBA1A923B
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  6 Jul 2021 06:53:08 +0000 (UTC)
Message-Id: <20210706065305.BF9591A923C@mollari.NetBSD.org>
Date: Tue,  6 Jul 2021 06:53:05 +0000 (UTC)
From: triaxx@netbsd.org
Reply-To: triaxx@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: Native X11_TYPE on NetBSD even if /usr/X11R7 does not exist
X-Send-Pr-Version: 3.95

>Number:         56299
>Category:       pkg
>Synopsis:       Native X11_TYPE on NetBSD even if /usr/X11R7 does not exist
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 06 06:55:00 +0000 2021
>Closed-Date:    Mon Jul 19 09:59:07 +0000 2021
>Last-Modified:  Mon Jul 19 10:00:01 +0000 2021
>Originator:     Frédéric Fauberteau
>Release:        NetBSD 9.2
>Organization:

>Environment:
System: NetBSD ultralisk.triaxx.org 9.2 NetBSD 9.2 (GENERIC) #0: Wed May 12 13:15:55 UTC 2021  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
Pkgsrc tag: HEAD
>Description:
I got a error "sh: makedepend: not found" during the configure step of inputmethod/canna-lib when I tried to build it with pbulk on NetBSD in a sandbox in which /usr/X11R7 has not been mounted.
>How-To-Repeat:
cd inputmethod/canna-lib && make configure on NetBSD without xbase set.
>Fix:
--- NetBSD.mk   25 Apr 2021 07:51:25 -0000      1.65
+++ NetBSD.mk   6 Jul 2021 06:51:56 -0000
@@ -43,7 +43,7 @@
 # Native X11 is only supported on NetBSD-5 and later.
 # On NetBSD-5, native X11 has enough issues that we default
 # to modular.
-.if empty(MACHINE_PLATFORM:MNetBSD-[0-5].*)
+.if empty(MACHINE_PLATFORM:MNetBSD-[0-5].*) && exists(/usr/X11R7)
 X11_TYPE?=             native
 .endif

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: gnats-admin->pkg-manager
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Wed, 07 Jul 2021 03:07:45 +0000
Responsible-Changed-Why:
fix borked pr


From: Frederic Fauberteau <triaxx@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: tech-pkg@NetBSD.org
Subject: Re: pkg/56299 (Native X11_TYPE on NetBSD even if /usr/X11R7 does not
 exist)
Date: Wed, 7 Jul 2021 12:54:02 +0200

 I submitted this PR because I am not totally sure that the error I encountered was really a bug or just a misconfiguration of my system. I am building a pkgsrc bulk and for some reason I have not investigate yet, /usr/X11R7 has not been mounted in my sandbox. When I look at the beginning of this script, I see however with_x=yes and sandboxMountDirs="/bin /sbin /lib /libexec /usr/X11R7 ...". But anyway...

 If it is correct that a NetBSD can be fully functional without the xbase set, setting X11_TYPE to native only if /usr/X11R7 exists seems reasonable to me, since the directory of X's files has been named as this since NetBSD 5.

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56299 (Native X11_TYPE on NetBSD even if /usr/X11R7 does not
 exist)
Date: Wed, 7 Jul 2021 17:40:07 +0000

 On Wed, Jul 07, 2021 at 10:55:01AM +0000, Frederic Fauberteau wrote:
  > If it is correct that a NetBSD can be fully functional without the
  > xbase set, setting X11_TYPE to native only if /usr/X11R7 exists
  > seems reasonable to me, since the directory of X's files has been
  > named as this since NetBSD 5.

 It can, but normally because of the base mtree files that gives you an
 empty /usr/X11R7, not a missing one, so in most cases the proposed
 test won't work as intended.

 One could concoct one that works, but I'm not sure this is something
 that should attempt to autoselect itself, since if you update base and
 add the X sets it will cause pkgsrc to change course in midstream and
 (without explicit intervention) you'll get a broken mixture of native
 and pkgsrc X.

 If you want it to, I would take this point up on tech-pkg where more
 people will see it.


 however, do look into why your mount didn't work as expected as it
 sounds like that shouldn't have happened.

 -- 
 David A. Holland
 dholland@netbsd.org

From: Frederic Fauberteau <triaxx@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56299 (Native X11_TYPE on NetBSD even if /usr/X11R7 does not
 exist)
Date: Wed, 7 Jul 2021 22:49:11 +0200

 David Holland writes:
 >  It can, but normally because of the base mtree files that gives you an
 >  empty /usr/X11R7, not a missing one, so in most cases the proposed
 >  test won't work as intended.
 I didn't know that. When I looked at one of my NetBSD box which doesn't have X base set
 # uname -rsv
 NetBSD 9.0 NetBSD 9.0 (XEN3_DOMU) #0: Fri Feb 14 00:06:28 UTC 2020  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/xen/compile/XEN3_DOMU
 I seen
 # ls /usr/X11R7
 ls: /usr/X11R7: No such file or directory

 >  One could concoct one that works, but I'm not sure this is something
 >  that should attempt to autoselect itself, since if you update base and
 >  add the X sets it will cause pkgsrc to change course in midstream and
 >  (without explicit intervention) you'll get a broken mixture of native
 >  and pkgsrc X.
 I'm not necessarily in favor of an autoselect method. I'd rather be for an error message to be printed if X11_TYPE=native and /usr/X11R7 is empty.

From: Frederic Fauberteau <triaxx@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56299 (Native X11_TYPE on NetBSD even if /usr/X11R7 does not
 exist)
Date: Thu, 8 Jul 2021 23:06:56 +0200

 I don't remember how I installed them (from installer or by manually extracting sets), but I have NetBSD 9.0 machines with neither /etc/mtree/set.xbase nor /usr/X11R7. Even without a misconfigured sandbox, it seems to me that it is possible to build a pkgsrc bulk using the native X11 distribution while this distribution has actually not been installed.

 Would it make sense a patch as the following? The objective is to avoid getting a lot of packages for which the build fails due to this inconsistency.

 --- mk/platform/NetBSD.mk       25 Apr 2021 07:51:25 -0000      1.65
 +++ mk/platform/NetBSD.mk       8 Jul 2021 20:50:14 -0000
 @@ -45,6 +45,9 @@
  # to modular.
  .if empty(MACHINE_PLATFORM:MNetBSD-[0-5].*)
  X11_TYPE?=             native
 +.  if !empty(X11_TYPE:Mnative) && !exists(/etc/mtree/set.xbase)
 +PKG_FAIL_REASON+=      "Native X11 distribution cannot be used if xbase set has not been installed. You should set X11_TYPE=modular or install xbase set."
 +.  endif
  .endif

  _OPSYS_EMULDIR.aout=           /emul/aout

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56299 (Native X11_TYPE on NetBSD even if /usr/X11R7 does not
 exist)
Date: Sat, 17 Jul 2021 08:17:51 +0000

 On Thu, Jul 08, 2021 at 09:10:01PM +0000, Frederic Fauberteau wrote:
  >  Would it make sense a patch as the following? The objective is to avoid ge$
  >  
  >  --- mk/platform/NetBSD.mk       25 Apr 2021 07:51:25 -0000      1.65
  >  +++ mk/platform/NetBSD.mk       8 Jul 2021 20:50:14 -0000
  >  @@ -45,6 +45,9 @@
  >   # to modular.
  >   .if empty(MACHINE_PLATFORM:MNetBSD-[0-5].*)
  >   X11_TYPE?=             native
  >  +.  if !empty(X11_TYPE:Mnative) && !exists(/etc/mtree/set.xbase)
  >  +PKG_FAIL_REASON+=      "Native X11 distribution cannot be used if xbase set has not been installed. You should set X11_TYPE=modular or install xbase set."
  >  +.  endif
  >   .endif
  >   
  >   _OPSYS_EMULDIR.aout=           /emul/aout

 Seems like a reasonable approach to me, but I see the discussion on
 tech-pkg has moved onwards...

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: open->closed
State-Changed-By: triaxx@NetBSD.org
State-Changed-When: Mon, 19 Jul 2021 09:59:07 +0000
State-Changed-Why:
Fixed. Patch applied.
Thank you Greg and Edgar!


From: =?UTF-8?B?RnLDqWTDqXJpYyBGYXViZXJ0ZWF1?= <triaxx@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56299 CVS commit: pkgsrc/mk/tools
Date: Mon, 19 Jul 2021 09:55:04 +0000

 Module Name:	pkgsrc
 Committed By:	triaxx
 Date:		Mon Jul 19 09:55:04 UTC 2021

 Modified Files:
 	pkgsrc/mk/tools: replace.mk

 Log Message:
 mk: Fix PR pkg/56299

 Add a test to check that an xbase set is installed when a tool depends on
 X11 and X11_TYPE=native.
 Thanks to Greg and Edgar for their comments and suggestions!


 To generate a diff of this commit:
 cvs rdiff -u -r1.291 -r1.292 pkgsrc/mk/tools/replace.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.