[Midnightbsd-cvs] [MidnightBSD/mports] f9adf4: ai/py-tritonclient: fix build by using mports stag...

Lucas Holt noreply at github.com
Wed Sep 16 09:36:01 EDT 2026


  Branch: refs/heads/master
  Home:   https://github.com/MidnightBSD/mports
  Commit: f9adf483560ea5cc3363cde27b6f4d696b9b5a8e
      https://github.com/MidnightBSD/mports/commit/f9adf483560ea5cc3363cde27b6f4d696b9b5a8e
  Author: Lucas Holt <luke at foolishgames.com>
  Date:   2026-09-16 (Wed, 16 Sep 2026)

  Changed paths:
    M ai/py-tritonclient/Makefile

  Log Message:
  -----------
  ai/py-tritonclient: fix build by using mports staging variables (#1285)

Fixes #1283. The port has never built — it was written against FreeBSD
idioms
that do not exist in mports.

```diff
-PEP517_INSTALL_CMD=	${PYTHON_CMD} -m installer --destdir ${STAGEDIR} --prefix ${PREFIX} ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX}
+PEP517_INSTALL_CMD=	${PYTHON_CMD} -m installer --destdir ${FAKE_DESTDIR} --prefix ${TRUE_PREFIX} ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX}

-post-stage:
-	@${RM} ${STAGEDIR}${PREFIX}/LICENSE.txt
+post-fake:
+	@${RM} ${FAKE_DESTDIR}${TRUE_PREFIX}/LICENSE.txt
```

### Why each part

- **`STAGEDIR` is not defined in mports.** It expanded to empty, leaving
`--destdir --prefix /usr/local`, so `--destdir` swallowed the following
`--prefix` as its value and the wheel landed in a doubled staging path.
The
  later `RECORD` lookup then found nothing.
- **`FAKE_DESTDIR` alone is not enough.** `bsd.mport.mk` already
prepends
`FAKE_DESTDIR` to `PREFIX` inside install targets, so the prefix passed
to
  `installer` has to be `TRUE_PREFIX` or the path doubles again.
- **`post-stage` is not in the target sequence** (`Mk/bsd.mport.mk` uses
  `post-fake`), so the `LICENSE.txt` cleanup silently never ran.

### What I deliberately did not change

`POST_PLIST=fix-plist` stays. I tried removing it as presumed dead code
and the
fake step fails with `/usr/local/LICENSE.txt is missing from the plist`
— the
wheel's data scheme really does drop a `LICENSE.txt` at the prefix root
and
`autoplist` mangles it into a `site-..LICENSE.txt` entry. Only the
variable
names in `post-fake` needed changing, not the logic.

I also checked the tempting shorter fix of dropping `--destdir` and
using
`--prefix ${PREFIX}`: it installs to the right place but bakes the
staging path
into the `.pyc` files (`Error: '...' is referring to
.../fake-inst-amd64`). The
form in this PR does not.

### Validation

On a clean tree, MidnightBSD 4.0.6/amd64, py312:

- `bmake makesum` (distinfo unchanged), `patch`, `build`, `fake`,
`package` all pass
- `portlint -AC` — 0 fatal errors
- No doubled staging path under `fake-inst-amd64`
- No `fake-inst` string in any installed `.pyc`
- No stray `LICENSE.txt` at the prefix root, staged or installed
- `bmake reinstall`, then `import tritonclient{,.http,.grpc,.utils}`
reports 2.70.0

`FLAVORS` is `py312` only, so there is no second flavor to check.

### Notes

No `PORTREVISION` bump — no working package was ever produced. Note that
#1280
(the #1269 dependent bumps) does add `PORTREVISION=1` to this port; I
checked
with `git merge-tree` and the two do not conflict, so merge order does
not matter.

The issue also records that `STAGEDIR` appears in 184 port Makefiles
tree-wide.
That sweep is out of scope here.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01NSsgED5s7GPYJNb1HxuaU9

## Summary by Sourcery

Fix py-tritonclient packaging for mports by correcting installation
paths and fake-phase cleanup.

Bug Fixes:
- Fix the py-tritonclient package build by using mports staging and
prefix variables during wheel installation.
- Run LICENSE.txt cleanup during the mports fake phase so generated
packages do not retain the stray license file.

Signed-off-by: Lucas Holt <luke at foolishgames.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.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