pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/60967: pkgsrc: make makepatchsum on a fresh pkgsrc writes a broken distinfo
>Number: 60967
>Category: pkg
>Synopsis: pkgsrc: make makepatchsum on a fresh pkgsrc writes a broken distinfo
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Nov 06 01:05:00 +0000 2026
>Originator: Showta Ishizaki
>Release: pkgsrc as of 2026-11-06, mk/checksum/bsd.checksum.mk 1.12
>Organization:
>Environment:
System: NetBSD 11.0 amd64, FreeBSD 14.4-RELEASE amd64
>Description:
First, I am sorry about pkg/60796. I sent it with only an
artificial reproduction and without what had actually happened,
and I had not found the cause. Closing it was right. I have now
tracked the cause down, so I am reporting it again properly.
What happened: in CI, on a fresh FreeBSD 14.4 VM (pkgsrc
bootstrapped) and on fresh NetBSD 11.0 VMs (base tools), I edited
a patch in security/polkit and ran make makepatchsum. It
returned 0, but every patch line in distinfo came out chained:
SHA1 (patch-src_polkit_polkitunixprocess.c) = SHA1 (patch-src_programs_pkttyagent.c) = d9044bcc...
https://github.com/zakinko/pkgsrc-zakinko/actions/runs/35798846904
https://github.com/zakinko/pkgsrc-zakinko/actions/runs/35799000991
https://github.com/zakinko/pkgsrc-zakinko/actions/runs/35810733331
The same step worked on my own machine, because digest was already
installed there.
Neither bootstrap nor NetBSD base provides digest.
bsd.checksum-vars.mk and bsd.patch-vars.mk add digest:bootstrap to
USE_TOOLS, and bootstrap-depends installs it. distinfo and makesum
get there through fetch, but makepatchsum depends on nothing, so
on a tree where nothing has been built yet it calls ${TOOLS_DIGEST}
before it exists:
sh: /usr/pkg/bin/digest: not found
distinfo.awk does not notice, and writes the chained lines above.
Editing a patch is not needed for this; make makepatchsum alone
does it on a fresh tree.
>How-To-Repeat:
On a fresh pkgsrc where nothing has been built yet:
cd devel/libffi
make makepatchsum
grep -c '= SHA1 (' distinfo
On NetBSD 11.0 and FreeBSD 14.4 with pkgsrc-current of 2026-11-05,
this printed "digest: not found" 13 times, returned 0, and the
grep counted 13. make distinfo and make makesum on the same trees
installed digest and left distinfo as it was.
>Fix:
The diff below makes makepatchsum depend on bootstrap-depends. It
does not use the distfiles, so fetch did not look necessary.
With it, on the same trees, make makepatchsum installed digest
first and left distinfo identical to the tree's. With one patch
edited, only that patch's line changed, and its hash matches digest
sha1 of the patch with its $NetBSD$ line removed. make distinfo
and make makesum gave the same result as before. The log of all
of this is here:
https://github.com/zakinko/pkgsrc-zakinko/actions/runs/41975009766
makepatchsum now also goes through what bootstrap-depends carries,
such as the can-be-built-here check, as fetch does.
Thank you for looking at pkg/60796, and sorry again for the
trouble it caused.
Diff against pkgsrc-current of 2026-11-06:
--- mk/checksum/bsd.checksum.mk.orig
+++ mk/checksum/bsd.checksum.mk
@@ -46,6 +46,7 @@
.PHONY: makesum makepatchsum mps mdi makedistinfo distinfo
checksum checksum-phase distinfo makesum: fetch
+makepatchsum: bootstrap-depends
makedistinfo mdi: distinfo
mps: makepatchsum
Home |
Main Index |
Thread Index |
Old Index