NetBSD Problem Report #56611

From www@netbsd.org  Mon Jan 10 19:09:48 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 C851A1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 10 Jan 2022 19:09:48 +0000 (UTC)
Message-Id: <20220110190947.38CC81A923A@mollari.NetBSD.org>
Date: Mon, 10 Jan 2022 19:09:47 +0000 (UTC)
From: saulius2@ar-fi.lt
Reply-To: saulius2@ar-fi.lt
To: gnats-bugs@NetBSD.org
Subject: Current ./bootstrap fails on Cygwin-3.3.3
X-Send-Pr-Version: www-1.0

>Number:         56611
>Category:       pkg
>Synopsis:       Current ./bootstrap fails on Cygwin-3.3.3
>Confidential:   no
>Severity:       critical
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 10 19:10:00 +0000 2022
>Closed-Date:    Tue May 03 21:39:21 +0000 2022
>Last-Modified:  Tue May 03 21:39:21 +0000 2022
>Originator:     Saulius Krasuckas
>Release:        e0d6230016a08f59f3bc8bd3e115b72fbbddbdf6
>Organization:
>Environment:
$ uname -a
CYGWIN_NT-10.0-WOW DESKTOP-O7JE7JE 3.3.3(0.341/5/3) 2021-12-03 16:31 i686 Cygwin

>Description:
On Cygwin 3.3.3 ./bootstrap fails on line 278 (in work/pkg_install): 

-lbcrypt: command not found

Quoting the whole step:

--- snip ---
===> running: /usr/bin/sh /usr/work/bin/install-sh -d -o 197614 -g 197121 /usr/work/pkg_install
===> running: (cd /usr/work/pkg_install; env  CPPFLAGS=' -I/usr/work/libnbcompat -I/usr/work/libarchive/libarchive' LDFLAGS=' -L/usr/work/libnbcompat' LIBS=' -lnbcompat' /usr/bin/sh ./configure  -C --enable-bootstrap --prefix=/home/saukrs/pkg --sysconfdir=/home/saukrs/pkg/etc --with-pkgdbdir=/home/saukrs/pkg/pkgdb --infodir=/home/saukrs/pkg/info --mandir=/home/saukrs/pkg/man  && STATIC_LIBARCHIVE=/usr/work/libarchive/.libs/libarchive.a STATIC_LIBARCHIVE_LDADD= -lbcrypt PKGSRC_MACHINE_ARCH=i686 /usr/work/bin/bmake  -j1)
configure: creating cache config.cache
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for ranlib... ranlib
checking for ar... ar
checking for chmod... /usr/bin/chmod
checking for cmp... /usr/bin/cmp
checking for cp... /usr/bin/cp
checking for env... /usr/bin/env
checking for find... /usr/bin/find
checking for grep... /usr/bin/grep
checking for ln... /usr/bin/ln
checking for mkdir... /usr/bin/mkdir
checking for rmdir... /usr/bin/rmdir
checking for rm... /usr/bin/rm
checking for sed... /usr/bin/sed
checking for sort... /usr/bin/sort
checking for touch... /usr/bin/touch
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for __db185_open in -ldb... ./configure: line 4280: ac_fn_c_try_link: command not found
no
checking for library containing dbopen... none required
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking assert.h usability... yes
checking assert.h presence... yes
checking for assert.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking err.h usability... yes
checking err.h presence... yes
checking for err.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking fnmatch.h usability... yes
checking fnmatch.h presence... yes
checking for fnmatch.h... yes
checking glob.h usability... yes
checking glob.h presence... yes
checking for glob.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking for inttypes.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for unistd.h... (cached) yes
checking vis.h usability... no
checking vis.h presence... no
checking for vis.h... no
checking sys/cdefs.h usability... yes
checking sys/cdefs.h presence... yes
checking for sys/cdefs.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/queue.h usability... yes
checking sys/queue.h presence... yes
checking for sys/queue.h... yes
checking for sys/stat.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking for vfork... yes
checking for library containing gethostbyname... none required
checking for library containing socket... none required
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for a working PRIu64... yes
checking size of int... 4
checking size of long... 4
checking size of long long... 8
checking size of size_t... 4
configure: updating cache config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating add/Makefile
config.status: creating admin/Makefile
config.status: creating create/Makefile
config.status: creating delete/Makefile
config.status: creating info/Makefile
config.status: creating lib/Makefile
config.status: creating lib/pkg_install.conf.5
config.status: creating lib/pkg_install.conf.cat
config.status: creating lib/config.h
./bootstrap: line 278: -lbcrypt: command not found
===> exited with status 127
aborted.
--- snip ---

>How-To-Repeat:
# - Install Cygwin 3.3.3; (the latest version)
# - Run Cygwin Terminal; (32-bot not 64-bit)

$ git clone https://github.com/NetBSD/pkgsrc
$ cd pkgsrc/bootstrap/
$ WRKOBJDIR=/usr/work
$ DISTDIR=/usr/distfiles
$ mkdir /usr/distfiles
$ export DISTDIR WRKOBJDIR

$ ./bootstrap --unprivileged --workdir ${WRKOBJDIR}

>Fix:
Seemingly related snippet:

--- snip ---
1314  LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \
1315  --enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \
1316  --with-pkgdbdir=$pkgdbdir --infodir=$infodir \
1317  --mandir=$mandir $pkg_install_args && \
1318  STATIC_LIBARCHIVE=$wrkdir/libarchive/.libs/libarchive.a \
1319  STATIC_LIBARCHIVE_LDADD="`extra_libarchive_depends`" \
1320  PKGSRC_MACHINE_ARCH="$machine_arch" $bmake $make_quiet_flags -j$make_jobs)"
--- snip ---

Points and questions:

(-) extra_libarchive_depends() returns ' -lbcrypt'.
(1) Is this correct enough (the leading space)?
(-) The arguments STATIC_LIBARCHIVE_LDADD="`extra_libarchive_depends`" is split into two as if double quotes would be lost.
(-) When I run this interactively, it works fine:

--- snip ---
$ type extra_libarchive_depends
extra_libarchive_depends is a function
extra_libarchive_depends ()
{
    sed -n -e 's/Libs.private: //p' $WRKOBJDIR/libarchive/build/pkgconfig/libarchive.pc
}

$ (cd /usr/work/pkg_install; STATIC_LIBARCHIVE=/usr/work/libarchive/.libs/libarchive.a STATIC_LIBARCHIVE_LDADD="`extra_libarchive_depends`" PKGSRC_MACHINE_ARCH=i686 /usr/work/bin/bmake  -j1)
gcc -DHAVE_CONFIG_H -DDEF_LOG_DIR=\"/home/saukrs/pkg/pkgdb\" -I/usr/work/libnbcompat -I/usr/work/libarchive/libarchive -I. -I. -DSYSCONFDIR=\"/home/saukrs/pkg/etc\" -DPREFIX=\"\" -DBOOTSTRAP -g -O2 -c automatic.c
gcc -DHAVE_CONFIG_H -DDEF_LOG_DIR=\"/home/saukrs/pkg/pkgdb\" -I/usr/work/libnbcompat -I/usr/work/libarchive/libarchive -I. -I. -DSYSCONFDIR=\"/home/saukrs/pkg/etc\" -DPREFIX=\"\" -DBOOTSTRAP -g -O2 -c conflicts.c
gcc -DHAVE_CONFIG_H -DDEF_LOG_DIR=\"/home/saukrs/pkg/pkgdb\" -I/usr/work/libnbcompat -I/usr/work/libarchive/libarchive -I. -I. -DSYSCONFDIR=\"/home/saukrs/pkg/etc\" -DPREFIX=\"\" -DBOOTSTRAP -g -O2 -c dewey.c

^C
--- snip ---

(2) Any idea why? Can this be some Cygwin quirk?

>Release-Note:

>Audit-Trail:
From: Saulius Krasuckas <saulius2@ar-fi.lt>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56611: Current ./bootstrap fails on Cygwin-3.3.3
Date: Tue, 03 May 2022 19:45:10 +0300

 It got fixed on Feb 8, 2022:

 ```
 $ git bisect fixed
 bf74aab305f97e82de1010b4a1c2c04f704578e9 is the first fixed commit
 commit bf74aab305f97e82de1010b4a1c2c04f704578e9
 Author: schmonz <schmonz@pkgsrc.org>
 Date:   Tue Feb 8 19:18:07 2022 +0000

      p.spek@tyil.nl had specifically said to _single_-quote the output of
      extra_libarchive_depends(). Oops. Now that the problem has bitten me 
 (on
      Manjaro ARM), I can attest that single-quoting fixes it. Sorry, 
 tyil,
      and thanks again!

   bootstrap/bootstrap | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)
 ```

 Can this bug report be closed somehow?

 S.

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Tue, 03 May 2022 21:39:21 +0000
State-Changed-Why:
Reported fixed, thanks for the update!


>Unformatted:

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.