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

Bug#714105: O: pinktrace -- ptrace wrapper library



I attached the changes I've made to my local copy since the last upload. The prospective adopter/QA-uploader is welcome to incorporate them into the new release.

--
Jakub Wilk
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+pinktrace (0.1.2-3) UNRELEASED; urgency=low
+
+  * When building Python extensions, use a wrapper over gcc to avoid setting
+    SONAMEs on them.
+  * Update patch headers.
+  * Run Python tests with PYTHONWARNINGS=d and PYTHONHASHSEED=random.
+  * Build Python documentation only using default Python 2.X version.
+  * Make sure that the main Python 3 module can be imported only with these
+    Python versions for which extensions modules are available.
+  * Touch test-stamp files.
+
+ -- Jakub Wilk <jwilk@debian.org>  Tue, 07 May 2013 00:01:12 +0200
+
 pinktrace (0.1.2-2) experimental; urgency=low
 
   * Remove trailing whitespace from debian/control, debian/copyright and
diff --git a/debian/gcc b/debian/gcc
new file mode 100755
--- /dev/null
+++ b/debian/gcc
@@ -0,0 +1,20 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+my @args = ('gcc');
+while (defined(my $arg = shift @ARGV)) {
+    if ($arg eq '-Wl,-soname' and @ARGV) {
+        my $arg2 = shift @ARGV;
+        if ($arg2 =~ /^-Wl,(\w+)[.]so$/ and $1 !~ /^lib/) {
+            print STDERR "gcc wrapper: ignoring $arg $arg2\n";
+        } else {
+            push @args, $arg, $arg2;
+        }
+    } else {
+        push @args, $arg;
+    }
+}
+exec @args;
+
+# vim:ts=4 sw=4 et
diff --git a/debian/patches/fix-ftbfs-ia64.diff b/debian/patches/fix-ftbfs-ia64.diff
--- a/debian/patches/fix-ftbfs-ia64.diff
+++ b/debian/patches/fix-ftbfs-ia64.diff
@@ -1,11 +1,11 @@
-Description: Fix FTBFS on ia64.
+Description: fix FTBFS on ia64
 Author: Jakub Wilk <jwilk@debian.org>
 Bug: https://github.com/alip/pinktrace/issues/22
 Forwarded: yes
-Last-Update: 2012-03-07
+Last-Update: 2012-04-29
 
---- pinktrace-0.1.2.orig/src/pink-linux-trace-ia64.c
-+++ pinktrace-0.1.2/src/pink-linux-trace-ia64.c
+--- a/src/pink-linux-trace-ia64.c
++++ b/src/pink-linux-trace-ia64.c
 @@ -45,7 +45,6 @@
  
  #define ORIG_ACCUM	(PT_R15)
diff --git a/debian/patches/fix-ftbfs-powerpc.diff b/debian/patches/fix-ftbfs-powerpc.diff
--- a/debian/patches/fix-ftbfs-powerpc.diff
+++ b/debian/patches/fix-ftbfs-powerpc.diff
@@ -1,12 +1,12 @@
-Description: Fix FTBFS on 32-bit powerpc.
+Description: fix FTBFS on 32-bit powerpc
 Author: Jakub Wilk <jwilk@debian.org>
 Bug: https://github.com/alip/pinktrace/issues/21
 Forwarded: yes
-Last-Update: 2012-03-07
+Last-Update: 2012-04-29
 
---- pinktrace-0.1.2.orig/src/pink-linux-trace-powerpc.c
-+++ pinktrace-0.1.2/src/pink-linux-trace-powerpc.c
-@@ -225,14 +225,13 @@ pink_decode_socket_fd(pid_t pid, pink_bi
+--- a/src/pink-linux-trace-powerpc.c
++++ b/src/pink-linux-trace-powerpc.c
+@@ -225,14 +225,13 @@
  		return false;
  
  	size = pink_bitness_wordsize(bitness);
diff --git a/debian/patches/libpinktrace-easy-linkage.diff b/debian/patches/libpinktrace-easy-linkage.diff
--- a/debian/patches/libpinktrace-easy-linkage.diff
+++ b/debian/patches/libpinktrace-easy-linkage.diff
@@ -1,7 +1,7 @@
-Description: Link libpinktrace-easy with libpinktrace.
+Description: link libpinktrace-easy with libpinktrace
 Author: Jakub Wilk <jwilk@debian.org>
 Bug: https://github.com/alip/pinktrace/issues/17
-Last-Update: 2012-02-20
+Last-Update: 2012-04-29
 
 --- a/src/easy/Makefile.am
 +++ b/src/easy/Makefile.am
diff --git a/debian/patches/offline-documentation.diff b/debian/patches/offline-documentation.diff
--- a/debian/patches/offline-documentation.diff
+++ b/debian/patches/offline-documentation.diff
@@ -1,7 +1,7 @@
-Description: Remove images and scripts referring to external sites.
+Description: remove images and scripts referring to external sites
 Author: Jakub Wilk <jwilk@debian.org>
 Forwarded: not-needed
-Last-Update: 2012-02-20
+Last-Update: 2012-04-29
 
 --- a/doc/_includes/google-analytics.html
 +++ /dev/null
diff --git a/debian/patches/out-of-tree-includes.diff b/debian/patches/out-of-tree-includes.diff
--- a/debian/patches/out-of-tree-includes.diff
+++ b/debian/patches/out-of-tree-includes.diff
@@ -1,9 +1,9 @@
-Description: Add $(top_builddir)/include to include path.
+Description: add $(top_builddir)/include to include path
  Add $(top_builddir)/include to include path, so that out-of-tree builds
  are possible.
 Author: Jakub Wilk <jwilk@debian.org>
 Bug: https://github.com/alip/pinktrace/issues/18
-Last-Update: 2012-02-21
+Last-Update: 2012-04-29
 
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
diff --git a/debian/patches/private-symbols.diff b/debian/patches/private-symbols.diff
--- a/debian/patches/private-symbols.diff
+++ b/debian/patches/private-symbols.diff
@@ -1,8 +1,8 @@
-Description: Don't export waitpid_nointr, which is a private symbol.
+Description: don't export waitpid_nointr, which is a private symbol
 Author: Jakub Wilk <jwilk@debian.org>
 Bug: https://github.com/alip/pinktrace/issues/19
 Forwarded: no
-Last-Update: 2012-02-20
+Last-Update: 2012-04-29
 
 --- a/include/pinktrace/easy/internal-util.h
 +++ b/include/pinktrace/easy/internal-util.h
diff --git a/debian/patches/python-test-path.diff b/debian/patches/python-test-path.diff
--- a/debian/patches/python-test-path.diff
+++ b/debian/patches/python-test-path.diff
@@ -1,8 +1,8 @@
-Description: Fix path to python-test.sh.
+Description: fix path to python-test.sh
  Fix path to python-test.sh, so that out-of-tree builds are possible.
 Author: Jakub Wilk <jwilk@debian.org>
 Forwarded: no
-Last-Update: 2012-02-20
+Last-Update: 2012-04-29
 
 --- a/python/Makefile.am
 +++ b/python/Makefile.am
diff --git a/debian/patches/soname.diff b/debian/patches/soname.diff
--- a/debian/patches/soname.diff
+++ b/debian/patches/soname.diff
@@ -1,8 +1,8 @@
-Description: Don't append ‘_’ to SONAME if the source in not git-based.
+Description: don't append ‘_’ to SONAME if the source in not git-based
 Author: Jakub Wilk <jwilk@debian.org>
 Bug: https://github.com/alip/pinktrace/issues/16
 Forwarded: no
-Last-Update: 2012-02-24
+Last-Update: 2012-04-29
 
 --- a/configure.ac
 +++ b/configure.ac
diff --git a/debian/py3versions-import-error.py b/debian/py3versions-import-error.py
new file mode 100644
--- /dev/null
+++ b/debian/py3versions-import-error.py
@@ -0,0 +1,5 @@
+import sys
+py3versions = '@PY3VERSIONS@'.split()
+if '{0}.{1}'.format(*sys.version_info) not in py3versions:
+    raise ImportError('Module {0!r} was built only for the following Python versions: {1}'.format(__name__, ', '.join(py3versions)))
+del sys, py3versions
diff --git a/debian/rules b/debian/rules
--- a/debian/rules
+++ b/debian/rules
@@ -73,28 +73,39 @@
 	echo "am_cv_python_pyexecdir='/usr/lib/python$(*)/site-packages'" > $(dir $@)/config.cache
 	echo "am_cv_python_pythondir='$${am_cv_python_pyexecdir}'" >> $(dir $@)/config.cache
 	cd $(dir $@) \
-		&& PYTHON=/usr/bin/python$(*) ../configure -C \
+		&& PYTHON=/usr/bin/python$(*) CC=$(CURDIR)/debian/gcc \
+			../configure -C \
 			$(configure_common_flags) \
 			$(configure_non_main_flags) \
 			--enable-python \
-			--enable-python-doc \
+			$(and $(filter $(shell pyversions -dv),$(*)),--enable-python-doc)
 
 obj/build-stamp: obj/config.status
 	$(MAKE) $(parallel) -C $(dir $@)
 	touch $(@)
 
-obj.python%/build-stamp: obj.python%/config.status
+obj.python2.%/build-stamp: obj.python2.%/config.status
 	$(MAKE) $(parallel) -C $(dir $@)
 	touch $(@)
 
+obj.python3.%/build-stamp: obj.python3.%/config.status
+	$(MAKE) $(parallel) -C $(dir $@)
+	sed -e 's/@PY3VERSIONS@/$(shell py3versions -vr)/' \
+		debian/py3versions-import-error.py \
+		>> $(dir $@)/python/pinktrace/__init__.py
+	touch $(@)
+
 test-stamp: obj/test-stamp
 test-stamp: $(patsubst %,obj.%/test-stamp,$(pythons))
 
 obj/test-stamp: obj/build-stamp
 	$(MAKE) -C $(dir $@) check
+	touch $(@)
 
 obj.python%/test-stamp: obj.python%/build-stamp
-	PYTHON=/usr/bin/python$(*) $(MAKE) -C $(dir $@)/python/ check
+	PYTHON=/usr/bin/python$(*) PYTHONWARNINGS=d PYTHONHASHSEED=random \
+		$(MAKE) -C $(dir $@)/python/ check
+	touch $(@)
 
 .PHONY: binary binary-arch binary-indep
 binary binary-arch: build-arch

Reply to: