NetBSD Problem Report #24731

Received: (qmail 22666 invoked by uid 605); 10 Mar 2004 15:12:54 -0000
Message-Id: <200403101512.i2AFCl512957@rfhpc8323.fh-regensburg.de>
Date: Wed, 10 Mar 2004 16:12:47 +0100 (MET)
From: Hubert Feyrer <feyrer@rfhpc8323.fh-regensburg.de>
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: hubertf@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: bootstrap-pkgsrc on cygwin (patch)
X-Send-Pr-Version: 3.95

>Number:         24731
>Category:       pkg
>Synopsis:       bootstrap-pkgsrc on cygwin (patch)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 10 15:13:00 +0000 2004
>Closed-Date:    Thu Jun 06 02:36:03 +0000 2013
>Last-Modified:  Thu Jun 06 02:40:00 +0000 2013
>Originator:     Hubert Feyrer
>Release:        NetBSD 1.6.2
>Organization:
Hubert Feyrer <hubertf@netbsd.org>
>Environment:


System: NetBSD yui.fh-regensburg.de 1.6.2 NetBSD 1.6.2 (YUI) #1: Thu Oct 9 09:15:06 GMT 2003 feyrer@yui.fh-regensburg.de:/disk1/cvs/src-1.6/sys/arch/i386/compile/YUI i386
Architecture: i386
Machine: i386
>Description:
	Install Cygwin and whatever needed to get basic things going
	(ssh, cvs, vi, gcc, make3, ...), then try to get 
	bootstrap-pkgsrc going. See it fail.

>How-To-Repeat:
	$ cat pkgsrc.sh
	MY_HOME=$HOME/OS
	LOCALBASE=$MY_HOME/pkg
	PKG_DBDIR=$MY_HOME/db/pkg

	./bootstrap \
        	--prefix=$LOCALBASE \
        	--pkgdbdir=$PKG_DBDIR \
        	--pkgsrcdir=$MY_HOME/pkgsrc \
        	--ignore-user-check

	see it fail with unknown option "-u" to make. This comes
	from gmake adding --unix to MAKEFLAGS silently. 

>Fix:

Here is a bunch of bootstrap-pkgsrc patches to make it getting further,
based on sources from 20040310. Problem hit next after this is that
executables have a .exe suffix, which is first hit in the pax->cpio
hardlink.

Might be useful to coordinate with the winsrc project (see winsrc.sf.net).


 - Hubert

--- bmake/makefile.boot.in.orig	2004-03-10 13:54:42.000000000 +0100
+++ bmake/makefile.boot.in	2004-03-10 13:53:48.000000000 +0100
@@ -31,7 +31,7 @@
 	rm -f *.[ado] */*.[ado] 

 bootstrap:	bmake.boot
-	CC="$(CC)" MAKESYSPATH=${MK} ./bmake.boot -f Makefile 
+	MAKEFLAGS="" CC="$(CC)" MAKESYSPATH=${MK} ./bmake.boot -f Makefile 
 install:	install-bin install-man install-mk

 install-bin:
--- bmake/job.c.orig	2004-03-10 14:32:56.000000000 +0100
+++ bmake/job.c	2004-03-10 14:33:26.000000000 +0100
@@ -972,7 +972,7 @@
 #endif
 	    (void) fflush(out);
 	    return;
-	} else if (WIFSTOPPED(status) &&  WTERMSIG(status) == SIGCONT) {
+	} else if (WIFSTOPPED(status) &&  WSTOPSIG(status) == SIGCONT) {
 	    /*
 	     * If the beastie has continued, shift the Job from the stopped
 	     * list to the running one (or re-stop it if concurrency is
--- libnbcompat/nbcompat.h.orig	2004-03-10 15:01:06.000000000 +0100
+++ libnbcompat/nbcompat.h	2004-03-10 15:03:06.000000000 +0100
@@ -219,6 +219,10 @@
 # include <assert.h>
 #endif

+/* #if HAVE_SYS_SYSLIMITS_H */			/*HF*/
+# include <sys/syslimits.h> 	/* ARG_MAX */	/*HF*/
+/* #endif */					/*HF*/
+
 #if HAVE_ERR_H
 # include <err.h>
 #else
--- libnbcompat/pwcache.c.orig	2004-03-10 15:06:06.000000000 +0100
+++ libnbcompat/pwcache.c	2004-03-10 15:46:46.000000000 +0100
@@ -132,10 +132,10 @@
 static	struct group *	(*_pwcache_getgrnam)(const char *)	= getgrnam;
 static	struct group *	(*_pwcache_getgrgid)(gid_t)		= getgrgid;
 static	int		(*_pwcache_setpassent)(int)		=
-#if HAVE_SETPASSENT
+#if HAVE_SETGRENT	/* CygWin has both, but no header for setpassent */
+	setpwent;	
+#elif HAVE_SETPASSENT
 	setpassent;
-#elif HAVE_SETGRENT
-	setpwent;
 #else
 	NULL
 #endif
--- libnbcompat/__fts13.c.orig	2004-03-10 15:48:20.000000000 +0100
+++ libnbcompat/__fts13.c	2004-03-10 15:51:48.000000000 +0100
@@ -652,7 +652,13 @@
 static int
 dirfd(DIR *dirp)
 {
-	return (dirp == NULL) ? -1 : dirp->dd_fd;
+	return (dirp == NULL) ? -1 : dirp->
+#ifdef __CYGWIN__
+					   __fh
+#else
+					   dd_fd
+#endif
+						;
 }
 #endif

>Release-Note:
>Audit-Trail:

From: Michal Pasternak <michal@pasternak.w.lub.pl>
To: hubert.feyrer@rz.uni-regensburg.de
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/24731: bootstrap-pkgsrc on cygwin (patch)
Date: Wed, 10 Mar 2004 16:54:41 +0100

 Hubert Feyrer [Wed, Mar 10, 2004 at 04:12:47PM +0100]:
 > Here is a bunch of bootstrap-pkgsrc patches to make it getting further,
 > based on sources from 20040310.

 /me slaps his forehead for not publishing anything about it earlier :)

 I just tried pkgsrc on Cygwin, nothing serious, but I managed to put up a
 nice readme, that lists almost every package needed to use pkgsrc on it:

 	http://pkgsrc.w.lub.pl/README.Cygwin

 ... and bootstrap entry:

 	http://pkgsrc.w.lub.pl/cygwin_bootstrap

 > Problem hit next after this is that
 > executables have a .exe suffix, which is first hit in the pax->cpio
 > hardlink.

 Yes, I've thought about this.

 Perhaps pkg_add could be patched only on win32 in a such way, that it
 automatiocally tries to find .exe-named packages for bin/ and sbin/; (and
 yes, I don't care that this is not a clean fix/method - win32 is broken
 anyway, and such patch would not affect other platforms)

 Perhaps you could create binaries on cygwin *without* exe suffix (this will
 need some libtool/configure tweaks for sure)

 Another thing is, that win32 needs lib*.dll files (which go to bin/
 directory).

 Both those problems make me wonder why don't we wrap install, cp and some
 other file-installation tools in a thing, that would be also able to
 automatically create PLIST.

 Anyway, clobbering NetBSD PLISTs with ${EXE_SUFFX} for each binary entry
 doesn't seem a good idea.

 > Might be useful to coordinate with the winsrc project (see winsrc.sf.net).

 winsrc needs developers! :)

 Who exactly is "in charge" for othersrc? I've submited some QNX stuff some
 time ago, now we have Cygwin stuff - IMO as this is work in progress, it
 would be pretty okay to include the changes (unless they break anything for
 other platforms); if someone wants to continue the development in the
 future, s/he will have much easier task... (grepping list archives, querying
 PRs, downloading patches - which hopefully still are available on 3rd party
 sites... this will lead us nowhere and bring no new developers to the table).

From: Hubert Feyrer <hubert@feyrer.de>
To: Michal Pasternak <michal@pasternak.w.lub.pl>
Cc: gnats-bugs@gnats.netbsd.org, jlam@netbsd.org
Subject: Re: pkg/24731: bootstrap-pkgsrc on cygwin (patch)
Date: Wed, 10 Mar 2004 17:13:59 +0100 (CET)

 On Wed, 10 Mar 2004, Michal Pasternak wrote:
 > Perhaps pkg_add could be patched only on win32 in a such way, that it
 > automatiocally tries to find .exe-named packages for bin/ and sbin/; (and
 > yes, I don't care that this is not a clean fix/method - win32 is broken
 > anyway, and such patch would not affect other platforms)

 pkg_add is not enough by any means... it's just good to install binary
 pkgs, and all the hard work has to happen before.


 > Perhaps you could create binaries on cygwin *without* exe suffix (this will
 > need some libtool/configure tweaks for sure)

 Dunno, the way it is right now, they are added with suffix.


 > Both those problems make me wonder why don't we wrap install, cp and some
 > other file-installation tools in a thing, that would be also able to
 > automatically create PLIST.

 That might be useful in buildlink context... let's CC: Johnny.


 > Anyway, clobbering NetBSD PLISTs with ${EXE_SUFFX} for each binary entry
 > doesn't seem a good idea.

 Indeed... Maybe we could add a hack that .exe gets added to all files in
 /bin/ and /sbin/dirs automatically, that shouldn't be too hard.
 No idea for DLL handling though.


 > Who exactly is "in charge" for othersrc? I've submited some QNX stuff some
 > time ago, now we have Cygwin stuff - IMO as this is work in progress, it
 > would be pretty okay to include the changes (unless they break anything for
 > other platforms); if someone wants to continue the development in the
 > future, s/he will have much easier task... (grepping list archives, querying
 > PRs, downloading patches - which hopefully still are available on 3rd party
 > sites... this will lead us nowhere and bring no new developers to the table).

 I have no idea who is the person to contact for the bootstrap-pkgsrc
 framework, but did forward your mail to an internal list asking whoever
 feels responsible to get back to you. Would  be a shame to duplicate
 efforts.

 BTW, Todd Vierling (tv@netbsd.org) is working on a pkgsrc port to the
 Microsoft Services for Unix (SFU), maybe talk to him too.


  - Hubert

 -- 
 Hubert Feyrer <hubert@feyrer.de>

From: Michal Pasternak <michal@pasternak.w.lub.pl>
To: Hubert Feyrer <hubert@feyrer.de>
Cc: Michal Pasternak <michal@pasternak.w.lub.pl>, gnats-bugs@gnats.netbsd.org,
  jlam@netbsd.org
Subject: Re: pkg/24731: bootstrap-pkgsrc on cygwin (patch)
Date: Wed, 10 Mar 2004 17:45:01 +0100

 Hubert Feyrer [Wed, Mar 10, 2004 at 05:13:59PM +0100]:
 > On Wed, 10 Mar 2004, Michal Pasternak wrote:
 > > Perhaps pkg_add could be patched only on win32 in a such way, that it
 > > automatiocally tries to find .exe-named packages for bin/ and sbin/; (and
 > > yes, I don't care that this is not a clean fix/method - win32 is broken
 > > anyway, and such patch would not affect other platforms)
 > 
 > pkg_add is not enough by any means...
 [...]
 > Indeed... Maybe we could add a hack that .exe gets added to all files in
 > /bin/ and /sbin/dirs automatically, that shouldn't be too hard.

 Yes, that's what I thought about using "pkg_add" name :)

 > No idea for DLL handling though.

 PLIST.Cygwin or PLIST.win32 . DLLs in bin/ won't appear anywhere else and
 there are not too many of them.

 > BTW, Todd Vierling (tv@netbsd.org) is working on a pkgsrc port to the
 > Microsoft Services for Unix (SFU), maybe talk to him too.

 Hmm, maybe it would be better to create some kind of mailing list
 (pkgsrc-win32@), or I could create a discussion list using sf.net - you can
 neither browse, nor archive private corespondence...

From: Hubert Feyrer <hubert@feyrer.de>
To: Michal Pasternak <michal@pasternak.w.lub.pl>
Cc: gnats-bugs@gnats.netbsd.org, jlam@netbsd.org
Subject: Re: pkg/24731: bootstrap-pkgsrc on cygwin (patch)
Date: Wed, 10 Mar 2004 17:59:51 +0100 (CET)

 On Wed, 10 Mar 2004, Michal Pasternak wrote:
 > Hmm, maybe it would be better to create some kind of mailing list
 > (pkgsrc-win32@), or I could create a discussion list using sf.net - you can
 > neither browse, nor archive private corespondence...

 Well, I suggest tech-pkg@netbsd.org for the time being. This is about
 pkgsrc, after all.


  - Hubert

 -- 
 Hubert Feyrer <hubert@feyrer.de>

From: Todd Vierling <tv@duh.org>
To: hubert.feyrer@rz.uni-regensburg.de
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/24731: bootstrap-pkgsrc on cygwin (patch)
Date: Thu, 11 Mar 2004 07:20:23 -0500 (EST)

 On Wed, 10 Mar 2004, Hubert Feyrer wrote:

 : --- bmake/job.c.orig	2004-03-10 14:32:56.000000000 +0100
 : +++ bmake/job.c	2004-03-10 14:33:26.000000000 +0100
 : @@ -972,7 +972,7 @@
 :  #endif
 :  	    (void) fflush(out);
 :  	    return;
 : -	} else if (WIFSTOPPED(status) &&  WTERMSIG(status) == SIGCONT) {
 : +	} else if (WIFSTOPPED(status) &&  WSTOPSIG(status) == SIGCONT) {
 :  	    /*
 :  	     * If the beastie has continued, shift the Job from the stopped
 :  	     * list to the running one (or re-stop it if concurrency is

 GNATS users note:  this patch has been applied in otder to get bmake to
 compile at all on Interix.  This matches a change in the mainline
 src/usr.bin/make sources.

 -- 
 -- Todd Vierling <tv@duh.org> <tv@pobox.com>

From: Hubert Feyrer <hubert@feyrer.de>
To: Todd Vierling <tv@duh.org>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/24731: bootstrap-pkgsrc on cygwin (patch)
Date: Thu, 11 Mar 2004 15:41:21 +0100 (CET)

 On Thu, 11 Mar 2004, Todd Vierling wrote:
 > : -	} else if (WIFSTOPPED(status) &&  WTERMSIG(status) == SIGCONT) {
 > : +	} else if (WIFSTOPPED(status) &&  WSTOPSIG(status) == SIGCONT) {
 >
 > GNATS users note:  this patch has been applied in otder to get bmake to
 > compile at all on Interix.  This matches a change in the mainline
 > src/usr.bin/make sources.

 Yeah, it only exists in bootstrap-pkgsrc. Makes me wonder why we don't hit
 that on non-windows platforms.


  - Hubert

 -- 
 Hubert Feyrer <hubert@feyrer.de>

From: Todd Vierling <tv@duh.org>
To: hubert.feyrer@rz.uni-regensburg.de
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/24731: bootstrap-pkgsrc on cygwin (patch)
Date: Thu, 22 Apr 2004 15:57:21 -0400 (EDT)

 On Wed, 10 Mar 2004, Hubert Feyrer wrote:

 : Here is a bunch of bootstrap-pkgsrc patches to make it getting further,
 : based on sources from 20040310. Problem hit next after this is that
 : executables have a .exe suffix, which is first hit in the pax->cpio
 : hardlink.

 Cygwin actually doesn't require the .exe suffix on NT-based systems
 (Win2000+).  Try it.  Voila!  8-)

 However, gcc on Cygwin defaults to supplying .exe so that they can be run
 from the Win32 command shell (CMD.EXE/COMMAND.COM).  That part is a real
 PITA.  Perhaps a buildlink hack could remove it at link time?  Or perhaps
 "install-sh" could do so?

 It's also worth noting that ld(1) does NOT introduce the .exe suffix by
 default.  If you look at the output of "gcc -v" at link time, you'll see
 that it is introduced by the gcc frontend.  I haven't looked to see if it's
 possible to work around that crap.

 -- 
 -- Todd Vierling <tv@duh.org> <tv@pobox.com>
State-Changed-From-To: open->feedback
State-Changed-By: joerg@netbsd.org
State-Changed-When: Fri, 22 Dec 2006 21:50:30 +0000
State-Changed-Why:
How likely is it that Cygwin will work better than Interix?
Do we want to have support for both?
I don't want to support Cygwin as it is using the Win32 subsystems which
adds a number of nasty side-effects, e.g. breaking of Unix filesystems with
regard to consecutive dots in filenames etc.


From: Krister Walfridsson <cato@df.lth.se>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/24731 (bootstrap-pkgsrc on cygwin (patch))
Date: Sun, 14 Jan 2007 15:08:00 +0100 (CET)

 On Fri, 22 Dec 2006 joerg@NetBSD.org wrote:

 > How likely is it that Cygwin will work better than Interix?

 I think it is likely to work much better...  It is after all built out of 
 many of the same components as a Linux system, so even much of the 
 software that think that "all the world is Linux" works without 
 modification.


 > Do we want to have support for both?

 I personally do not care about Interix, but Cygwin support would have 
 helped me many times (I have never seen a Windows machine with Interix 
 installed, but there is seldom I use a Windows machine without Cgygwin...) 
 But I see no problem having both in pkgsrc.


 > I don't want to support Cygwin as it is using the Win32 subsystems which
 > adds a number of nasty side-effects, e.g. breaking of Unix filesystems with
 > regard to consecutive dots in filenames etc.

 I do not understand your comment.  What problems are there with 
 "consecutive dots in filenames etc."?  AFAIK, the only real problem is 
 that the filesystem is case-insensitive... (but doesn't that problem exist 
 for Interix too?)

     /Krister

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 10 Apr 2008 03:01:34 +0000
State-Changed-Why:
(some) feedback received.


From: Hiroyuki Bessho <bsh@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/24731: bootstrap-pkgsrc on cygwin (patch)
Date: Sat, 11 Jul 2009 13:54:08 +0900

 Hi,

    I succeeded to bootstrap pkgsrc on Cygwin with recent pkgsrc-current
 source.  (At least, I could build some packages such as editors/emacs)

    The patch is at
    ftp://ftp.netbsd.org/pub/NetBSD/misc/bsh/pkgsrc-cygwin.patch


 BR.
 --
 bsh.

State-Changed-From-To: open->feedback
State-Changed-By: obache@NetBSD.org
State-Changed-When: Fri, 08 Mar 2013 11:45:44 +0000
State-Changed-Why:
I've committed changes for Cygwin 1.17.x.
Is it sufficient for you?


State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 02 Jun 2013 00:34:57 +0000
State-Changed-Why:
Feedback bounced; update submitter address...


State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 02 Jun 2013 00:35:25 +0000
State-Changed-Why:
...and try again.

State-Changed-From-To: open->feedback
State-Changed-By: obache@NetBSD.org
State-Changed-When: Fri, 08 Mar 2013 11:45:44 +0000
State-Changed-Why:
I've committed changes for Cygwin 1.17.x.
Is it sufficient for you?


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 06 Jun 2013 02:36:03 +0000
State-Changed-Why:
I think probably we should just close this...


From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/24731 (bootstrap-pkgsrc on cygwin (patch))
Date: Thu, 6 Jun 2013 02:37:29 +0000

 On Thu, Jun 06, 2013 at 02:36:04AM +0000, dholland@NetBSD.org wrote:
  > I think probably we should just close this...

 To clarify, that was in response to some private mail that I thought
 was cc'd to gnats, the quick summary of which is "this PR is absurdly
 old and I can't test"

 -- 
 David A. Holland
 dholland@netbsd.org

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.