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

Re: ntfy: Review or Sponsor from the go team



On 15/01/2025 07:18, Maytham Alsudany wrote:
                           ===== d/control =====
[...]
- This is not a library that others can depend on. The "heckel-ntfy-v2-
dev" (which isn't named correctly BTW) stanza should be removed
entirely, as well as any related files like its install file.

Isn't the source usually packaged for others to depend on? Nothing needs
it right now, but is it considered unnecessary noise?

If upstream doesn't intend for it to be imported by others, then we
shouldn't package the source as a library. It's only a program, and its
code isn't intended for consumption by other software.

Just curious, what's the right namespace for `module heckel.io/ntfy/v2`?

golang-heckel-ntfy-dev
^^^^^^---- oh, how did I not see that. And no v2 I assume because there was no historical v1 already. Makes sense.

I was a bit surprised that removing the source package installed the full source into the main package, but I found a way to avoid that.


                            ===== d/rules =====

- Instead of setting DH_GOLANG_INSTALL_ALL = 1 and then specifying
DH_GOLANG_EXCLUDES, use DH_GOLANG_INSTALL_EXTRA to specify only the
additional things required for the build to proceed.

I'll look at this again, but I need the excludes so I can avoid patching
the excluded dirs.

Ack.

Removing the INSTALL_ALL worked, I used INSTALL_EXTRA for for one embedded file and the rest I create directly in _build/, so it can work without it. The bonus here is also that lintian doesn't complain about extra licenses or documentation outside of /usr/share/doc


- Move the .service files out of d/systemd and directly into debian/ so
dh_installsystemd picks them up. Replace
"execute_after_dh_installsystemd" with the following to prevent starting
or enabling them.

override_dh_installsystemd
    dh_installsystemd --no-start --no-enable

This didn't work - I tried many combinations, but it always ended up
starting the service. I'll try it again, but the only thing that worked
was hiding the service files from dh completely then installing at a
later stage OR installing directly into the debian/ntfy at a late stage,
but then no postinst comes out (for upgrade reboots)

Once you push updated changes to the repo, I can inspect the postinst
script generated by debhelper and see what's going on.

It works now and the postinst script added is the correct one. Testing this exact config back in December didn't work, but perhaps that was a red herring and something else was happening.

- The "notdebian" tag is misleading, and isn't necessary to patch out
files from the build. Use "//go:build ignore" in your patches instead.

Ohh, I didn't know "ignore" was a static recognised keyword. I thought
you still had to pass it to -tags. Well this probably solves the above
issue then.

It's not :) - it's merely a convention that it's named "ignore". Nothing
will pass the "ignore" tag, so it won't build, and you won't need to add
anything extra to the dh_auto_build invocation in d/rules.

Switching from negated tag "!tag" to just "tag" worked very well. Even works on dh_golang part and produces Built-Using. Renamed to "ignore" so it's obvious in the patch why it's being added.

This was the biggest bit I was stuck on, so appreciate the help here.

What else?
- Added some systemd hardening. Not too much as the client service could be configured to run commands on notifications. - Fixed d/copyright and d/control on both ntfy and when - but waiting for upstream to confirm it's an "OR". Pretty sure that's what they meant by "dual licensed". - Several minor bits: no @ in makefile, no TODO in patch, no unused DH_BUILD_OPTS, util section for ntfy

But I definitely skipped the config file merge. This is a bit too complicated for me at the moment and I'm not sure it's going to be a frequent real world occurrence when it's a slow-release package.


The latest version is on the go-team repo:
- https://salsa.debian.org/go-team/packages/ntfy
- https://salsa.debian.org/go-team/packages/golang-github-olebedev-when


Thanks again for the thorough review.


--
Regards,
Ahmad


Reply to: