NetBSD Problem Report #56627

From www@netbsd.org  Fri Jan 14 15:15:14 2022
Return-Path: <www@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 714F51A923A
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 14 Jan 2022 15:15:14 +0000 (UTC)
Message-Id: <20220114151512.AE3941A923B@mollari.NetBSD.org>
Date: Fri, 14 Jan 2022 15:15:12 +0000 (UTC)
From: cryintothebluesky@gmail.com
Reply-To: cryintothebluesky@gmail.com
To: gnats-bugs@NetBSD.org
Subject: net/tigervnc fails to build on Solaris 11.3 due to missing -lsocket -lnsl linker flags
X-Send-Pr-Version: www-1.0

>Number:         56627
>Category:       pkg
>Synopsis:       net/tigervnc fails to build on Solaris 11.3 due to missing -lsocket -lnsl linker flags
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    solaris-pkg-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 14 15:20:00 +0000 2022
>Closed-Date:    
>Last-Modified:  Sun Feb 25 09:30:02 +0000 2024
>Originator:     Sad Clouds
>Release:        pkgsrc-2021Q4
>Organization:
>Environment:
SunOS pkgsrc 5.11 11.3 sun4v sparc SUNW,SPARC-Enterprise-T5220
>Description:
Looks like gai_strerror() needs "-lsocket -lnsl" which is not used during build process, hence undefined symbol errors.

[ 92%] Built target convertlf
[ 93%] Linking CXX executable convperf
Undefined                       first referenced
 symbol                             in file
gai_strerror                        ../../common/rdr/librdr.a(Exception.cxx.o)  (symbol belongs to implicit dependency /lib/sparcv9/libsocket.so.1)
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
gmake[2]: *** [tests/unit/CMakeFiles/pixelformat.dir/build.make:104: tests/unit/pixelformat] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1100: tests/unit/CMakeFiles/pixelformat.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....

I modified pkg Makefile LDFLAGS, as a quick fix, but this is not suitable for all platforms and may need to added conditionally.

LDFLAGS+=       ${BUILDLINK_LDADD.gettext} -lsocket -lnsl

This builds it successfully, but then I get install error due to missing pam files:

/usr/bin/mv /opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/.destdir/opt/pkg/etc/pam.d/tigervnc /opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/.destdir/opt/pkg/share/examples/tigervnc
mv: cannot access /opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/.destdir/opt/pkg/etc/pam.d/tigervnc
*** Error code 2

There is no etc/pam.d generated on Solaris. This probably needs to be conditionally excluded from Makefile post-install.
# ls -l /opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/.destdir/opt/pkg
total 18
drwxr-xr-x   2 root     root           8 Jan 14 15:57 bin
drwxr-xr-x   4 root     root           4 Jan 14 15:57 lib
drwxr-xr-x   2 root     root           4 Jan 14 15:57 libexec
drwxr-xr-x   4 root     root           4 Jan 14 15:57 man
drwxr-xr-x   2 root     root           3 Jan 14 15:57 sbin
drwxr-xr-x   7 root     root           7 Jan 14 15:57 share
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: Sad Clouds <cryintothebluesky@gmail.com>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org
Subject: Re: pkg/56627: net/tigervnc fails to build on Solaris 11.3 due to
 missing -lsocket -lnsl linker flags
Date: Fri, 14 Jan 2022 15:23:44 +0000

 I think post-install script is broken

 post-install:
         ${INSTALL_SCRIPT} ${WRKSRC}/vncserver.pl ${DESTDIR}${PREFIX}/bin/vncserver
         ${MV} ${DESTDIR}${PREFIX}/etc/pam.d/tigervnc ${DESTDIR}${PREFIX}/${EGDIR}
         ${MV} ${DESTDIR}${PREFIX}/etc/tigervnc/vncserver-config-defaults ${DESTDIR}${PREFIX}/${EGDIR}
         ${MV} ${DESTDIR}${PREFIX}/etc/tigervnc/vncserver-config-mandatory ${DESTDIR}${PREFIX}/${EGDIR}
         ${MV} ${DESTDIR}${PREFIX}/etc/tigervnc/vncserver.users ${DESTDIR}${PREFIX}/${EGDIR}


 the MV commands should use source directory as
 ${DESTDIR}/etc/${PREFIX}/ since this is what actually exists on the
 system:

 # ls -l /opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/.destdir/etc/opt/pkg
 total 6
 drwxr-xr-x   2 root     root           3 Jan 14 15:57 pam.d
 drwxr-xr-x   2 root     root           5 Jan 14 15:57 tigervnc

Responsible-Changed-From-To: pkg-manager->tnn
Responsible-Changed-By: tnn@NetBSD.org
Responsible-Changed-When: Fri, 14 Jan 2022 15:25:21 +0000
Responsible-Changed-Why:
take


From: "Tobias Nygren" <tnn@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56627 CVS commit: pkgsrc/net/tigervnc
Date: Fri, 14 Jan 2022 18:17:23 +0000

 Module Name:	pkgsrc
 Committed By:	tnn
 Date:		Fri Jan 14 18:17:23 UTC 2022

 Modified Files:
 	pkgsrc/net/tigervnc: Makefile

 Log Message:
 tigervnc: add LDFLAGS.SunOS (PR pkg/56627)


 To generate a diff of this commit:
 cvs rdiff -u -r1.48 -r1.49 pkgsrc/net/tigervnc/Makefile

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

State-Changed-From-To: open->feedback
State-Changed-By: tnn@NetBSD.org
State-Changed-When: Fri, 14 Jan 2022 18:24:48 +0000
State-Changed-Why:
Asked submitter to test again.


From: Tobias Nygren <tnn@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56627: net/tigervnc fails to build on Solaris 11.3 due to
 missing -lsocket -lnsl linker flags
Date: Fri, 14 Jan 2022 19:24:07 +0100

 > LDFLAGS+=       ${BUILDLINK_LDADD.gettext} -lsocket -lnsl

 I fixed this. (We use LDFLAGS.SunOS for contional -lsocket -lnsl).

 > mv: cannot access /opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/.destdir/opt/pkg/etc/pam.d/tigervnc
 > *** Error code 2
 > 
 > There is no etc/pam.d generated on Solaris. This probably needs to be conditionally excluded from Makefile post-install.

 It is generated for me and the package builds OK now on 
 SunOS openindiana 5.11 illumos-c6282d59cf i86pc i386 i86pc.
 I can reproduce your error if I run "make post-install" twice.
 Maybe it was a side-effect from other errors?
 Can you try again with a clean work directory and up-to-date CVS?

From: Sad Clouds <cryintothebluesky@gmail.com>
To: gnats-bugs@netbsd.org
Cc: Tobias Nygren <tnn@NetBSD.org>, tnn@netbsd.org, gnats-admin@netbsd.org,
 pkgsrc-bugs@netbsd.org
Subject: Re: pkg/56627: net/tigervnc fails to build on Solaris 11.3 due to
 missing -lsocket -lnsl linker flags
Date: Fri, 14 Jan 2022 21:02:20 +0000

 Did cvs update and removed old object directory. Still fails in the
 post-install script with the same error:

 /usr/bin/mv /opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/.destdir/opt/pkg/etc/pam.d/tigervnc /opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/.destdir/opt/pkg/share/examples/tigervnc
 mv: cannot access /opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/.destdir/opt/pkg/etc/pam.d/tigervnc
 *** Error code 2

 Stop.
 bmake[1]: stopped in /opt/netbsd/pkgsrc-2021Q4/net/tigervnc
 *** Error code 1


 Somehow I end up with two subdirectories in destdir - etc and opt.
 Something seems to be broken somewhere.

 # ls -l /opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/.destdir/etc/opt/pkg
 total 6
 drwxr-xr-x   2 root     root           3 Jan 14 21:34 pam.d
 drwxr-xr-x   2 root     root           5 Jan 14 21:34 tigervnc

 # ls -l /opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/.destdir/opt/pkg
 total 18
 drwxr-xr-x   2 root     root           8 Jan 14 21:34 bin
 drwxr-xr-x   4 root     root           4 Jan 14 21:34 lib
 drwxr-xr-x   2 root     root           4 Jan 14 21:34 libexec
 drwxr-xr-x   4 root     root           4 Jan 14 21:34 man
 drwxr-xr-x   2 root     root           3 Jan 14 21:34 sbin
 drwxr-xr-x   7 root     root           7 Jan 14 21:34 share

Responsible-Changed-From-To: tnn->solaris-pkg-people
Responsible-Changed-By: tnn@NetBSD.org
Responsible-Changed-When: Fri, 14 Jan 2022 23:33:13 +0000
Responsible-Changed-Why:
Over to solaris-pkg-people since I couldn't reproduce on Illumos.


State-Changed-From-To: feedback->open
State-Changed-By: tnn@NetBSD.org
State-Changed-When: Fri, 14 Jan 2022 23:33:13 +0000
State-Changed-Why:
Feedback provided.


From: Sad Clouds <cryintothebluesky@gmail.com>
To: gnats-bugs@netbsd.org
Cc: tnn@NetBSD.org, solaris-pkg-people@netbsd.org, tnn@netbsd.org,
 pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org
Subject: Re: pkg/56627 (net/tigervnc fails to build on Solaris 11.3 due to
 missing -lsocket -lnsl linker flags)
Date: Sat, 15 Jan 2022 10:56:54 +0000

 There is a problem with how this package is configured. I have the
 following in my pkg.mk.conf

 LOCALBASE=              /opt/pkg
 PKG_DBDIR=              ${LOCALBASE}/db/pkg
 SYSCONFBASE=            ${LOCALBASE}/etc
 VARBASE=                ${LOCALBASE}/var
 PKG_TOOLS_BIN=          ${LOCALBASE}/sbin

 I'm not a Cmake expert, but seems like something is setting install
 directory to /etc/opt/pkg, when it should be /opt/pkg/etc. This
 happens for the following 4 files, as seen from install_manifest.txt.

 I don't think is Solaris specific. This is probably pkgsrc system
 doing something wrong and setting the wrong install directory.

 root@pkgsrc:/opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/tigervnc-1.12.0# find . -type f | while read i; do grep 'etc\/opt\/pkg' "$i" && echo "^------- $i\n"; done
 /etc/opt/pkg/pam.d/tigervnc
 /etc/opt/pkg/tigervnc/vncserver-config-defaults
 /etc/opt/pkg/tigervnc/vncserver-config-mandatory
 /etc/opt/pkg/tigervnc/vncserver.users
 ^------- ./install_manifest.txt

 # 1. Add a user mapping to /etc/opt/pkg/tigervnc/vncserver.users.
 ^------- ./unix/vncserver/vncserver@.service

 $vncSystemConfigDir = "/etc/opt/pkg/tigervnc";
 ^------- ./unix/vncserver/vncserver

 /etc/opt/pkg/tigervnc/vncserver-config-defaults
 and then /etc/opt/pkg/tigervnc/vncserver-config-mandatory. None are required to exist.
 /etc/opt/pkg/tigervnc/vncserver-config-mandatory
 /etc/opt/pkg/tigervnc/vncserver-config-mandatory. The overall configuration file load
 order is: /etc/opt/pkg/tigervnc/vncserver-config-defaults, $HOME/.vnc/config, and then
 ^------- ./unix/vncserver/vncsession.man

    "/etc/opt/pkg/pam.d/tigervnc")
   file(INSTALL DESTINATION "/etc/opt/pkg/pam.d" TYPE FILE RENAME "tigervnc" FILES "/opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/tigervnc-1.12.0/unix/vncserver/tigervnc.pam")
    "/etc/opt/pkg/tigervnc/vncserver-config-defaults;/etc/opt/pkg/tigervnc/vncserver-config-mandatory")
   file(INSTALL DESTINATION "/etc/opt/pkg/tigervnc" TYPE FILE FILES
    "/etc/opt/pkg/tigervnc/vncserver.users")
   file(INSTALL DESTINATION "/etc/opt/pkg/tigervnc" TYPE FILE FILES "/opt/netbsd/pkg.objects/net/tigervnc/work.pkgsrc/tigervnc-1.12.0/unix/vncserver/vncserver.users")
 ^------- ./unix/vncserver/cmake_install.cmake

 USERSFILE="/etc/opt/pkg/tigervnc/vncserver.users"
 ^------- ./unix/vncserver/vncsession-start

From: Niclas Rosenvik <nros@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/56627
Date: Fri, 23 Feb 2024 10:57:47 +0100

 Just want to point out that jperkin made a commit
 related to the problem with installing files in
 /etc/opt/pkg instead of /opt/pkg/etc. The problem
 was that -D was missing from the CMake argument.
 So maybe this can be closed?

 Here is the commit message:
 ---------------------------------------------------------------------------
 tigervnc: Fix cmake argument.

 Not entirely sure how this worked for anyone previously, for me with an etc
 under $PREFIX it tried to find things in /etc/$PREFIX.
 ---------------------------------------------------------------------------

From: Sad Clouds <cryintothebluesky@gmail.com>
To: gnats-bugs@netbsd.org
Cc: Niclas Rosenvik <nros@netbsd.org>, solaris-pkg-people@netbsd.org,
 gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/56627
Date: Sun, 25 Feb 2024 09:27:12 +0000

 On Fri, 23 Feb 2024 10:00:03 +0000 (UTC)
 Niclas Rosenvik <nros@netbsd.org> wrote:

 > The following reply was made to PR pkg/56627; it has been noted by GNATS.
 > 
 > From: Niclas Rosenvik <nros@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: pkg/56627
 > Date: Fri, 23 Feb 2024 10:57:47 +0100
 > 
 >  Just want to point out that jperkin made a commit
 >  related to the problem with installing files in
 >  /etc/opt/pkg instead of /opt/pkg/etc. The problem
 >  was that -D was missing from the CMake argument.
 >  So maybe this can be closed?
 >  
 >  Here is the commit message:
 >  ---------------------------------------------------------------------------
 >  tigervnc: Fix cmake argument.
 >  
 >  Not entirely sure how this worked for anyone previously, for me with an etc
 >  under $PREFIX it tried to find things in /etc/$PREFIX.
 >  ---------------------------------------------------------------------------
 >  

 I cannot test this any more, since the dependent package x11/libdrm no
 longer builds on Solaris 11.3 due to introduction of open_memstream(3)
 which is not supported on this version of Solaris. Unfortunately
 Solaris 11.4 dropped support for my hardware, so I'm stuck with 11.3
 for eternity. If you think the issue is fixed, then please close the
 bug.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.