threads / discuss / 22962

Re: git interix support

Subject: Re: git interix support

## tl;dr

5 messages between Mar 9, 2010 and Mar 11, 2010.

replies: 4people: 4as markdown or json

Markus Duft· Mar 9, 2010, 10:35 UTC · lore

git interix support

Hey.

i have "ported" git to interix (haha, wasn't so much of a problem after all ;)). i have a small patch (attached). i know that it sure doesn't have production quality yet, but i try gathering ideas/input here.

additionally to the patch i'm setting:

147 if [[ ${CHOST} == *-interix* ]] ; then 148 myopts="${myopts} NO_IPV6=YesPlease" 149 myopts="${myopts} NO_MEMMEM=YesPlease" 150 myopts="${myopts} NO_MKDTEMP=YesPlease" 151 myopts="${myopts} NO_STRTOUMAX=YesPlease" 152 myopts="${myopts} NO_STRTOULL=YesPlease" 153 myopts="${myopts} NO_INET_NTOP=YesPlease" 154 myopts="${myopts} NO_INET_PTON=YesPlease" 155 myopts="${myopts} NO_NSEC=YesPlease" 156 myopts="${myopts} NO_MKSTEMPS=YesPlease" 157 fi

interix lacks propper poll() support (poll is there but broken), so some of the things in git have to be disabled for now, or replaced by a select() code (but that'd take precious time of mine to implement (argh)).

any comments on the patch? any chance to get stuff upstream?
(BTW. i know that this is not the most current git release i'm patching
(1.6.6.1), and i'll have to forward port the patch at some point anyway
- i hope i'll get to this soon...)
Thanks in advance!
Cheers, Markus

diff -ru git-1.6.6.1.orig/builtin-upload-archive.c git-1.6.6.1/builtin-upload-archive.c --- git-1.6.6.1.orig/builtin-upload-archive.c 2010-03-09 10:51:28 +0100 +++ git-1.6.6.1/builtin-upload-archive.c 2010-03-09 11:06:45 +0100

@@ -132,8 +132,9 @@
 	packet_flush(1);
 
 	while (1) {
-		struct pollfd pfd[2];
 		int status;
+#ifndef __INTERIX
+		struct pollfd pfd[2];
 
 		pfd[0].fd = fd1[0];
 		pfd[0].events = POLLIN;
@@ -156,6 +157,8 @@
 			if (process_input(pfd[0].fd, 1))
 				continue;
 
+#endif
+
 		if (waitpid(writer, &status, 0) < 0)
 			error_clnt("%s", lostchild);
 		else if (!WIFEXITED(status) || WEXITSTATUS(status) > 0)
diff -ru git-1.6.6.1.orig/daemon.c git-1.6.6.1/daemon.c
--- git-1.6.6.1.orig/daemon.c	2010-03-09 10:51:28 +0100
+++ git-1.6.6.1/daemon.c	2010-03-09 11:00:50 +0100
@@ -14,6 +14,8 @@
 #define NI_MAXSERV 32
 #endif
 
+#ifndef __INTERIX /* not available on interix! */
+
 static int log_syslog;
 static int verbose;
 static int reuseaddr;
@@ -922,8 +924,13 @@
 	return service_loop(socknum, socklist);
 }
 
+#endif /* __INTERIX */
+
 int main(int argc, char **argv)
 {
+#ifdef __INTERIX
+	die("not implemented on interix!");
+#else /* !__INTERIX */
 	int listen_port = 0;
 	char *listen_addr = NULL;
 	int inetd_mode = 0;
@@ -1121,4 +1128,5 @@
 		store_pid(pid_file);
 
 	return serve(listen_addr, listen_port, pass, gid);
+#endif /* __INTERIX */
 }
diff -ru git-1.6.6.1.orig/git-compat-util.h git-1.6.6.1/git-compat-util.h
--- git-1.6.6.1.orig/git-compat-util.h	2010-03-09 10:51:29 +0100
+++ git-1.6.6.1/git-compat-util.h	2010-03-09 10:53:59 +0100
@@ -93,7 +93,9 @@
 #include <utime.h>
 #ifndef __MINGW32__
 #include <sys/wait.h>
+#ifndef __INTERIX
 #include <sys/poll.h>
+#endif
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 #ifndef NO_SYS_SELECT_H
@@ -104,7 +106,11 @@
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <pwd.h>
+#ifndef __INTERIX
 #include <inttypes.h>
+#else
+#include <stdint.h>
+#endif
 #if defined(__CYGWIN__)
 #undef _XOPEN_SOURCE
 #include <grp.h>
diff -ru git-1.6.6.1.orig/upload-pack.c git-1.6.6.1/upload-pack.c
--- git-1.6.6.1.orig/upload-pack.c	2010-03-09 10:51:33 +0100
+++ git-1.6.6.1/upload-pack.c	2010-03-09 10:58:02 +0100
@@ -150,6 +150,7 @@
 
 static void create_pack_file(void)
 {
+#ifndef __INTERIX
 	struct async rev_list;
 	struct child_process pack_objects;
 	int create_full_pack = (nr_our_refs == want_obj.nr && !have_obj.nr);
@@ -328,6 +329,9 @@
  fail:
 	send_client_data(3, abort_msg, sizeof(abort_msg));
 	die("git upload-pack: %s", abort_msg);
+#else /* __INTERIX */
+	die("git upload-pack: not implemented on interix!");
+#endif /* __INTERIX */
 }
 
 static int got_sha1(char *hex, unsigned char *sha1)
Johannes Schindelin· Mar 9, 2010, 11:24 UTC · re: Markus Duft · lore
Hi,
On Tue, 9 Mar 2010, Markus Duft wrote:
> i have "ported" git to interix (haha, wasn't so much of a problem after
> all ;)). i have a small patch (attached).

Please inline the patch for easier review. Unless you want no review, that is :-)

>From a cursory view, it looks as if all your #ifdef INTERIX actually want 

to be #ifdef HAVE_POLL or some such (we try to define the appropriate flags regarding the available features in the Makefile, see for example HAVE_ALLOCA_H).

And of course, at some stage it would be good to at least skim http://repo.or.cz/w/git.git?a=blob_plain;f=Documentation/SubmittingPatches

Ciao, Dscho

Erik Faye-Lund· Mar 9, 2010, 11:28 UTC · re: Markus Duft · lore
On Tue, Mar 9, 2010 at 11:35 AM, Markus Duft <markus.duft@salomon.at> wrote:
> any comments on the patch?

I find it a bit odd to submit a patch against the Git source code that hasn't been produced by Git, but manual diff'ing of different source trees...

-- 
Erik "kusma" Faye-Lund
Daniel Barkalow· Mar 10, 2010, 18:32 UTC · re: Markus Duft · lore
On Tue, 9 Mar 2010, Markus Duft wrote:
Show 25 quoted lines
> Hey.
> 
> i have "ported" git to interix (haha, wasn't so much of a problem after
> all ;)). i have a small patch (attached). i know that it sure doesn't
> have production quality yet, but i try gathering ideas/input here.
> 
> additionally to the patch i'm setting:
> 
> 147     if [[ ${CHOST} == *-interix* ]] ; then
> 148         myopts="${myopts} NO_IPV6=YesPlease"
> 149         myopts="${myopts} NO_MEMMEM=YesPlease"
> 150         myopts="${myopts} NO_MKDTEMP=YesPlease"
> 151         myopts="${myopts} NO_STRTOUMAX=YesPlease"
> 152         myopts="${myopts} NO_STRTOULL=YesPlease"
> 153         myopts="${myopts} NO_INET_NTOP=YesPlease"
> 154         myopts="${myopts} NO_INET_PTON=YesPlease"
> 155         myopts="${myopts} NO_NSEC=YesPlease"
> 156         myopts="${myopts} NO_MKSTEMPS=YesPlease"
> 157     fi
> 
> interix lacks propper poll() support (poll is there but broken), so some
> of the things in git have to be disabled for now, or replaced by a
> select() code (but that'd take precious time of mine to implement (argh)).
> 
> any comments on the patch? any chance to get stuff upstream?

If you've got programs that don't work at all without some library function that you don't have, it's better to not build them at all (by not having them in the make targets) than build binaries that refuse to run. Doing it that way means you don't need to get the rest of the file to compile, and makes it more clear before runtime what functionality will be missing.

Also, if you make a NO_POLL and use that, someone else might make a compat_poll(). Or maybe not, but a workaround certainly won't get done if you just use __INTERIX.

	-Daniel
*This .sig left intentionally blank*
Markus Duft· Mar 11, 2010, 07:13 UTC · re: Daniel Barkalow · lore
On 03/10/10 19:32, Daniel Barkalow wrote:
> On Tue, 9 Mar 2010, Markus Duft wrote:
> 
[snip]
Show 11 quoted lines
> 
> If you've got programs that don't work at all without some library 
> function that you don't have, it's better to not build them at all (by not 
> having them in the make targets) than build binaries that refuse to run. 
> Doing it that way means you don't need to get the rest of the file to 
> compile, and makes it more clear before runtime what functionality will be 
> missing.
> 
> Also, if you make a NO_POLL and use that, someone else might make a 
> compat_poll(). Or maybe not, but a workaround certainly won't get done if 
> you just use __INTERIX.

thanks for the input (all of you). i will spend some more time, doing a better patch... :)

markus
> 
> 	-Daniel
> *This .sig left intentionally blank*

← back to recent threads