Control: tags -1 + patch

Simon McVittie <s...@debian.org> writes:

> On 15/12/13 23:22, Alessandro Ghedini wrote:
>> While I still think this would be nice, it turned out to be a bit
>> more difficult to implement (basically the pkg-config file is
>> generated at build time, and it can't be created if the configure
>> stage fails).
>
> Thanks for looking at this, anyway.
>
> You could generate a stub .pc file from debian/rules on unsupported
> architectures, maybe, and install the header files (or stub versions
> where all the macros expand to nothing) manually? The .pc file format
> is hardly rocket science.

Well, I think I've figured it out; there are really *two* packages
wanting to be split off, an Arch:all package and an Arch:any package.

I'm providing two patches for this, one of which should look awfully
familiar; I suggest you save the files and use "git am" to apply
them, then if you like you can use "git rebase -i" to squash them (but
if you do that, please set "Author: Samuel Bronson <naes...@gmail.com>"
on the resulting commit.)
>From 8bba01f515cb8ea52009d4547f9716e813e4e826 Mon Sep 17 00:00:00 2001
From: Alessandro Ghedini <alessan...@ghedini.me>
Date: Wed, 4 Dec 2013 18:03:47 +0100
Subject: [PATCH 1/3] Move headers and pkg-config file to valgrind-dev

Closes: #731228
(cherry picked from commit 9da839f72ec6b3fc2ee517e9b8e2e148aa4a525b)
---
 debian/NEWS                 | 14 ++++++++++++++
 debian/control              | 18 +++++++++++++++++-
 debian/valgrind-dev.install |  6 ++++++
 debian/valgrind.install     |  7 +------
 4 files changed, 38 insertions(+), 7 deletions(-)
 create mode 100644 debian/valgrind-dev.install

diff --git a/debian/NEWS b/debian/NEWS
index 1cd1e4a..554dbc0 100644
--- a/debian/NEWS
+++ b/debian/NEWS
@@ -1,3 +1,17 @@
+valgrind (1:3.9.0-2) UNRELEASED; urgency=low
+
+  As of version 1:3.9.0-2 the headers and the pkg-config file have been moved
+  to the new valgrind-dev package, so that packages that consume them don't
+  have to stay in sync with the list of valgrind supported architectures.
+
+  It should be safe to use them even on platforms not supported by valgrind
+  where the various macro provided will result in nop.
+
+  For the time being valgrind will depend on valgrind-dev in order to avoid
+  "breaking" packages that expect those files in the main valgrind package.
+
+ -- Alessandro Ghedini <gh...@debian.org>  Wed, 04 Dec 2013 18:09:51 +0100
+
 valgrind (1:3.7.0-5) unstable; urgency=low
 
   Valgrind symbols have been stripped since version 1:3.6.1-5 because they take
diff --git a/debian/control b/debian/control
index 14ae253..092a2bc 100644
--- a/debian/control
+++ b/debian/control
@@ -21,7 +21,9 @@ Homepage: http://www.valgrind.org/
 
 Package: valgrind
 Architecture: amd64 armhf i386 mips mipsel mips64 mips64el powerpc ppc64 s390x x32
-Depends: ${misc:Depends}, ${shlibs:Depends}, libc6-dbg
+Depends: ${misc:Depends}, ${shlibs:Depends},
+ valgrind-dev (= ${binary:Version}),
+ libc6-dbg
 Suggests: valgrind-mpi, kcachegrind, alleyoop, valkyrie (>> 1.3.0)
 Recommends: valgrind-dbg, gdb
 Breaks: valgrind-dev
@@ -44,6 +46,20 @@ Description: instrumentation framework for building dynamic analysis tools
   * a second heap profiler that examines how heap blocks are used (DHAT)
   * a SimPoint basic block vector generator (BBV)
 
+Package: valgrind-dev
+Architecture: any
+Depends: ${misc:Depends}
+Multi-Arch: same
+Description: instrumentation framework for building dynamic analysis tools (dev files)
+ Valgrind is a system for debugging and profiling Linux programs. With its tool
+ suite you can automatically detect many memory management and threading bugs,
+ avoiding hours of frustrating bug-hunting and making your programs more stable.
+ You can also perform detailed profiling to help speed up your programs and use
+ Valgrind to build new tools.
+ .
+ This package provides the header files for manipulating and querying valgrind's
+ execution from instrumented programs.
+
 Package: valgrind-dbg
 Priority: extra
 Section: debug
diff --git a/debian/valgrind-dev.install b/debian/valgrind-dev.install
new file mode 100644
index 0000000..c94c6d7
--- /dev/null
+++ b/debian/valgrind-dev.install
@@ -0,0 +1,6 @@
+usr/include/valgrind/memcheck.h
+usr/include/valgrind/drd.h
+usr/include/valgrind/callgrind.h
+usr/include/valgrind/helgrind.h
+usr/include/valgrind/valgrind.h
+usr/lib/pkgconfig/*
diff --git a/debian/valgrind.install b/debian/valgrind.install
index 14039b5..634c700 100644
--- a/debian/valgrind.install
+++ b/debian/valgrind.install
@@ -1,10 +1,5 @@
 usr/bin/*
-usr/include/valgrind/memcheck.h
-usr/include/valgrind/drd.h
-usr/include/valgrind/callgrind.h
-usr/include/valgrind/helgrind.h
-usr/include/valgrind/valgrind.h
 usr/share/*
-usr/lib/*
+usr/lib/valgrind/*
 debian/valgrind.sh	usr/bin
 debian/supp/*		usr/lib/valgrind
-- 
2.0.0

>From bbf96b570707f516d3b34d705d0f37fb22080b8b Mon Sep 17 00:00:00 2001
From: Samuel Bronson <naes...@gmail.com>
Date: Mon, 23 Jun 2014 16:55:37 -0400
Subject: [PATCH 2/3] Take another stab at splitting out the headers.

This time, we split out *two* packages; see NEWS.Debian for details:
- valgrind-dev, an Arch:all package with just the client request headers
- valgrind-tool-dev, an Arch:any package with:
  + internal includes
  + internal libraries
  + internal a pkg-config file
  This is intended to allow out-of-tree tool development, but don't
  ask us how, because this is all totally undocumented.

We had actually stopped installing the internel headers entirely
because I (Samuel Bronson) failed to notice that, while out-of-tree
tool development *is* entirely undocumented, the requisite
libraries *are* actually shipped.  This change reverts that mistake of
mine.

Git-Dch: Full
Closes: #731228
Thanks: Simon McVittie for the suggestion, Sven Joachim for pointing out a problem with our first attempt (c.f. bug# 732239), and upstream for feedback regarding how these files ought to be packaged.
---
 debian/NEWS                      | 39 +++++++++++++++++++++++++++++++--------
 debian/control                   | 29 +++++++++++++++++++++++------
 debian/rules                     |  6 +++++-
 debian/valgrind-dev.install      |  1 -
 debian/valgrind-tool-dev.install |  6 ++++++
 5 files changed, 65 insertions(+), 16 deletions(-)
 create mode 100644 debian/valgrind-tool-dev.install

diff --git a/debian/NEWS b/debian/NEWS
index 554dbc0..b1ec774 100644
--- a/debian/NEWS
+++ b/debian/NEWS
@@ -1,14 +1,37 @@
-valgrind (1:3.9.0-2) UNRELEASED; urgency=low
+valgrind (1:3.9.0-7) UNRELEASED; urgency=medium
 
-  As of version 1:3.9.0-2 the headers and the pkg-config file have been moved
-  to the new valgrind-dev package, so that packages that consume them don't
-  have to stay in sync with the list of valgrind supported architectures.
+  In version 1:3.9.0-2 we tried to split off the headers/pkg-config file
+  into valgrind-dev, the goal being to allow other packages to use the
+  client request headers without a hardcoded list of architectures valgrind
+  is available on.
 
-  It should be safe to use them even on platforms not supported by valgrind
-  where the various macro provided will result in nop.
+  Unfortunately, our appraoch was a bit too simplistic: while the client
+  request headers are the same for all architectures, the pkg-config file
+  is not; it seems (judging by its contents and commit history -- it is
+  otherwise completely undocumented) to be intended for use in building
+  out-of-tree valgrind tools.
 
-  For the time being valgrind will depend on valgrind-dev in order to avoid
-  "breaking" packages that expect those files in the main valgrind package.
+  So now we're going to try something a bit different:
+
+  * The client request headers are moved to valgrind-dev, an Arch:all
+    package, so that packages that consume them don't have to stay in sync
+    with the list of valgrind supported architectures.
+
+    It should be safe to use them even on platforms not supported by valgrind,
+    where the various macros provided will just do whatever it is they're
+    documented to do when not run under valgrind (i.e., those that return a
+    value will return the default value).
+
+  * The pkg-config file, and the associated internal headers and static
+    libraries, are now in valgrind-tool-dev, an Arch:any package..  (The
+    pkg-config file has to be in this package because it has all manner of
+    architecture-dependent data in it.  If you just want to use the client
+    headers, please simply [test for and] #include <valgrind/foo.h> rather
+    than futzing with pkg-config.)
+
+  For the time being, valgrind will depend on valgrind-dev in order to avoid
+  "breaking" packages (or users) that expect the client headers to be in
+  that package.
 
  -- Alessandro Ghedini <gh...@debian.org>  Wed, 04 Dec 2013 18:09:51 +0100
 
diff --git a/debian/control b/debian/control
index 092a2bc..0f6d1d4 100644
--- a/debian/control
+++ b/debian/control
@@ -22,12 +22,11 @@ Homepage: http://www.valgrind.org/
 Package: valgrind
 Architecture: amd64 armhf i386 mips mipsel mips64 mips64el powerpc ppc64 s390x x32
 Depends: ${misc:Depends}, ${shlibs:Depends},
- valgrind-dev (= ${binary:Version}),
+ valgrind-dev (= ${source:Version}),
  libc6-dbg
-Suggests: valgrind-mpi, kcachegrind, alleyoop, valkyrie (>> 1.3.0)
+Suggests: valgrind-mpi, valgrind-tool-dev (= ${binary:Version}),
+ kcachegrind, alleyoop, valkyrie (>> 1.3.0)
 Recommends: valgrind-dbg, gdb
-Breaks: valgrind-dev
-Replaces: valgrind-dev
 Description: instrumentation framework for building dynamic analysis tools
  Valgrind is a system for debugging and profiling Linux programs. With its tool
  suite you can automatically detect many memory management and threading bugs,
@@ -47,9 +46,12 @@ Description: instrumentation framework for building dynamic analysis tools
   * a SimPoint basic block vector generator (BBV)
 
 Package: valgrind-dev
-Architecture: any
+Architecture: all
 Depends: ${misc:Depends}
-Multi-Arch: same
+Suggests: valgrind
+Breaks: valgrind (<= 1:3.9.0-7~)
+Replaces: valgrind (<= 1:3.9.0-7~)
+Multi-Arch: foreign
 Description: instrumentation framework for building dynamic analysis tools (dev files)
  Valgrind is a system for debugging and profiling Linux programs. With its tool
  suite you can automatically detect many memory management and threading bugs,
@@ -60,6 +62,21 @@ Description: instrumentation framework for building dynamic analysis tools (dev
  This package provides the header files for manipulating and querying valgrind's
  execution from instrumented programs.
 
+Package: valgrind-tool-dev
+Depends: ${misc:Depends}, valgrind (= ${binary:Version})
+Breaks: valgrind-dev (<= 1:3.9.0-2), valgrind (<< 1:3.9.0-7~)
+Replaces: valgrind-dev (<= 1:3.9.0-2), valgrind (<< 1:3.9.0-7~)
+Architecture: amd64 armhf i386 mips mipsel mips64 mips64el powerpc ppc64 s390x x32
+Description: instrumentation framework for building dynamic analysis tools (tool dev)
+ Valgrind is a system for debugging and profiling Linux programs. With its tool
+ suite you can automatically detect many memory management and threading bugs,
+ avoiding hours of frustrating bug-hunting and making your programs more stable.
+ You can also perform detailed profiling to help speed up your programs and use
+ Valgrind to build new tools.
+ .
+ This package provides the header files and libraries for needed to build
+ out-of-tree tools, and a pkg-config file to tell them what's what.
+
 Package: valgrind-dbg
 Priority: extra
 Section: debug
diff --git a/debian/rules b/debian/rules
index 91ea203..3053743 100755
--- a/debian/rules
+++ b/debian/rules
@@ -31,9 +31,13 @@ target=$(CURDIR)/debian/valgrind
 override_dh_install:
 	$(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
 	dh_install -pvalgrind -Xlibmpiwrap
+	#rm $(target)/usr/lib/valgrind/*.a  # These go in -tool-dev
 	mv -f $(target)/usr/bin/valgrind $(target)/usr/bin/valgrind.bin
 	mv -f ${target}/usr/bin/valgrind.sh $(target)/usr/bin/valgrind
-	dh_install --remaining-packages
+	dh_install --remaining-packages --list-missing
 
 override_dh_installchangelogs:
 	dh_installchangelogs NEWS
+
+override_dh_builddeb:
+	dh_builddeb -- -z4
diff --git a/debian/valgrind-dev.install b/debian/valgrind-dev.install
index c94c6d7..f27e14a 100644
--- a/debian/valgrind-dev.install
+++ b/debian/valgrind-dev.install
@@ -3,4 +3,3 @@ usr/include/valgrind/drd.h
 usr/include/valgrind/callgrind.h
 usr/include/valgrind/helgrind.h
 usr/include/valgrind/valgrind.h
-usr/lib/pkgconfig/*
diff --git a/debian/valgrind-tool-dev.install b/debian/valgrind-tool-dev.install
new file mode 100644
index 0000000..41611be
--- /dev/null
+++ b/debian/valgrind-tool-dev.install
@@ -0,0 +1,6 @@
+usr/include/valgrind/config.h
+usr/include/valgrind/libvex*.h
+usr/include/valgrind/pub_tool_*.h
+usr/include/valgrind/vki/*.h
+usr/lib/valgrind/*.a
+usr/lib/pkgconfig/*
-- 
2.0.0

I'm also including an extra patch that I nearly lumped in with patch 2;
it's a potential alternative to the Recommends on valgrind-dbg.  I must
have looked at dh_strip(1) for some reason while I was working on the
main changes ...
>From 5f34f52218cde078d00578c0ef6807688eb1c5cc Mon Sep 17 00:00:00 2001
From: Samuel Bronson <naes...@gmail.com>
Date: Mon, 23 Jun 2014 23:48:49 -0400
Subject: [PATCH 3/3] Don't strip preload libraries; README_PACKAGERS says not
 to

TODO: Could downgrade the Recommends: valgrind-dbg to a Suggests;
should drop the README.Debian chunk about this.

Note: I went for ages with no valgrind-dbg installed, and I'm not sure
I've ever actually *seen* the warned-of issues.
---
 debian/rules                  | 2 +-
 debian/valgrind-mpi.overrides | 3 +++
 debian/valgrind.overrides     | 3 +++
 3 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 debian/valgrind-mpi.overrides
 create mode 100644 debian/valgrind.overrides

diff --git a/debian/rules b/debian/rules
index 3053743..938764e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -25,7 +25,7 @@ override_dh_auto_build:
 	$(MAKE) -C docs man-pages
 
 override_dh_strip:
-	dh_strip --dbg-package=valgrind-dbg
+	dh_strip -X/usr/lib/valgrind/ --dbg-package=valgrind-dbg
 
 target=$(CURDIR)/debian/valgrind
 override_dh_install:
diff --git a/debian/valgrind-mpi.overrides b/debian/valgrind-mpi.overrides
new file mode 100644
index 0000000..950fb03
--- /dev/null
+++ b/debian/valgrind-mpi.overrides
@@ -0,0 +1,3 @@
+# Valgrind is documented as requiring debugging symbols for these
+# see README_PACKAGERS
+unstripped-binary-or-object usr/lib/valgrind/*
diff --git a/debian/valgrind.overrides b/debian/valgrind.overrides
new file mode 100644
index 0000000..8b39b00
--- /dev/null
+++ b/debian/valgrind.overrides
@@ -0,0 +1,3 @@
+# Valgrind is documented as requiring debugging symbols for these;
+# see README_PACKAGERS
+unstripped-binary-or-object usr/lib/valgrind/*
-- 
2.0.0

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!

Reply via email to