News for hackers. Stuff that matters.
Re:Building binary deb packages: a practical guide by Athas on Tuesday June 02, 2020 @03:13PM (#23394941)
I think this guide glosses over the most difficult aspect: writing a package whose executables are generated reasonably reproducibly, using tools from other Debian packages. I've been a satisfied Debian user for over ten years, but I gave up on trying to package my own software. I could certainly figure out how to manually create a `.deb` with an executable and some man pages, but not how to automate the creation of that `.deb` in a way that lives up to my expectations of quality.

In contrast, I managed to submit software to Homebrew after two weeks of macOS, and to Nixpkgs within two days of running NixOS.

Re:Building binary deb packages: a practical guide by infinity0 on Tuesday June 02, 2020 @03:32PM (#23395250)
As I mentioned in the other comment, the creation of a Debian source package has a lot of barriers, some of them good and for quality purposes, some of them bad and due to historical cruft. Documentation is also not very newbie-friendly. The actual automatic reproduction of a binary from a source package is simple - `dpkg-buildpackage`.

The tradeoff you get with other distributions being quick, is less quality assurance. Also, Debian still has a policy of working on 10 architectures, and this slows things down significantly sometimes. The other distributions you mentioned don't have this constraint.

Re:Building binary deb packages: a practical guide by Conan_Kudo on Wednesday June 03, 2020 @12:10AM (#23399576)
> The tradeoff you get with other distributions being quick, is less quality assurance

The crux of the problem is that all current official Debian packaging methods supported by Debian are sufficiently arcane and obtusely documented to the point that it's a high barrier to entry for people to do it right.

Personally, I've been doing RPM and Debian packaging for over a decade now, and it boggles the mind how much more complicated doing _correct_ Debian packaging is for essentially the same that happens on an RPM distribution like Fedora or openSUSE.

One of the reasons that I started using debbuild[1] for building Debian packages years ago was that I felt like I could get something that closely resembled a policy-compliant Debian package without impossible amounts of guesswork. Combined with macros adapted from Fedora and other distros[2] as an interface for Debian packaging policies, I can package things rather easily for Debian/Ubuntu using the much more straightforward guidelines from Fedora as a base.

As it turns out, it doesn't take that much effort to make packages that comply with Fedora/openSUSE Packaging Guidelines and Debian Policy with this tool, and it has drastically simplified my ability to maintain software across distributions in a way that still cleanly integrates with the distribution platform.

I wish that debbuild would be an officially supported mechanism in Debian, but it's probably unlikely without a Debian Developer advocating for it (and I suspect no one there would, as they probably like the existing system...).

[1]: https://github.com/debbuild/debbuild

[2]: https://github.com/debbuild/debbuild-macros

(Disclaimer: I am now the current developer of debbuild and debbuild-macros, though I wasn't when I first started using it)

Re:Building binary deb packages: a practical guide by pabs3 on Wednesday June 03, 2020 @01:05AM (#23399966)
Getting debbuild into Debian would be relatively simple, but getting folks to switch existing packages away from debhelper is unlikely to be easy.

https://mentors.debian.net/intro-maintainers

Re:Building binary deb packages: a practical guide by pabs3 on Wednesday June 03, 2020 @01:55AM (#23400291)
Got any examples of barriers? Debian packaging is trending towards entirely automatic, but we aren't quite there yet and there are a lot of things we could do to change that, mostly in dpkg-dev and debhelper.

https://wiki.debian.org/AutomaticPackagingTools

Re:Building binary deb packages: a practical guide by debiandev on Wednesday June 03, 2020 @04:56AM (#23401416)
DD here. The main "barrier" is the level of quality required.

Simply throwing a bunch of files into a package or a container is very quick.

Making an official Debian package is not supposed to be quick. DDs thoroughly review and test the software they are packaging. While packaging I often chase missing licensing information, find plenty of bugs, write systemd unit/init files and sandboxing, write manpages, functional tests, and sometimes find serious vulnerabilities.

I worked on various packaging and deploying systems, and most other distributions don't come anywhere close to this level of scrutiny.

I should also add that becoming a DD requires years of commitment and proven track record of work.

The next time someone complains that making a container is very easy in comparison they should ask themselves: how much can I trust a software source with a very low entry bar?

Re:Building binary deb packages: a practical guide by GoblinSlayer on Wednesday June 03, 2020 @06:21AM (#23401854)
Gatekeeping is the goal of debian packaging documentation? Right, that goal is certainly perfectly achieved.
Re:Building binary deb packages: a practical guide by debiandev on Wednesday June 03, 2020 @07:06PM (#23410079)
huh?
Re:Building binary deb packages: a practical guide by LadyCailin on Saturday June 06, 2020 @08:59AM (#23438872)
I think the point they’re trying to make is that having a high barrier to entry should be accomplished through means other than having a hard or confusing barrier to entry.
Re:Building binary deb packages: a practical guide by mehrdadn on Tuesday June 02, 2020 @11:30PM (#23399377)
> The tradeoff you get with other distributions being quick, is less quality assurance.

I dare say, if Ubuntu is any indication, Pacman packages consistently feel higher-quality than deb packages. Unlike on Ubuntu, on Arch, you can actually update your packages without breaking something...

Re:Building binary deb packages: a practical guide by readams on Tuesday June 02, 2020 @04:34PM (#23395981)
Sbuild for deb and mock for rpm make this pretty easy. Not super easy. But pretty easy.
Re:Building binary deb packages: a practical guide by snuxoll on Tuesday June 02, 2020 @04:47PM (#23396121)
This, nobody should be manually calling rpmbuild or dpkg-buildpackage themselves. Doing this makes it easy to miss dependencies or other funky things you have done to your environment.
Re:Building binary deb packages: a practical guide by pizza234 on Tuesday June 02, 2020 @03:55PM (#23395598)
> but not how to automate the creation of that `.deb` in a way that lives up to my expectations of quality.

Can you clarify what do you exactly mean with this?

Re:Building binary deb packages: a practical guide by Athas on Tuesday June 02, 2020 @04:02PM (#23395679)
Basically what infinity0 described in his sibling comments. I want to have a source package that can be used to build the binary package in a deterministic and reproducible way.
Re:Building binary deb packages: a practical guide by pizza234 on Tuesday June 02, 2020 @04:10PM (#23395767)
This post describes how to do that, via PPAs: https://is.gd/Eu55IG.
Re:Building binary deb packages: a practical guide by Athas on Tuesday June 02, 2020 @04:30PM (#23395952)
Thanks. That may have been useful to me once, although my motivation was to get my software in the main Debian package set, which I think is quite a different thing from PPAs.

Also... look at that guide. Why is it so difficult and obtuse? Why do I have to run so many odd tools, including apparently modifying some file in /etc and running other stuff as root? In contrast, this was my first contribution to Nixpkgs: https://github.com/NixOS/nixpkgs/commit/0b8efd8724e59964bad0... Easily as reproducible as anything Debian, and apart from installing Nix it didn't require any funkyness in the build environment. I tested the definition by running 'nix-build . -A oclgrind' in my checkout of the Nixpkgs repository. I managed this after running NixOS for two days.

This is the same software that I also contributed to Homebrew: https://github.com/Homebrew/homebrew-core/commit/1268459f761... Again, a simple declarative-ish package description (written in Ruby, which is not my favourite, but it's better than the weird Makefile/shell amalgamations that are used by DPKG and RPM).

Both Nix and Homebrew have serious limitations compared to Debian (Homebrew in particular is aggressively limiting its scope to gain simplicity and in particularly doesn't care as much about reproducibility). But as a user, I must admit I have not missed what Debian provides that these do not. Whenever I tried to package stuff for Debian, I felt that I was paying a tax for unclear gain. It's a shame, because I like Debian for over a decade, and I am strongly sympathetic to the idea of the project in principle.

Re:Building binary deb packages: a practical guide by sm_ts on Wednesday June 03, 2020 @04:22AM (#23401208)
> Also... look at that guide. Why is it so difficult and obtuse? Why do I have to run so many odd tools

I agree that Debian packaging is difficult/odd/arguably obtuse; I guess it's a legacy matter. Your phrasing can be interpreted as if the guide itself is obtuse, it's not clear :)

> including apparently modifying some file in /etc and running other stuff as root?

It's important to read and understand it fully. Anything you do it as root is required only to run a preview build locally. This is an optional step, so no, one doesn't need to perform admin configurations/operations if they don't want to, although performing a local build is a desirable step.

> In contrast, this was my first contribution to Nixpkgs

This is not a proper comparison, as you're comparing an entirely manual procedure versus using a packaging tool.

A proper (closer) comparison is probably against the tool that the guide references: https://github.com/saveriomiroddi/ppa_packaging, where you just declare all the metadata, and invoke a script that takes care of everything.

All in all, I'm personally puzzled about why there aren't tools around to simplify/automate Debian packaging. I've started the small tool mentioned above (`ppa_packaging`), but I'll likely not continue working on it, as my experience with niche projects is that, while useful in their (narrow) domain, they're very resource-intensive to maintain.

Re:Building binary deb packages: a practical guide by slgeorge on Wednesday June 03, 2020 @04:22AM (#23401214)
Mostly because all of these systems came AFTER Debian.

I mean Debian packaging is a terrible pain - but I have to have empathy with the fact that it's a technical system and more importantly an online community that's been doing it's thing since 1993.

The fact is that with such a long-running system there's more than one way to do everything.

The way we discuss/learn technology has also partly changed. Most of the documentation for Debian is extensive manuals - there's "not enough" intro text, and then "too much" detailed documentation

And then there's the "cost of change". Lots of Debian developers have been packaging using their particular versions of tools for a long time and are happy with them.

In many ways Debian works because the people working on it care about quality and the tooling is second order to the efforts they make.