* Re: [PATCH] dists: add prep-debuild target
@ 2026-06-15 14:46 Kris Van Hees
0 siblings, 0 replies; only message in thread
From: Kris Van Hees @ 2026-06-15 14:46 UTC (permalink / raw)
To: dtrace, dtrace-devel
Not adopting this patch for the reasons listed below.
> Here's a tiny patch to let you avoid the make dist in favour of a simple
> 'make prep-debuild'. (I didn't fold it into make prep-debian because
> some package building tools, like apt-src, don't need the .orig.tar.bz2
> at all.)
The reason why I do not do this is because the steps I outline are to get to
the initial state of having the files necessary to build DTrace for Debian.
This is what needs to be done to go from the upstream dtrace git tree to what
is needed to e.g. be able to use apt-src.
We are a non-native Debian package, so there is some work needed to go from
the upstream tree to what Debian needs. I don't want to automate too much of
it because it is certainly possible that the creation of the Debian package
files is going to be done in a place other than where the git clone is located.
E.g. I create the tarball (make dist) on a non-Debian system, and then do the
building on a very pristine Debian stable system to make sure that it ought to
work in a clean-room environment.
On Fri, Feb 13, 2026 at 02:29:05PM +0000, Nick Alcock wrote:
> This does the creation of the .orig.tar.bz2 in the parent of
> the source tree for you.
> ---
> dists/Build | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/dists/Build b/dists/Build
> index c75f933270fa3..f1ed1a4627176 100644
> --- a/dists/Build
> +++ b/dists/Build
> @@ -9,8 +9,14 @@ dists_DIR := $(current-dir)
> # Prepare package building on Debian (copy ./dists/debian in ./debian, and
> # generate the debian/changelog file.
>
> -prep-debian::
> +prep-debian:: dist
> $(call describe-target,DIST-PREP,Debian)
> rm -rf debian
> cp -rp $(dists_DIR)/debian .
> debian/mkChangelog debian/control dtrace.spec > debian/changelog
> +
> +# Prepare for debuild, which needs a tarball to already be present.
> +# Many wrappers around debuild already do this for you.
> +
> +prep-debuild::
> + mv dtrace-$(VERSION).tar.bz2 ../dtrace_$(VERSION).orig.tar.bz2
> --
> 2.47.3
> 8<--------------------------------->8
>
> > Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
>
> A couple of questions below.
>
> > +prep-debian::
> > + $(call describe-target,DIST-PREP,Debian)
> > + rm -rf debian
> > + cp -rp $(dists_DIR)/debian .
> > + debian/mkChangelog debian/control dtrace.spec > debian/changelog
>
> (I have a tiny patch for this.)
>
> > diff --git a/dists/debian/control b/dists/debian/control
> > new file mode 100644
> > index 00000000..56687a82
> > --- /dev/null
> > +++ b/dists/debian/control
> > @@ -0,0 +1,74 @@
> > +Source: dtrace
> > +Section: utils
> > +Priority: optional
> > +Maintainer: Kris Van Hees <kris.van.hees@oracle.com>
> > +Build-Depends: debhelper-compat (= 13),
> > + bison, flex, gawk, gcc-bpf, binutils-bpf, valgrind, binutils-dev, login.defs,
> > + libbpf-dev, libc-dev (>= 2.34), libelf-dev, libfuse3-dev, libpcap-dev,
> > + libpfm4-dev, libsystemd-dev, libz-dev
> > +Standards-Version: 4.5.1
>
> Why 4.5.1? I guess it's what debhelper writes right now. (The current
> version of Debian Policy is 4.7.3. It looks to me like we're compatible
> with it.)
>
> > +Homepage: https://github.com/oracle/dtrace-utils/
> > +Rules-Requires-Root: no
> > +
> > +Package: dtrace
> > +Architecture: any
> > +Depends: ${misc:Depends}, ${shlibs:Depends}
> > +Description: Dynamic tracing for Linux (DTrace)
> > + This is the official Linux port of the advanced tracing tool DTrace.
> > + .
> > + DTrace is a high-level dynamic tracing tool for Linux, built on kernel
> > + tracing features (tracepoints, function probes (fentry/fexit), dynamic
> > + kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
> > + leveraging BPF as execution engine. It features an integrated compiler
> > + for its high-level tracing language and native support for interacting
> > + with the BPF engine, significantly reducing runtime dependencies
>
> Full stop at end of sentence (and for all the others below.)
>
> > +Package: libdtrace2
> > +Architecture: any
> > +Depends: ${misc:Depends}, ${shlibs:Depends},
> > + fuse3, libctf0, libelf1t64, libfuse3-4, libpcap0.8t64, libpfm4, libz1
> > +Description: Dynamic tracing for Linux (DTrace) (library)
> > + This is the official Linux port of the advanced tracing tool DTrace.
> > + .
> > + DTrace is a high-level dynamic tracing tool for Linux, built on kernel
> > + tracing features (tracepoints, function probes (fentry/fexit), dynamic
> > + kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
> > + leveraging BPF as execution engine. It features an integrated compiler
> > + for its high-level tracing language and native support for interacting
> > + with the BPF engine, significantly reducing runtime dependencies
> > + .
> > + This package contains the shared library.
> > +
> > +Package: libdtrace2-dev
> > +Architecture: any
> > +Depends: ${misc:Depends},
> > + libdtrace2 (= ${binary:Version})
> > +Description: Dynamic tracing for Linux (DTrace) (development)
> > + This is the official Linux port of the advanced tracing tool DTrace.
> > + .
> > + DTrace is a high-level dynamic tracing tool for Linux, built on kernel
> > + tracing features (tracepoints, function probes (fentry/fexit), dynamic
> > + kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
> > + leveraging BPF as execution engine. It features an integrated compiler
> > + for its high-level tracing language and native support for interacting
> > + with the BPF engine, significantly reducing runtime dependencies
> > + .
> > + This package contains the development files necessary to develop
> > + alternative implementations of the user interface for libdtrace, i.e.
> > + replacements for dtrace(1) itself.
> > +
> > +Package: dtrace-tests
> > +Architecture: any
> > +Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends},
> > + binutils, cpp, gawk, gcc, make, pkgconf, tshark, bpftool
> > +Description: Dynamic tracing for Linux (DTrace) (testsuite)
> > + This is the official Linux port of the advanced tracing tool DTrace.
> > + .
> > + DTrace is a high-level dynamic tracing tool for Linux, built on kernel
> > + tracing features (tracepoints, function probes (fentry/fexit), dynamic
> > + kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
> > + leveraging BPF as execution engine. It features an integrated compiler
> > + for its high-level tracing language and native support for interacting
> > + with the BPF engine, significantly reducing runtime dependencies
> > + .
> > + This package contains the testsuite.
>
> (... up to here.)
>
> > diff --git a/dists/debian/copyright b/dists/debian/copyright
> > new file mode 100644
> > index 00000000..1a5c8f64
> > --- /dev/null
> > +++ b/dists/debian/copyright
> > @@ -0,0 +1,103 @@
> > +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
> > +Upstream-Name: dtrace
> > +Upstream-Contact: Kris Van Hees <kris.van.hees@oracle.com>
> > +Source: https://github.com/oracle/dtrace-utils/
> > +
> > +Files: *
> > +Copyright: Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
> > +License: UPL-1.0
> > +
> > +Files: include/linux/bpf.h
> > +Copyright: Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
> > +License: GPL-2 with Linux-syscall-note exception
> > +
> > +Files: include/linux/btf.h
> > +Copyright: Copyright (c) 2018 Facebook
> > +License: GPL-2 with Linux-syscall-note exception
> > +
> > +Files: include/sys/auxv.h include/sys/bitmap.h
> > +Copyright: copyright (c) 1984, 1986, 1987, 1988, 1989 at&t
>
> AT&T, surely?
>
> > --- /dev/null
> > +++ b/dists/debian/libdtrace2-dev.install
> > @@ -0,0 +1,5 @@
> > +usr/lib/${DEB_HOST_MULTIARCH}/libdtrace.so
> > +usr/include/dtrace
> > +usr/include/dtrace.h
> > +usr/include/sys/dtrace.h
> > +usr/include/sys/dtrace_types.h
> > diff --git a/dists/debian/libdtrace2.install b/dists/debian/libdtrace2.install
> > new file mode 100644
> > index 00000000..36294de3
> > --- /dev/null
> > +++ b/dists/debian/libdtrace2.install
> > @@ -0,0 +1,12 @@
> > +usr/lib/${DEB_HOST_MULTIARCH}/dtrace/[0-9]*/
> > +usr/lib/${DEB_HOST_MULTIARCH}/dtrace/bpf_dlib.o
> > +usr/lib/${DEB_HOST_MULTIARCH}/dtrace/drti/
> > +usr/lib/${DEB_HOST_MULTIARCH}/dtrace/include/
> > +usr/lib/${DEB_HOST_MULTIARCH}/libdtrace.so.*
> > +usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/dtrace.pc
> > +usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/dtrace_sdt.pc
> > +usr/lib/systemd/system/dtprobed.service
> > +usr/lib/systemd/system/dtrace-usdt.target
> > +usr/lib/systemd/system-preset/50-dtprobed.preset
> > +usr/lib/udev/rules.d/60-dtprobed.rules
> > +usr/sbin/dtprobed
>
> I've always been worried that these lists would be hard to maintain.
> It's a shame we can't autogenerate them, though it's hard to imagine
> from what. Maybe in the future we should do like we did for the version
> numbers, and have a centralized list of files from which we can generate
> things like this *and* the install commands in the Build files.
>
> > +++ b/dists/debian/mkChangelog
> > @@ -0,0 +1,174 @@
> > +#!/usr/bin/awk -f
> > +
> > +#
> > +# This script can be used to convert the dtrace.spec into a Debian changelog
> > +# file. It is intended to be invoked from the 'prep-debian' make target, but
> > +# it can be used manually as well:
> > +# mkChangelog debian/control dtrace.spec > debian/changelog
>
> This is really nifty!
>
> > diff --git a/dists/debian/patches/debian-configure.patch b/dists/debian/patches/debian-configure.patch
> > new file mode 100644
> > index 00000000..d4a89bb9
> > --- /dev/null
> > +++ b/dists/debian/patches/debian-configure.patch
> > @@ -0,0 +1,17 @@
> > +Description: issue a warning for unknown configure options
> > + The Debian build system specifies configure options that are not known to
> > + the DTrace configure script. They should not cause the configure script
> > + to abort.
> > +--- dtrace-2.0.4.orig/configure
> > ++++ dtrace-2.0.4/configure
> > +@@ -172,8 +172,7 @@ for option in "$@"; do
> > + HAVE_VALGRIND=*) write_config_var VALGRIND "$option";;
> > + HAVE_BPFV3=*) write_config_var BPFV3 "$option";;
> > + HAVE_BPFMASM=*) write_config_var BPFMASM "$option";;
> > +- *) echo "Unknown option $option" >&2
> > +- exit 1;;
> > ++ *) echo "Unknown option $option" >&2;;
> > + esac
> > + done
>
> I assumed you could just stuff an || true in there, but this is being
> invoked by dh_auto_configure, so that option isn't available (plus, of
> course, if there's an actual error other than unknown args, we don't
> want to fail).
>
> Maybe we should just not exit with exitcode 1 on unknown configure
> options, only IIRC Gentoo actually wants us to. This may be the best we
> can do.
>
> > diff --git a/dists/debian/patches/debian-interpreter-paths.patch b/dists/debian/patches/debian-interpreter-paths.patch
> > new file mode 100644
> > index 00000000..58bea538
> > --- /dev/null
> > +++ b/dists/debian/patches/debian-interpreter-paths.patch
> > @@ -0,0 +1,107 @@
> > +Description: fix interpreter paths in tests
> > + Lintian prefers /bin/bash and /bin/sed over /usr/bin/bash and /usr/bin/sed.
>
> Honestly this one I think we should do upstream. I always thought that
> /bin/bash is universal and /usr/bin/bash less so.
>
> > --- /dev/null
> > +++ b/dists/debian/rules
> > @@ -0,0 +1,24 @@
> > +#!/usr/bin/make -f
> > +# You must remove unused comment lines for the released package.
> > +export DH_VERBOSE = 1
> > +export DEB_BUILD_MAINT_OPTIONS = hardening=+all
> > +export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
>
> I suppose without -Werror this is safe :)
>
> --
> NULL && (void)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-15 14:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-15 14:46 [PATCH] dists: add prep-debuild target Kris Van Hees
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox