feat/phase7-cleanup #336

Merged
fuzzy merged 31 commits from feat/phase7-cleanup into main 2026-07-13 06:03:13 +00:00
Owner
No description provided.
the.auditor left a comment

PR Review: feat/phase7-cleanup

Overview: Major refactoring — new C-based qpkg.fs module replacing shell-out patterns, build pipeline overhaul with env propagation, pkgdef_output/pkgdef_no_symlink support, new init/info commands, colored output, and many new pkgdefs. Clean, well-structured changes overall.

All findings are non-blocking. Issues filed for each.

Suggestions

  1. lib/qpkg/build.lua:175table.concat(commands, " ") joins stage commands with spaces. Old code ran each command individually. If a pkgdef had multiple entries in a stage, they'd become a single command with extra args instead of sequential execution. Currently no pkgdef exercises this, but the API contract changed silently.

  2. lib/qpkg/cli.lua:22-44init and info commands exist but aren't listed in help output. Users can't discover them.

  3. Makefile:8-9LUA_INC/LUA_LIB hardcoded to /home/fuzzy/.thwap.d/lua/linux/amd64/... – embeds username, arch, OS. Consider pkg-config or env var overrides.

  4. lib/qpkg/cli.lua:497 – Build failure in install_raw doesn't show log.path() to user. Hard to debug failures without knowing log file location.

  5. lib/qpkg/fs.so – Compiled binary checked into git. Should be in .gitignore + built via make build.

  6. tests/test.lua – No coverage for: fs C module, init/info commands, pkgdef_output processing, registry output persistence, pkgdef_no_symlink behavior, env propagation in build stages.

  7. lib/qpkg/cli.lua:975-1001 – Dynamic dispatch via commands[cmd] passes nil for missing positional args. No per-command arg validation.

## PR Review: feat/phase7-cleanup **Overview:** Major refactoring — new C-based `qpkg.fs` module replacing shell-out patterns, build pipeline overhaul with env propagation, `pkgdef_output`/`pkgdef_no_symlink` support, new `init`/`info` commands, colored output, and many new pkgdefs. Clean, well-structured changes overall. All findings are non-blocking. Issues filed for each. ## Suggestions 1. `lib/qpkg/build.lua:175` – `table.concat(commands, " ")` joins stage commands with spaces. Old code ran each command individually. If a pkgdef had multiple entries in a stage, they'd become a single command with extra args instead of sequential execution. Currently no pkgdef exercises this, but the API contract changed silently. 2. `lib/qpkg/cli.lua:22-44` – `init` and `info` commands exist but aren't listed in help output. Users can't discover them. 3. `Makefile:8-9` – `LUA_INC`/`LUA_LIB` hardcoded to `/home/fuzzy/.thwap.d/lua/linux/amd64/...` – embeds username, arch, OS. Consider `pkg-config` or env var overrides. 4. `lib/qpkg/cli.lua:497` – Build failure in `install_raw` doesn't show `log.path()` to user. Hard to debug failures without knowing log file location. 5. `lib/qpkg/fs.so` – Compiled binary checked into git. Should be in `.gitignore` + built via `make build`. 6. `tests/test.lua` – No coverage for: `fs` C module, `init`/`info` commands, `pkgdef_output` processing, registry output persistence, `pkgdef_no_symlink` behavior, env propagation in build stages. 7. `lib/qpkg/cli.lua:975-1001` – Dynamic dispatch via `commands[cmd]` passes `nil` for missing positional args. No per-command arg validation.
fix(build): restore per-command execution, collapse split-argument pkgdefs
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m3s
cd40f31cc5
The prior change used table.concat to join command elements with spaces,
breaking the API contract where each element runs as its own os.execute
call. No pkgdef relied on multi-element stages for sequential commands
(split-argument patterns like `{"configure", "--prefix=$pkgdir"}` were
always meant to be single commands), but the silent change was a ticking
time bomb.

- Restore iterative per-element execution in build.run_stage
- Collapse all 24 split-argument pkgdefs into single-string commands
- Each element is now one os.execute call; sequential commands within
  a stage should use && in a single element

Closes #337
the.auditor approved these changes 2026-07-12 10:39:06 +00:00
Dismissed
the.auditor left a comment

Re-review after push (cd40f31c). Commands concatenation issue is resolved — build.lua now preserves per-command execution, and all existing multi-element pkgdef command arrays have been collapsed to single strings. No remaining blocking issues. Non-blocking suggestions already filed as #337–#343.

Re-review after push (cd40f31c). Commands concatenation issue is resolved — `build.lua` now preserves per-command execution, and all existing multi-element pkgdef command arrays have been collapsed to single strings. No remaining blocking issues. Non-blocking suggestions already filed as #337–#343.
chore: address issues #338-341 from PR review
Some checks failed
PR Checks / lint-and-test (pull_request) Has been cancelled
d6162d1096
#338: Add missing `init` and `info` commands to help text
#339: Remove hardcoded LUA_INC/LUA_LIB, add build guard with error msg
#340: Show log file path on build stage failure
#341: Add fs.so to .gitignore

Closes #338, Closes #339, Closes #340, Closes #341
fuzzy dismissed the.auditor's review 2026-07-12 10:46:32 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

ci: auto-detect Lua paths via pkg-config, build fs.so before tests
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m44s
ffe709d647
Makefile:
- Add pkg-config fallback for LUA_INC/LUA_LIB
- Make test target depend on $(FS_SO) so fs.so is always built first

CI (pr-checks.yml):
- Add explicit fs module build step
- Use make test instead of bare busted
fix(ci): correct Debian package name for lua dev headers
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m8s
5e2385633d
`lua5.4-dev` → `liblua5.4-dev`. Without the correct -dev package,
pkg-config can-t find lua5.4, LUA_INC/LUA_LIB stay empty, and the
fs.so build guard blocks test execution.
fix: remove compiled fs.so from git tracking
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 15m21s
badcd323a0
The binary was committed accidentally and later added to .gitignore,
but .gitignore does not affect already-tracked files. CI checked out
the stale binary instead of compiling a fresh one.

`git rm --cached` stops tracking fs.so while keeping the local file.
fix(ci): install liblua5.4-dev unconditionally
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 1m16s
9271fa0092
The previous conditional checked for lua5.4 and only ran apt-get
if missing. CI runners have lua5.4 pre-installed, so the dev headers
(liblua5.4-dev) were never installed. pkg-config returned nothing,
LUA_INC/LUA_LIB stayed empty, and the Makefile guard blocked fs.so
compilation.

Now installs liblua5.4-dev unconditionally, then conditionally
installs the other packages only if missing.
fix(ci): install pipx via apt, not pip
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m26s
c1977d0c15
restores the original package install approach but keeps
liblua5.4-dev unconditional
fix(ci): install pkg-config for lua5.4 detection
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m30s
0c08d794a4
liblua5.4-dev ships lua5.4.pc but without pkg-config installed,
the Makefile pkg-config fallback produces empty LUA_INC/LUA_LIB
and the build guard fires.
debug: add pkg-config/lua5.4 diagnostics to CI
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m29s
10b660fc02
fix(makefile): use portable pkg-config --variable instead of --cflags-only-I
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 15m6s
9bfcd3a68b
--cflags-only-I and --libs-only-L are not supported by all
pkg-config implementations (e.g., older pkgconf).
--variable=includedir and --variable=libdir query the .pc
file directly and are universally supported.
fix(makefile): parse -I/-L flags from pkg-config output
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 15m21s
8f02d0075a
--variable=includedir returns /usr/include but lua.h is under
/usr/include/lua5.4/. --cflags returns the full -I flag with
the correct subdirectory. Use sed to extract the path.
debug: show raw pkg-config output and .pc file content
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m33s
0fdff8b363
fuzzy force-pushed feat/phase7-cleanup from 0fdff8b363
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m33s
to d79aa29795
Some checks failed
PR Checks / lint-and-test (pull_request) Has been cancelled
2026-07-12 20:41:59 +00:00
Compare
fuzzy force-pushed feat/phase7-cleanup from d79aa29795
Some checks failed
PR Checks / lint-and-test (pull_request) Has been cancelled
to 1d720cce29
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m28s
2026-07-12 20:52:51 +00:00
Compare
refactor(profile): show only active packages by default, qpkg list as alias
Some checks failed
PR Checks / lint-and-test (pull_request) Has been cancelled
d0b491f25f
profile defaults to one entry per package (the active version).
profile -a shows all installed versions (old behavior).
list delegates to profile("-a").
chore: remove qpkg list command
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 20m48s
1e49f0c669
list was a duplicate of profile -a. Removed the function, help
text entries, and README references. profile -a covers the
same use case.
opt(relink): eliminate fs.exists check, use EEXIST from errno
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m20s
f6402183f9
fs.symlink now returns errno as a third return value. Relink
drops to N symlink calls per package (down from 2N) by letting
EEXIST (17) silently skip already-existing symlinks.

Build time relink for a 2000-file package: ~N symlink calls
instead of N stat + N symlink (roughly half the kernel crossings).
fuzzy force-pushed feat/phase7-cleanup from f6402183f9
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m20s
to 844611d38f
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m39s
2026-07-12 23:43:19 +00:00
Compare
feat(cli): add -r flag to override pkgdef repository root
Some checks failed
PR Checks / lint-and-test (pull_request) Has been cancelled
7870ff489d
qpkg -r /path/to/repo install python
Overrides config.qpkg_pkgdef_root for the duration of the invocation.
Does not modify qpkg.conf.
test(relink): add assertions for preset symlink creation
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m8s
0b30a5ed8b
feat(cli): rename commands to add/del/use/drop, dynamic help formatting
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m26s
177be082c5
Commands renamed with hidden aliases for backward compatibility:
  install  → add    (alias: commands.install)
  remove   → del    (alias: commands.remove)
  activate → use    (alias: commands.activate)
  deactivate → drop (alias: commands.deactivate)

Help text now uses dynamic padding based on the longest command
string, keeping columns aligned.
test(relink): assert every fs operation in test setup for early failure detection
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m34s
ac121d76be
test(relink): use readback instead of exists to verify file creation
Some checks failed
PR Checks / lint-and-test (pull_request) Failing after 5m10s
4597c24516
test(relink): use readfile instead of exists for symlink assertions
All checks were successful
PR Checks / lint-and-test (pull_request) Successful in 5m54s
51a0b55e27
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-13 06:03:06 +00:00
the.auditor left a comment

Solid cleanup. Key wins:

  • Shell-out → fs module migration (C native + Lua fallback) reduces subprocess overhead
  • CLI rename (add/del/use/drop/relink) is more intuitive
  • Additive relink enables fast PROMPT_COMMAND usage
  • init command for shell integration snippet
  • CI fixes and Makefile build target
  • pkgdef_no_symlink / .qpkg-meta metadata support
  • Dependency env propagation
  • New pkgdefs: go (multiple versions), nim, tcl, vlang, zig

No blocking issues.

Solid cleanup. Key wins: - Shell-out → fs module migration (C native + Lua fallback) reduces subprocess overhead - CLI rename (add/del/use/drop/relink) is more intuitive - Additive relink enables fast PROMPT_COMMAND usage - `init` command for shell integration snippet - CI fixes and Makefile build target - pkgdef_no_symlink / .qpkg-meta metadata support - Dependency env propagation - New pkgdefs: go (multiple versions), nim, tcl, vlang, zig No blocking issues.
fuzzy merged commit 51a0b55e27 into main 2026-07-13 06:03:13 +00:00
fuzzy deleted branch feat/phase7-cleanup 2026-07-13 06:03:13 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/qpkg!336
No description provided.