Seeking consensus on dh
Seeking consensus on dh
Posted Jun 6, 2019 2:19 UTC (Thu) by filbranden (guest, #87848)Parent article: Seeking consensus on dh
What, 4 different build systems for a package? (debhelper, dh, CDBS and perhaps I'm wrong but I recall there might have been another?) Not to mention that most of this is built on top of a makefile (rules), a LOT of Perl, some control files using RFC822(!?!)-like headers and pedantic requirements for the changelog.
For some reason, after looking at building DEBs, RPM spec files looked a lot less ugly than they used to.
Oh, and when I actually needed to build a couple hundred of DEBs, I ended up building a tarball and turning that into a DEB, that was the only sane approach really. (https://docs.bazel.build/versions/master/be/pkg.html#pkg_deb)
Posted Jun 6, 2019 2:34 UTC (Thu)
by mirabilos (subscriber, #84359)
[Link] (10 responses)
Posted Jun 6, 2019 7:51 UTC (Thu)
by jond (subscriber, #37669)
[Link] (4 responses)
Posted Jun 6, 2019 9:17 UTC (Thu)
by epa (subscriber, #39769)
[Link] (3 responses)
Posted Jun 6, 2019 10:06 UTC (Thu)
by smurf (subscriber, #17840)
[Link] (1 responses)
The other way would be to process the RPM spec with, well, RPM, and the re-package the resulting RPM binary package to a .deb archive. This is reasonably simple to do, and flexible enough when you allow the user to edit the intermediate result.
I leave the question of whether getting RPM to run on Debian systems would be easier than writing a spec converter to whoever tries both and compares the effort involved. ;-)
Posted Jun 6, 2019 13:10 UTC (Thu)
by epa (subscriber, #39769)
[Link]
Posted Jun 7, 2019 10:54 UTC (Fri)
by Conan_Kudo (subscriber, #103240)
[Link]
I use it for building Debian packages all the time. It doesn't fully support everything a spec file has, but it's got a good chunk of it already.
Posted Jun 14, 2019 11:27 UTC (Fri)
by Wol (subscriber, #4433)
[Link] (4 responses)
It's not RPM's fault that different distros have different *POLICIES* - not helped by the fact that SUSE (the second major user of rpm) actually PRE-dates Red Hat and rpm.
So it IS possible to retro-fit rpm to a completely different set of packages, because that's what SUSE did all those years ago :-) Dunno how easy that would be with deb, I'm unaware of any example where that's been done.
Cheers,
Posted Jun 14, 2019 15:23 UTC (Fri)
by smurf (subscriber, #17840)
[Link] (3 responses)
Contrast that with .deb which contains specific files in a specific format that's simple enough to be created and processed by generic archive packers (ar and tar) and shell scripts. (It actually was, in Debian's first iteration.)
Posted Jun 14, 2019 15:37 UTC (Fri)
by rahulsundaram (subscriber, #21946)
[Link]
Certainly a question of policy too given that does differ occasionally between even Debian and its derivatives causing incompatibility
> it's a question of a file format that is somewhat unspecified, contains redundant fields, and is unnecessarily complex.
I am not sure what any of this really means. Specific examples would help. Pick current ones instead of things solved ages ago please.
Posted Jun 14, 2019 15:42 UTC (Fri)
by pizza (subscriber, #46)
[Link] (1 responses)
Or are you claiming that someone would ever be insane enough to _create_ a deb or rpm package using that same flint axe? Talk about not valuing one's own time...
Posted Jun 23, 2019 20:06 UTC (Sun)
by mirabilos (subscriber, #84359)
[Link]
Posted Jun 6, 2019 3:59 UTC (Thu)
by luto (guest, #39314)
[Link]
(I’m not saying RPM is great. But there is more or less one way to write a spec file and there is exactly one way to build it.)
Posted Jun 6, 2019 4:37 UTC (Thu)
by anguslees (subscriber, #7131)
[Link] (5 responses)
Naturally writing similar debian/rules boilerplate for similar upstream packages is undesirable, so various "helper" tools have been developed over the last few decades. It's easy to see why the "best" tool for a python module might not be the best tool for a kernel module, or a font.
To me (coming from the Debian world), it's horrifying that rpm mandates a centralised set of rpm functionality across such diverse needs ;) Imagine what we'd be stuck with if the the original dpkg standards had mandated whatever the most popular helper was 20+ years ago, without experience or a process for change!
Posted Jun 6, 2019 9:26 UTC (Thu)
by epa (subscriber, #39769)
[Link] (2 responses)
You could choose to simplify all that by having a build tool like scons or meson which works from a single configuration language and has richer built-in functionality than plain old make. And if there are certain projects where the tool doesn't work well, it might be a better investment of time to adapt it for them, rather than pay the cost of having lots of different build systems.
You are right, the best tool to generate debian/rules for a Python script might not be the best tool to generate it for a kernel module. But there is an implicit assumption: that you need to generate the debian/rules file at all. Perhaps a better build system would start with a less verbose configuration file that doesn't need to be generated, but can be handwritten without too much boilerplate.
Posted Jun 6, 2019 9:56 UTC (Thu)
by smurf (subscriber, #17840)
[Link]
Yes, building Haskell needs a "dh_haskell" helper. I'm reasonably positive somebody will write one, now that CDBS is on its way to being deprecated.
Posted Jun 6, 2019 15:33 UTC (Thu)
by rweikusat2 (subscriber, #117920)
[Link]
%:
ie, whatever target is supposed to be built, build it by invoking the dh program with the target name as argument. 'dh binary' ends up executing 50 dh subcommands in a certain sequence, all of which can be overriden individually by putting Makefile targets named 'override_dh_<something>' with dh_<something> being a dh subcommand into debian/rules which will be activated instead of the default commands if they exist.
This is a pretty flexible and nevertheless easy-to-use approach: The most complicated Debian package I've created so far overrides just eight of these 50 subcommands and usually, the overrides just do something in addition to the default operation.
Posted Jun 10, 2019 8:42 UTC (Mon)
by LtWorf (subscriber, #124958)
[Link] (1 responses)
Posted Jun 10, 2019 11:31 UTC (Mon)
by rahulsundaram (subscriber, #21946)
[Link]
It depends on how you write spec files. The recommended practice in distributions that use RPM like Fedora have been to move away from scripts to macros and file based triggers that avoid said duplication. Scriptlets should be reserved for a one off use cases.
Posted Jun 6, 2019 6:11 UTC (Thu)
by tzafrir (subscriber, #11501)
[Link]
Posted Jun 6, 2019 8:19 UTC (Thu)
by dskoll (subscriber, #1630)
[Link] (9 responses)
Posted Jun 6, 2019 9:10 UTC (Thu)
by smurf (subscriber, #17840)
[Link] (2 responses)
This is easy stuff.
Posted Jun 6, 2019 11:27 UTC (Thu)
by dskoll (subscriber, #1630)
[Link]
Posted Jun 6, 2019 22:09 UTC (Thu)
by samuelkarp (subscriber, #131165)
[Link]
Posted Jun 6, 2019 15:41 UTC (Thu)
by rweikusat2 (subscriber, #117920)
[Link] (3 responses)
Posted Jun 6, 2019 16:55 UTC (Thu)
by antiphase (subscriber, #111993)
[Link] (2 responses)
Posted Jun 6, 2019 17:22 UTC (Thu)
by rweikusat2 (subscriber, #117920)
[Link] (1 responses)
Posted Jun 6, 2019 17:34 UTC (Thu)
by rahulsundaram (subscriber, #21946)
[Link]
Posted Jun 7, 2019 2:05 UTC (Fri)
by murukesh (subscriber, #97031)
[Link]
Posted Jun 7, 2019 17:22 UTC (Fri)
by k8to (guest, #15413)
[Link]
I know enough about .deb files and practice that I've written tooling and scripts to do mass investigations of how customers have broken their systems etc, or how my former employer's release team had broken our customers etc. I've created shim packages to avoid installing things that the package graph required. But I still have no idea how to go about creating a sane debian developer style package, despite trying.
I'm sure it's possible to succeed from the published docs, but I'd bet most developers start out by cribbing from another package.
Posted Jun 6, 2019 9:04 UTC (Thu)
by smurf (subscriber, #17840)
[Link]
The fact that this is processed by /usr/bin/make is just convenience, even though that's actually mandated by Debian's policy these days. The various build helpers / "build systems" also are, or started as, simply convenience; you're free to use debhelper/dh to generate a plaintext Makefile instead, though I'd wonder why you'd want to do that.
Frankly, I don't understand your problem with mass-building DEBs. Debian packaging is little more than "check that your Makefile obeys $DESTDIR (which you also need for RPM), run "dh_make -n" (or manually create three boilerplate files and one somewhat-less-complicated-than-an-rpmspec file), run 'debuild'. Done.". Yes, you need a heap of details to make them distributable (dependencies, documentation package, debug package, post-install script, …), but you need the same details in an RPM specfile.
Alternately, in the context of your build system (and the low-level point of view you actually need for it), things are even easier. You'd create the destination tree in debian/PACKAGENAME, write a few lines to a reasonably documented file in the DEBIAN/ subdirectory thereof, create the md5sums file ("dh_md5sums -v" tells you how to do that, if you don't want to depend on debhelper behing installed), and run "dpkg-deb -b debian/PACKAGENAME". Or, if you want to run on a non-Debian system, you can assemble the .deb yourself, it's not difficult (quite in contrast to RPM).
Any reasonably competent Debian developer could have told you this in ten minutes.
Seeking consensus on dh
incompatible between distros, and the syntax is horrifying.
Also, commented-out macros are still parsed… no, thanks!
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
incompatible between distros,
Wol
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
another, resource-constrained, operating environment; it contains the
PDF compiled from Teχ sources (while that other OE does not have Teχ
available, but a PDF viewer, so the full documentation is usable)
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
dh $@
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
Building Debian packages is indeed an exercise in thrashing around until it works. Debhelper and dh are sprawling messes; I have yet to find "big picture" documentation that puts everything in context so you can understand what's actually going on.
Seeking consensus on dh
Seeking consensus on dh
Just what I said: overview documentation rather than (or in addition to) dense reference documentation.
Seeking consensus on dh
When trying to package something for Debian the first time, I found this difficult as well. I'm fortunate to work with a DD who was able to guide me, but the policy manual was not very helpful to me. The policy manual seems to focus on details of the resulting package (as is important for policy), but not how to create a package for the first time.
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh
Seeking consensus on dh