8000 fix(engine): hash the pg_query pins into the postgres fingerprint by colinhacks · Pull Request #39 · colinhacks/reylo · GitHub
[go: up one dir, main page]

Skip to content

fix(engine): hash the pg_query pins into the postgres fingerprint - #39

Merged
colinhacks merged 1 commit into
mainfrom
pg-query-pin-fingerprint
Oct 22, 2026
Merged

colinhacks merged 1 commit into
mainfrom
pg-query-pin-fingerprint

Conversation

@colinhacks
Copy link
Copy Markdown
Owner

The Postgres engine's parser is the pg_query crate at a pinned commit, with the libpg_query commit its submodule names, both fetched by engine/build.sh --prepare. Those two commits lived in engine/build.sh, outside every directory an engine crate's build script hashes. Moving the parser to another commit therefore left the Postgres fingerprint unchanged. The loader keys its cache of analyses on that fingerprint, so analyses from the old parser stayed valid, and the artifact check in tests/fingerprint.test.ts could not see a stale packages/postgres/engine.wasm.

  • The commits and their SHA-256s move to engine/postgres/vendor/pg_query-source.sh, which build.sh sources. That directory is among the Postgres crate's hashed sources, so a new pin now changes the fingerprint, as a change to the patch beside it already did.
  • packages/postgres/engine.wasm is rebuilt for the new fingerprint. Before the rebuild, tests/fingerprint.test.ts failed on it, and nothing else in the engine changed.

The SQLite amalgamation's version is already covered: engine/sqlite/build.rs names its directory. Cargo.lock stays out of the hash, because every engine shares it with the oracle and the build tooling, so an unrelated lockfile change would change every fingerprint.

Copilot AI balanced review requested due to automatic review settings October 22, 2026 21:40
@vercel
vercel Bot commented Oct 22, 2026 •
Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
reylo Ready Ready Preview Oct 22, 2026 9:41pm UTC

Request Review

Copilot AI left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@pullfrog pullfrog Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

I reviewed the move of the pg_query pins into the Postgres crate's hashed sources, and checked the rebuilt artifact against the fingerprint test.

  • Pins relocated: PG_QUERY_COMMIT, LIBPG_QUERY_COMMIT and their SHA-256s move to engine/postgres/vendor/pg_query-source.sh, and engine/build.sh sources that file. It does so after its cd "$(dirname "$0")", so the relative path resolves.
  • Fingerprint coverage: engine/postgres/build.rs hashes vendor, and both reylo_engine_build::source_hash and its TS mirror in tests/fingerprint.test.ts walk that directory recursively, skipping only dotfiles. A pin change now changes the Postgres fingerprint. The .patched/pg_query/.source check in build.sh still keys the prepared copy on both commits plus the patch hash.
  • Artifact rebuilt: node --experimental-strip-types --test tests/fingerprint.test.ts passes for all three engine.wasm artifacts on this head. No CI workflow or script reads the pin variables out of build.sh.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@colinhacks
colinhacks merged commit 8486b5c into main Oct 22, 2026
5 checks passed
@colinhacks
colinhacks deleted the pg-query-pin-fingerprint branch October 22, 2026 21:45
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

0