[Midnightbsd-cvs] [MidnightBSD/mports] 6bb045: ai/codex: de-duplicate distinfo (#758)
Lucas Holt
noreply at github.com
Fri Aug 21 23:45:56 EDT 2026
Branch: refs/heads/master
Home: https://github.com/MidnightBSD/mports
Commit: 6bb04539357549551523f4543aa1e3a1ab9da3cf
https://github.com/MidnightBSD/mports/commit/6bb04539357549551523f4543aa1e3a1ab9da3cf
Author: Lucas Holt <luke at foolishgames.com>
Date: 2026-08-21 (Fri, 21 Aug 2026)
Changed paths:
M ai/codex/distinfo
Log Message:
-----------
ai/codex: de-duplicate distinfo (#758)
## Problem
`ai/codex/distinfo` contained the entire distfile list **twice** — 2424
`SHA256` entries for 1212 distinct files, with the second block
byte-identical to the first.
Introduced in `017ad5ddb3` (0.147). The file was clean at `e292b391b8`
(0.146.0, 1169 entries), so `makesum` appended rather than replaced, or
was run twice.
## Why it breaks fetching
`DISTINFO_DATA` in `Mk/bsd.mport.mk:2335` prints *every* matching line,
so a duplicated entry yields two values:
```sh
CKSIZE=$(distinfo_data SIZE "${full_file}") # -> "17438 17438"
```
`Mk/scripts/do-fetch.sh:144` interpolates that unquoted:
```sh
_fetch_cmd="${_fetch_cmd} -S ${CKSIZE}"
```
so `fetch(1)` gets a stray extra argument. Because the crate paths
contain a `/`, `do-fetch.sh:130` also passes `-o <path>`, and `fetch`
requires `-o` to name a *directory* once it sees more than one URL:
```
fetch: rust/crates/Inflector-0.11.4.crate is not a directory
```
Every mirror then fails identically — which is why this surfaced in
Magus run 647 as a *fetch* failure rather than a malformed distinfo.
`do-fetch.sh:152` is affected too: `[ "$actual_size" -eq "$CKSIZE" ]`
gets too many arguments, so even a successful download is rejected as a
size mismatch.
Reproduced standalone:
```console
$ fetch -S 5 5 -o /tmp/f https://example.com/
fetch: /tmp/f is not a directory
```
## Fix
Keep only the first block. The result is byte-identical to what a
correct `makesum` run produces.
## Testing
- Confirmed the two halves were byte-identical before removal, so the
de-dup is lossless
- The 1212 remaining entries match `bmake -V DISTFILES` exactly — none
missing, none extra
- `bmake checksum` passes for all 1212 distfiles
- `distinfo_data SIZE` now returns a single value for both a crate path
and the GH tarball
A companion PR hardens `do-fetch.sh` so a duplicated distinfo fails
loudly instead of masquerading as a mirror outage.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
## Summary by Sourcery
Bug Fixes:
- Remove the duplicated distinfo entries so fetching and checksum
validation receive a single size and checksum value for each distfile.
Signed-off-by: Lucas Holt <luke at foolishgames.com>
To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/mports/settings/notifications
More information about the Midnightbsd-cvs
mailing list