[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Proposing neko and haxe changes



Hello,

attached debdiffs explain 2 uploads I'd like to do to get haxe back in
testing/wheezy which has been removed one year ago due to FTBFS on
kfreebsd-* [0].
haxe FTBFSs because it launches neko binary which can't recognize itself
via kernel nor via /proc/self/exe due to buildd limitations [1]. Outside
schroots haxe builds fine on kfreebsd-*.
neko and haxe patches fix FTBFS on both kfreebsd and hurd.

Any problem unblocking them once uploaded?
If ok, I also prepared hardening changes to both, could I add them as well?

[0] http://bugs.debian.org/621890
[1] http://bugs.debian.org/681594

Thanks for your time.

-- 
Gabriele



diff -Nru neko-1.8.1/debian/changelog neko-1.8.1/debian/changelog
--- neko-1.8.1/debian/changelog	2011-05-15 17:17:05.000000000 +0000
+++ neko-1.8.1/debian/changelog	2012-07-16 00:40:09.000000000 +0000
@@ -1,3 +1,10 @@
+neko (1.8.1-7) unstable; urgency=low
+
+  * Adopting package, replace maintainer (Closes: #628939).
+  * Add patch to fix haxe FTBFS on kfreebsd-* and hurd-i386 (Closes: #621890).
+
+ -- Gabriele Giacone <1o5g4r8o@gmail.com>  Sun, 15 Jul 2012 16:17:11 +0200
+
 neko (1.8.1-6) unstable; urgency=low
 
   * Include patch to fix compile errors on hurd-i386, thanks to Pino
diff -Nru neko-1.8.1/debian/control neko-1.8.1/debian/control
--- neko-1.8.1/debian/control	2011-05-15 17:17:05.000000000 +0000
+++ neko-1.8.1/debian/control	2012-07-16 00:40:09.000000000 +0000
@@ -1,7 +1,7 @@
 Source: neko
 Section: interpreters
 Priority: optional
-Maintainer: Jens Peter Secher <jps@debian.org>
+Maintainer: Gabriele Giacone <1o5g4r8o@gmail.com>
 Standards-Version: 3.8.4
 Build-Depends: debhelper (>= 7), quilt, pkg-config, libgc-dev, apache2-threaded-dev, libmysqlclient-dev, libsqlite3-dev, libpcre3-dev, libapr1-dev, libgtk2.0-dev
 Vcs-Hg: http://hg.debian.org/hg/collab-maint/neko
diff -Nru neko-1.8.1/debian/patches/executable-path-on-kfbsd-schroots-and-hurd.diff neko-1.8.1/debian/patches/executable-path-on-kfbsd-schroots-and-hurd.diff
--- neko-1.8.1/debian/patches/executable-path-on-kfbsd-schroots-and-hurd.diff	1970-01-01 00:00:00.000000000 +0000
+++ neko-1.8.1/debian/patches/executable-path-on-kfbsd-schroots-and-hurd.diff	2012-07-16 00:40:09.000000000 +0000
@@ -0,0 +1,88 @@
+Description: Fix haxe FTBFS on kfreebsd-* and hurd-i386
+ On kfreebsd-*, inside schroot it can't get executable name neither from kernel
+ nor from /proc/self/exe due to schroot limits (see #681594). hurd-i386 doesn't
+ support both yet.
+ This patch makes them use 'argv[0]' and 'which' command to get full pathname
+ if needed.
+Bug-Debian: http://bugs.debian.org/621890
+Author: Gabriele Giacone <1o5g4r8o@gmail.com>
+
+--- a/vm/main.c
++++ b/vm/main.c
+@@ -48,7 +48,29 @@
+ extern value neko_stats_build( neko_vm *vm );
+ 
+ 
++#if defined(__FreeBSD_kernel__) || defined (__FreeBSD__) || defined (__GNU__)
++static char *getfullpath(const char *pname) {
++	static char path[4096];
++	char win[256]="which ";
++	FILE *pipe;
++
++	if (strlen(pname)>(sizeof(win)-strlen(win)-1)) {
++		// no buffer overflows
++		return NULL;
++	} else {
++		strcat(win,pname);
++	}
++	pipe=popen(win, "r");
++	fgets(path, sizeof(path)-1, pipe);
++	path[strcspn(path,"\n")]='\0';
++	pclose(pipe);
++	return path;
++}
++
++static char *executable_path(const char *pname) {
++#else
+ static char *executable_path() {
++#endif
+ #if defined(NEKO_WINDOWS)
+ 	static char path[MAX_PATH];
+ 	if( GetModuleFileName(NULL,path,MAX_PATH) == 0 )
+@@ -68,12 +90,19 @@
+ 	mib[3] = -1;
+ 	static char path[1024];
+ 	size_t length = sizeof(path);
+-	sysctl(mib, 4, path, &length, NULL, 0);
++	if ((sysctl(mib, 4, path, &length, NULL, 0) == -1) && getenv("SCHROOT_UID")) {
++		return getfullpath(pname);
++	}
+ 	if( length < 0 || length >= 1024 ) {
+ 		return NULL;
+ 	}
+ 	path[length] = '\0';
+ 	return path;
++#elif defined(__GNU__)
++	if (strchr(pname,"/") != NULL) {
++		return pname;
++	}
++	return getfullpath(pname);
+ #elif defined(NEKO_LINUX)
+ 	static char path[1024];
+ 	int length = readlink("/proc/self/exe", path, sizeof(path));
+@@ -90,8 +119,13 @@
+ #endif
+ }
+ 
++#if defined(__FreeBSD_kernel__) || defined (__FreeBSD__) || defined (__GNU__)
++int neko_has_embedded_module( neko_vm *vm, const char *pname ) {
++	char *exe = executable_path(pname);
++#else
+ int neko_has_embedded_module( neko_vm *vm ) {
+ 	char *exe = executable_path();
++#endif
+ 	unsigned char id[8];
+ 	int pos;
+ 	if( exe == NULL )
+@@ -223,7 +257,11 @@
+ #	ifdef NEKO_STANDALONE
+ 	neko_standalone_init();
+ #	endif
++#if defined(__FreeBSD_kernel__) || defined (__FreeBSD__) || defined (__GNU__)
++	if( !neko_has_embedded_module(vm, argv[0]) ) {
++#else
+ 	if( !neko_has_embedded_module(vm) ) {
++#endif
+ 		int jit = 1;
+ 		int stats = 0;
+ 		while( argc > 1 ) {
diff -Nru neko-1.8.1/debian/patches/series neko-1.8.1/debian/patches/series
--- neko-1.8.1/debian/patches/series	2011-05-15 17:17:05.000000000 +0000
+++ neko-1.8.1/debian/patches/series	2012-07-16 00:40:09.000000000 +0000
@@ -5,3 +5,4 @@
 kfreebsd-compile-fix.diff
 kfreebsd-executable-path.diff
 hurd.diff
+executable-path-on-kfbsd-schroots-and-hurd.diff
diff -Nru haxe-2.7+20110131/debian/changelog haxe-2.7+20110131/debian/changelog
--- haxe-2.7+20110131/debian/changelog	2011-04-16 14:27:04.000000000 +0000
+++ haxe-2.7+20110131/debian/changelog	2012-07-16 01:34:05.000000000 +0000
@@ -1,3 +1,10 @@
+haxe (1:2.7+20110131-4) unstable; urgency=low
+
+  * Adopting package, replace maintainer (Closes: #628948).
+  * Add patch to fix FTBFS on hurd.
+
+ -- Gabriele Giacone <1o5g4r8o@gmail.com>  Sun, 15 Jul 2012 16:50:59 +0000
+
 haxe (1:2.7+20110131-3) unstable; urgency=low
 
   * Fix linking so that it works with multiarch-enabled zlib by simply
diff -Nru haxe-2.7+20110131/debian/control haxe-2.7+20110131/debian/control
--- haxe-2.7+20110131/debian/control	2011-04-16 13:06:09.000000000 +0000
+++ haxe-2.7+20110131/debian/control	2012-07-16 01:34:05.000000000 +0000
@@ -1,7 +1,7 @@
 Source: haxe
 Section: devel
 Priority: optional
-Maintainer: Jens Peter Secher <jps@debian.org>
+Maintainer: Gabriele Giacone <1o5g4r8o@gmail.com>
 Standards-Version: 3.9.1
 Build-Depends: debhelper (>= 7), ocaml, ocaml-best-compilers | ocaml-native-compilers, ocaml-findlib, libxml-light-ocaml-dev, camlp4 (>= 3.11), zlib1g-dev, neko (>= 1.8.1~)
 Vcs-Hg: http://hg.debian.org/hg/collab-maint/haxe
diff -Nru haxe-2.7+20110131/debian/patches/hurd.diff haxe-2.7+20110131/debian/patches/hurd.diff
--- haxe-2.7+20110131/debian/patches/hurd.diff	1970-01-01 00:00:00.000000000 +0000
+++ haxe-2.7+20110131/debian/patches/hurd.diff	2012-07-16 01:34:05.000000000 +0000
@@ -0,0 +1,22 @@
+Description: Fix FTBFS on hurd
+ Code backported from upstream.
+Author: Nicolas Cannasse <ncannasse@motion-twin.com>
+
+--- a/ocaml/extc/extc_stubs.c
++++ b/ocaml/extc/extc_stubs.c
+@@ -177,9 +177,12 @@
+ 		failwith("get_full_path");
+ 	return caml_copy_string(path);
+ #else
+-	char path[PATH_MAX];
+-	if( realpath(String_val(f),path) == NULL )
++	value cpath;
++	char *path = realpath(String_val(f),NULL);
++	if( path == NULL )
+ 		failwith("get_full_path");
+-	return caml_copy_string(path);
++	cpath = caml_copy_string(path);
++	free(path);
++	return cpath;
+ #endif
+ }
diff -Nru haxe-2.7+20110131/debian/patches/series haxe-2.7+20110131/debian/patches/series
--- haxe-2.7+20110131/debian/patches/series	2011-04-16 13:06:09.000000000 +0000
+++ haxe-2.7+20110131/debian/patches/series	2012-07-16 01:34:05.000000000 +0000
@@ -1 +1,2 @@
 debian-file-locations.diff
+hurd.diff



Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: