Skip to content

fix: update minimal-zig build.zig to Zig 0.16 API and unpin - #5804

Closed
prql-bot wants to merge 1 commit into
mainfrom
fix/zig-016-unpin
Closed

prql-bot wants to merge 1 commit into
mainfrom
fix/zig-016-unpin

Conversation

@prql-bot

Copy link
Copy Markdown
Collaborator

Problem

Zig 0.16 removed addIncludePath, addLibraryPath, linkSystemLibrary, and linkLibC from Build.Step.Compile — they were deprecated in 0.15 and moved to std.Build.Module. That broke the minimal-zig example when CI picked up a 0.16-dev toolchain, leading to the pin added in #5801.

Solution

Move those calls onto root_module in build.zig. The new API has been available since 0.15, so the example now works on both 0.15.x and 0.16-dev without a pin. Drop the version: 0.15.2 pin from test-prqlc-c.yaml.

Testing

Verified locally with both zig 0.15.2 and zig 0.16.0-dev.3153+d6f43caad — zig build and zig build test succeed in both, and the example binary produces the expected SQL output.


Follow-up to #5801 per this comment.

Zig 0.16 removed `addIncludePath`, `addLibraryPath`, `linkSystemLibrary`,
and `linkLibC` from `Build.Step.Compile` (they were deprecated in 0.15 and
now live on `Module`). Move those calls onto `root_module` and drop the
version pin added in #5801.

Verified locally with both zig 0.15.2 and zig 0.16.0-dev master: `zig
build` and `zig build test` both succeed.

Co-Authored-By: Claude <[email protected]>

@prql-bot prql-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate of #5803 — same bug, same two files, same approach (move addIncludePath/addLibraryPath/linkSystemLibrary off Build.Step.Compile, set .link_libc = true on the module, drop the 0.15.2 pin).

The two diffs differ only in style:

  • #5803 keeps the inline b.createModule(...) inside b.addExecutable(...) and routes post-creation calls through exe.root_module.addIncludePath(...) — smaller diff.
  • This PR extracts exe_mod/test_mod to locals and calls the methods directly on them — larger diff, slightly more readable if more module configuration is added later.

Both are functionally equivalent. One should be closed — maintainer's choice which style to prefer.

tend-agent pushed a commit to max-sixty/tend that referenced this pull request Apr 15, 2026
Two tend-mention runs on PRQL/prql fired concurrently (issue #5802
and PR #5801) and each opened a near-duplicate PR for the same Zig
0.16 build.zig migration — PRQL/prql#5803 and PRQL/prql#5804, created
48s apart. Both runs ran `gh pr list` at session start (before either
PR existed) and neither re-checked before `gh pr create` ~7 minutes
later, so each thought the other's PR didn't exist.

tend-mention's concurrency group is keyed by issue/PR number, so
mentions on different threads are not serialized. Add a dedup recheck
step in the PR Creation section analogous to the existing dedup check
for inline review comment replies — re-run `gh pr list` immediately
before `gh pr create`, and compare by title keywords and modified file
paths (not just branch name, which two concurrent runs will pick
differently).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
max-sixty pushed a commit to max-sixty/tend that referenced this pull request Apr 15, 2026
## Summary

Add a dedup recheck step in `running-in-ci` for PR creation, analogous
to the existing dedup check for inline review comment replies. Re-run
`gh pr list` immediately before `gh pr create` so a concurrent sibling
run doesn't slip a duplicate PR past the initial session-start check.

## Evidence

Observed on `PRQL/prql` in runs
[24464554439](https://github.com/PRQL/prql/actions/runs/24464554439) and
[24464634498](https://github.com/PRQL/prql/actions/runs/24464634498).

Timeline:

- 15:57:00 — `max-sixty` commented "do the follow-up please" on issue
[PRQL/prql#5802](PRQL/prql#5802) (Zig 0.16
follow-up)
- 15:57:03 — `tend-mention` run A started on issue #5802
- 15:58:45 — `vanillajonathan` commented on PR
[PRQL/prql#5801](PRQL/prql#5801) asking the bot
to create a Zig 0.16 PR
- 15:58:48 — `tend-mention` run B started on PR #5801 (different
concurrency group — runs in parallel with A)
- ~16:02 — each run calls `gh pr list` once, early in its session; no
Zig fix PR exists yet
- 16:08:17 — run B calls `gh pr create` →
[PRQL/prql#5803](PRQL/prql#5803)
- 16:09:05 — run A calls `gh pr create` →
[PRQL/prql#5804](PRQL/prql#5804), 48s after
#5803 appeared; no recheck

Both PRs modify the same two files
(`.github/workflows/test-prqlc-c.yaml` to drop the `version: 0.15.2`
pin, and `prqlc/bindings/prqlc-c/examples/minimal-zig/build.zig` to move
calls onto `root_module`) with the same intent — near-duplicates
differing only in refactoring style. Maintainers must now triage and
close one.

## Root cause

`tend-mention`'s [`handle` job concurrency
group](https://github.com/max-sixty/tend/blob/main/generator/src/tend/workflows.py)
is keyed by `issue.number || pull_request.number`, so mentions on
different threads (issue #5802 vs PR #5801) run concurrently. The
current `PR Creation` guidance says to check `gh pr list` before
creating, but in practice runs do this once at session start. Minutes
pass between the check and `gh pr create`, during which a sibling run
can open a scope-overlapping PR — invisible to the stale check.

## Gate assessment

- **Confidence**: High — concrete wrong outcome (two open PRs for the
same fix) with a traced decision chain for both runs.
- **Structural vs stochastic**: **Structural**. The same conditions (two
mentions on different threads asking for the same fix within a few
minutes) will reliably reproduce this; the current guidance prescribes a
one-shot check that the race outflanks.
- **Occurrences**: 1 this run, 0 historical in
[#133](#133). Passes Gate 1
under the "one clear occurrence sufficient for structural failures"
rule.
- **Magnitude**: Targeted fix — adds a 17-line recheck section analogous
to the existing `Dedup check for inline review comment replies` pattern
merged in [#141](#141). Passes
Gate 2.

## Test plan

- [ ] Skill lint (`pre-commit run --all-files`)
- [ ] Verify the proposed `gh pr list --state open --author $BOT_LOGIN
--json number,title,headRefName,createdAt` returns what a bot can
actually use to decide (it does: standard gh flags)
- [ ] Spot-check: the next time two concurrent mentions hit different
threads asking for the same fix, only one PR should be created

Co-authored-by: continuous-bot <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
@max-sixty max-sixty closed this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants