Hi,
I let DebGPT "help" me on my cruft-ng (while sipping a nice drink)
For openmpi it went in a desperate infinite loop of confusion.
For libpicohttpparser1 it gave of somewhat decent patching of so.patch
It's the very first time I _use_ AI and I'm not victim of it an it's users.
Be nice
Good evening
$sudo cruft
cruft report: mer 04 nov 2026 22:59:42
---- missing: dpkg ----
---- unexplained: / ----
/etc/apt/apt.conf.d/10periodic
/etc/apt/preferences.d/tchet
/etc/ca-certificates.conf.dpkg-old
/etc/cron.daily/build
/etc/fp-3.2.2.cfg
/usr/bin/uv
/usr/lib/python3/dist-packages/omg/__init__.pyi
/usr/lib/python3/dist-packages/omg/py.typed
/usr/lib/systemd/user/[email protected]
/usr/lib/x86_64-linux-gnu/libmpi_abi.so.1
/usr/lib/x86_64-linux-gnu/libpicohttpparser.so.1 (Bug: #1136785)
end.
Edit file: /tmp/pico/libpicohttpparser-1.2+ds/debian/patches/so.patch
--- a/so.patch
+++ b/so.patch
@@ -8,7 +8,7 @@
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Makefile
+++ b/Makefile
-@@ -23,12 +23,26 @@
+@@ -23,12 +23,30 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
@@ -21,20 +21,24 @@
-all:
+CFLAGS += -fPIC -pedantic -Wall -Wextra
-+LDFLAGS += -shared -Wl,-soname,libpicohttpparser.so.1
+
++SONAME = libpicohttpparser.so.1
++LDFLAGS += -shared -Wl,-soname,$(SONAME)
+
+DEB_VERSION_UPSTREAM_NO_DS = $(shell echo ${DEB_VERSION_UPSTREAM} |
cut -f1 -d+)
+
-+TARGET = libpicohttpparser.so.${DEB_VERSION_UPSTREAM_NO_DS}
++TARGET = $(SONAME).${DEB_VERSION_UPSTREAM_NO_DS}
+SOURCES = picohttpparser.c
+HEADERS = picohttpparser.h
+OBJECTS = $(SOURCES:.c=.o)
+
-+library: $(TARGET)
++library: $(TARGET) $(SONAME)
+
+$(TARGET): $(OBJECTS)
+ $(CC) $(FLAGS) $(CFLAGS) $(LDFLAGS) -o $(TARGET) $(OBJECTS)
++
++$(SONAME): $(TARGET)
++ ln -sf $(TARGET) $(SONAME)
test: test-bin
env $(TEST_ENV) $(PROVE) -v ./test-bin
-------------
Now, also important: the `debian/clean` file has
`libpicohttpparser.so*` which will clean the symlink too. Good.
Also `debian/libpicohttpparser1.install` has `libpicohttpparser.so*
usr/lib/${DEB_HOST_MULTIARCH}` — this glob will now match both
`libpicohttpparser.so.1.2` and `libpicohttpparser.so.1` (the symlink).
dh_install will install both.
That's exactly what we want: the real file plus the SONAME symlink
in the runtime package.
But wait — there's a subtlety. `libpicohttpparser-dev.links` creates
`/usr/lib/${DEB_HOST_MULTIARCH}/libpicohttpparser.so ->
libpicohttpparser.so.1`. That's fine, and now the target actually
exists in the runtime package. Good.
However, there's a risk: dh_install with a glob
`libpicohttpparser.so*` — will it also pick up... only those two.
Fine.
Another consideration: does dh_install preserve the symlink? Yes,
dh_install copies symlinks as symlinks.
Now, also the lintian overrides file
`libpicohttpparser1.lintian-overrides` contains:
```
lacks-versioned-link-to-shared-library *libpicohttpparser.so.1 *
lacks-unversioned-link-to-shared-library *libpicohttpparser.so *
```
After the fix, the versioned link exists, so the first override
becomes unnecessary. The second one (unversioned link) is in the -dev
package, so it's arguably still needed... Actually
`lacks-unversioned-link-to-shared-library` is
emitted for the -dev package. Hmm, but the override is in
libpicohttpparser1. Let me check whether lintian emits these at all
now.
Actually, let me be careful and minimal. The user asked for a patch
to fix the bug. Let me focus on the core fix but also handle the
now-obsolete override.
Let me now write the patch. I'll edit debian/patches/so.patch
directly.
Actually, let me reconsider the approach. Rather than adding a
symlink rule in the Makefile, an alternative cleaner approach: keep
the Makefile producing only the real file, and let dh_install/dh_link
handle... no, actually the
standard approach is that the package ships the SONAME symlink. The
cleanest is to have the build create it.
Actually wait. Let me reconsider — is there an even simpler
approach? The `debian/libpicohttpparser1.links` file could create the
symlink:
```
/usr/lib/${DEB_HOST_MULTIARCH}/libpicohttpparser.so.1.2
usr/lib/${DEB_HOST_MULTIARCH}/libpicohttpparser.so.1
```
But that hardcodes the version. The Makefile approach is more robust
and self-documenting.
Hmm, but actually there's a subtlety with the Makefile approach:
`library: $(TARGET) $(SONAME)` — dh_auto_build runs `make` with no
target, which builds the first target. The first target in the
Makefile is `library` (since `all:`
was replaced). Actually no — after the patch, the first target is
`library: $(TARGET) $(SONAME)`. So `make` builds library. Good.
Wait, but actually in the current patched Makefile, is `library` the
first target? Let's see: line 42 `library: $(TARGET)`. Yes, it's the
first explicit target. Good.
Now let me also double check: `$(SONAME): $(TARGET)` with `ln -sf
$(TARGET) $(SONAME)`. Since TARGET = libpicohttpparser.so.1.2 and
SONAME = libpicohttpparser.so.1, this creates a relative symlink
`libpicohttpparser.so.1 ->
libpicohttpparser.so.1.2`. Good, relative symlinks are preferred.
Let me now write the patch file.
Also I should consider: should I add `$(SONAME)` to the clean
target? `debian/clean` already has `libpicohttpparser.so*` which
covers it. But the upstream `clean:` target only removes test-bin.
Since debian/clean handles it, fine.
But for robustness maybe add to Makefile clean. Let's keep minimal
but correct — actually adding it to the Makefile clean is good
practice since the Makefile creates it. But debian/clean already
covers. I'll leave the Makefile clean
alone to keep the patch minimal... Actually, hmm, if someone runs
`make clean` in the source tree the symlink stays. But debian/clean
handles the Debian build. I'll keep it minimal.
Let me write the patch now.
Actually, let me reconsider one more time whether to also update the
lintian overrides. After the fix:
- `lacks-versioned-link-to-shared-library` — no longer emitted (the
.so.1 symlink now exists in libpicohttpparser1). Override becomes
stale → lintian may warn about unused override? Lintian doesn't warn
about unused overrides by
default (there's `mismatched-override` in newer versions). Let me
just test with lintian after building.
Let me write the patch and build.
Now I'll write the corrected so.patch directly, with the Makefile hunk
regenerated against the pristine upstream file.
⚙ ToolCall> edit
/tmp/pico/libpicohttpparser-1.2+ds/debian/patches/so.patch (+8 -4)