Skip to content

Fix: Package misses required source files#105

Open
ReinierMaas wants to merge 7 commits intomasterfrom
reinier/fix-nix
Open

Fix: Package misses required source files#105
ReinierMaas wants to merge 7 commits intomasterfrom
reinier/fix-nix

Conversation

@ReinierMaas
Copy link
Copy Markdown
Contributor

@ReinierMaas ReinierMaas commented Apr 28, 2026

XRef: https://github.com/channable/opsqueue/pull/50/changes#r2745964330

Adding the includes broke using the package downstream, preventing us from updating our OpsQueue pin.

  • Verified this works downstream (Nix querying is remarkably slow so pushing this to the background for now)

Cachix had an outage:

image

The previous `include = ["opsqueue_example_database_schema.db"]` was
an exhaustive allow-list, so `cargo package` / `cargo vendor` stripped
`src/`, `app/`, `migrations/` and `build.rs` from the published crate.
Local builds via the workspace skipped packaging, hiding the issue;
downstream git-source consumers (e.g. Frida via Crane / cargo vendor)
hit "couldn't read .../opsqueue-0.35.1/src/lib.rs".

Extend the include list to cover everything the lib + bin + embedded
migrations need, and bump 0.35.1 -> 0.35.2.
Cargo only auto-picks up LICENSE files in the package root, and the workspace LICENSE lives one directory up. Add a relative symlink opsqueue/LICENSE -> ../LICENSE so we keep a single source of truth; cargo follows the symlink during packaging and inlines the content into the .crate tarball.
Adds a 'just package-check' recipe that runs 'cargo package -p opsqueue' and asserts the resulting file list contains src/lib.rs, app/main.rs, build.rs, LICENSE, opsqueue_example_database_schema.db, and at least one migrations/*.sql. Wires it into CI as its own job so future regressions of the include allow-list in opsqueue/Cargo.toml fail before merge instead of breaking downstream git-source consumers.
Downstream consumers (e.g. Frida) build via Crane in Nix, which uses cargo offline mode. Without the .sqlx/query-*.json metadata in the packaged crate, the sqlx query macros under the server-logic feature cannot be type-checked at build time and require a live SQLite database to compile. Add .sqlx/**/*.json to the include allow-list and extend the package-check guard to assert at least one query-*.json file is present.
Regenerated with cargo sqlx prepare against the example DB so the .sqlx/ metadata reflects the current schema and query set. Without this refresh, downstream offline (Crane/Nix) builds of the published crate that enable the server-logic feature would still fail with "no cached data for this query" or type-inference errors on the sqlx query macros.
Adds a "just sqlx-check" recipe (cargo sqlx prepare --check -- --all-targets) and wires it into .pre-commit-config.yaml so any commit touching opsqueue/src/*.rs, migrations, or .sqlx/ verifies the offline query cache matches the source. Without this guard, a stale .sqlx/ silently breaks downstream Crane/Nix builds of the published crate (we already paid for this once, see preceding commit).
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes downstream build breakage caused by an overly restrictive Cargo include allow-list by ensuring all compile-time-required sources/assets (including sqlx offline metadata) are packaged/vendored, and adds automation to prevent regressions.

Changes:

  • Expand opsqueue crate include allow-list to ship src/, app/, migrations/, and .sqlx/ metadata.
  • Add just package-check plus a CI job to validate cargo package output contains required files.
  • Add just sqlx-check and a pre-commit hook; refresh .sqlx offline query cache; bump workspace version to 0.35.2.

Reviewed changes

Copilot reviewed 9 out of 40 changed files in this pull request and generated no comments.

Show a summary per file
File Description
opsqueue/src/consumer/strategy.rs Fix typo in panic message (“JSON”).
opsqueue/Cargo.toml Make include exhaustive for build-time-required sources/assets, including .sqlx and migrations.
opsqueue/.sqlx/query-ef677e899bf812760d0d24c9fa1fb791a5585629b14baab7a35185469c2e2e85.json Offline query cache update/formatting.
opsqueue/.sqlx/query-eda8781445cef23e17446ca9007955f377d4059478a2bda4e5bd39ecd836e838.json Offline query cache update/formatting.
opsqueue/.sqlx/query-e92c5478fe8f1e5dee3d5e73ecf4cb3f2b7e422cefb1ecc00cf17299edec83c8.json Offline query cache update/formatting.
opsqueue/.sqlx/query-e73afd2c8d84e6c3044f0662525f97bc8ca1d36a9305fdb959ef0e577846d606.json Offline query cache update/formatting.
opsqueue/.sqlx/query-e282079ded2d608817a2b2d27917f097eb0ec213e5a9a4027563c44f4a05bca3.json Offline query cache update/formatting.
opsqueue/.sqlx/query-df0c7f76822d1c39794f0d9f876ea241062c3f39e110300ea849d1ad64b94580.json Add offline query cache entry.
opsqueue/.sqlx/query-d5aa781509794455e2e8e16b2ba1485efd45597a65e4bb7ae8d2888112b3a272.json Offline query cache update/formatting.
opsqueue/.sqlx/query-c4fc111b75ae4036c16042be654600dd598dddd4ee9412522b22127e5bceedc1.json Offline query cache update/formatting.
opsqueue/.sqlx/query-c30f478c0ff9f52daeed0cd1b70f6626d1f6d8fd8020f4bce41b239de4d8939f.json Offline query cache update (query/shape changes reflected).
opsqueue/.sqlx/query-c149e54e9a57cd5ded5e9e2656116ba9d04e56ffdbb41bb152ae5762475b5c78.json Offline query cache update/formatting.
opsqueue/.sqlx/query-91d3b5ff8e68c788d3209b4f1234a519eba5773d88c91635f5ffb01b1b5302fa.json Offline query cache update/formatting.
opsqueue/.sqlx/query-833bc5d955f1c2455e06e9762dec84c4c24fe58c21165e6a80d0a5bfae1a3cd7.json Offline query cache update/formatting.
opsqueue/.sqlx/query-6c3fac07b6b1b07ccdaaf0d296647176104b93c64a7a9fb85e2fd1e88ec13143.json Offline query cache update/formatting.
opsqueue/.sqlx/query-62b1b5988a509f9722489522fbe3c650e1e04bcf51db8f97cbfb85a3e3d0c3bc.json Offline query cache update/formatting.
opsqueue/.sqlx/query-5f7d80f5b4990d9d4e0cca6491d7a34acf1328802fda82eb2281b59a792820de.json Offline query cache update/formatting.
opsqueue/.sqlx/query-5d1f0e786821af3135eb9022004308af3c683ba3cca9c97677072243289cb322.json Offline query cache update/formatting.
opsqueue/.sqlx/query-4e132448643131446b3e7a7a47800ef32cdbb82ea189329c7d2fb556232459e4.json Add offline query cache entry.
opsqueue/.sqlx/query-40e96fd79c38c8338bcc2f18fbc43c8f71b1c6e73e73ce5f7687db469377c137.json Offline query cache update/formatting.
opsqueue/.sqlx/query-3f8357ea4d8060e1271c7c5de41d7c98aad292a3c52002dd8031d46da35851af.json Add offline query cache entry.
opsqueue/.sqlx/query-3dde3eaab357df88cd1c0e0e8e833aca1fce450c2d842a2af63f0e4c128424f7.json Offline query cache update/formatting.
opsqueue/.sqlx/query-3c775bc61256133ed6ea9b46ef0961f40f095482ff9f86a641506a0bbdaa6761.json Offline query cache update (query/shape changes reflected).
opsqueue/.sqlx/query-374244f899617c0d53ce0ae73ac215295874fe2684ed6096c27a43a5449282e5.json Add offline query cache entry.
opsqueue/.sqlx/query-2b77ed3badfb9fe0fd7b88635ef9d11f88e91b1cfcef1d93e814ab2da07addcb.json Offline query cache update/formatting.
opsqueue/.sqlx/query-207eb97fe104f49008ebe798860f6340f180a1afde82dd1c08dc4b2b650fbfe2.json Offline query cache update/formatting.
opsqueue/.sqlx/query-1b3e8cc0730f75e690337f1834d28d8ae98d1fb97195f47c36a7c45038edb7e8.json Remove obsolete offline query cache entry.
opsqueue/.sqlx/query-1b27625aa012537f26c3883690577a8248470ba43a498508f4ccebaf09050ff7.json Add offline query cache entry.
opsqueue/.sqlx/query-18f783ff8500f06825c985530486c0624c112f61a5816d4c4528f9b3151713e4.json Offline query cache update/formatting.
opsqueue/.sqlx/query-13b72b517c04819669c5139d0a823e1d009a0612eeecf94ec68401d36d5434e1.json Remove obsolete offline query cache entry.
opsqueue/.sqlx/query-11d4e8c27b08ec013a154838137bab496b9e37ce482189f38eef19b20fc447f4.json Offline query cache update/formatting.
opsqueue/.sqlx/query-0f5c290f571f139bc5651240ec05a9da0a4e3a22d1291bc431afe6b976156ca5.json Offline query cache update/formatting.
opsqueue/.sqlx/query-0dd811053b68ee41e20c7ff47de01d98962ad16441f4205139a0654e2aa0ba22.json Add offline query cache entry.
opsqueue/.sqlx/query-08fd98126c44dcbd07eb449d09e238c6ea5d468ba73a8b4b1d5f2df9e4bd39b0.json Offline query cache update/formatting.
justfile Add package-check and sqlx-check recipes used by CI/pre-commit.
Cargo.toml Bump workspace version to 0.35.2.
Cargo.lock Update locked versions to 0.35.2.
.pre-commit-config.yaml Add pre-commit hook to enforce fresh sqlx offline cache.
.github/workflows/ci.yml Add CI job to run just package-check.
Files not reviewed (30)
  • opsqueue/.sqlx/query-08fd98126c44dcbd07eb449d09e238c6ea5d468ba73a8b4b1d5f2df9e4bd39b0.json: Language not supported
  • opsqueue/.sqlx/query-0dd811053b68ee41e20c7ff47de01d98962ad16441f4205139a0654e2aa0ba22.json: Language not supported
  • opsqueue/.sqlx/query-0f5c290f571f139bc5651240ec05a9da0a4e3a22d1291bc431afe6b976156ca5.json: Language not supported
  • opsqueue/.sqlx/query-11d4e8c27b08ec013a154838137bab496b9e37ce482189f38eef19b20fc447f4.json: Language not supported
  • opsqueue/.sqlx/query-13b72b517c04819669c5139d0a823e1d009a0612eeecf94ec68401d36d5434e1.json: Language not supported
  • opsqueue/.sqlx/query-18f783ff8500f06825c985530486c0624c112f61a5816d4c4528f9b3151713e4.json: Language not supported
  • opsqueue/.sqlx/query-1b27625aa012537f26c3883690577a8248470ba43a498508f4ccebaf09050ff7.json: Language not supported
  • opsqueue/.sqlx/query-1b3e8cc0730f75e690337f1834d28d8ae98d1fb97195f47c36a7c45038edb7e8.json: Language not supported
  • opsqueue/.sqlx/query-207eb97fe104f49008ebe798860f6340f180a1afde82dd1c08dc4b2b650fbfe2.json: Language not supported
  • opsqueue/.sqlx/query-2b77ed3badfb9fe0fd7b88635ef9d11f88e91b1cfcef1d93e814ab2da07addcb.json: Language not supported
  • opsqueue/.sqlx/query-374244f899617c0d53ce0ae73ac215295874fe2684ed6096c27a43a5449282e5.json: Language not supported
  • opsqueue/.sqlx/query-3dde3eaab357df88cd1c0e0e8e833aca1fce450c2d842a2af63f0e4c128424f7.json: Language not supported
  • opsqueue/.sqlx/query-3f8357ea4d8060e1271c7c5de41d7c98aad292a3c52002dd8031d46da35851af.json: Language not supported
  • opsqueue/.sqlx/query-40e96fd79c38c8338bcc2f18fbc43c8f71b1c6e73e73ce5f7687db469377c137.json: Language not supported
  • opsqueue/.sqlx/query-4e132448643131446b3e7a7a47800ef32cdbb82ea189329c7d2fb556232459e4.json: Language not supported
  • opsqueue/.sqlx/query-5d1f0e786821af3135eb9022004308af3c683ba3cca9c97677072243289cb322.json: Language not supported
  • opsqueue/.sqlx/query-5f7d80f5b4990d9d4e0cca6491d7a34acf1328802fda82eb2281b59a792820de.json: Language not supported
  • opsqueue/.sqlx/query-62b1b5988a509f9722489522fbe3c650e1e04bcf51db8f97cbfb85a3e3d0c3bc.json: Language not supported
  • opsqueue/.sqlx/query-6c3fac07b6b1b07ccdaaf0d296647176104b93c64a7a9fb85e2fd1e88ec13143.json: Language not supported
  • opsqueue/.sqlx/query-833bc5d955f1c2455e06e9762dec84c4c24fe58c21165e6a80d0a5bfae1a3cd7.json: Language not supported
  • opsqueue/.sqlx/query-91d3b5ff8e68c788d3209b4f1234a519eba5773d88c91635f5ffb01b1b5302fa.json: Language not supported
  • opsqueue/.sqlx/query-c149e54e9a57cd5ded5e9e2656116ba9d04e56ffdbb41bb152ae5762475b5c78.json: Language not supported
  • opsqueue/.sqlx/query-c4fc111b75ae4036c16042be654600dd598dddd4ee9412522b22127e5bceedc1.json: Language not supported
  • opsqueue/.sqlx/query-d5aa781509794455e2e8e16b2ba1485efd45597a65e4bb7ae8d2888112b3a272.json: Language not supported
  • opsqueue/.sqlx/query-df0c7f76822d1c39794f0d9f876ea241062c3f39e110300ea849d1ad64b94580.json: Language not supported
  • opsqueue/.sqlx/query-e282079ded2d608817a2b2d27917f097eb0ec213e5a9a4027563c44f4a05bca3.json: Language not supported
  • opsqueue/.sqlx/query-e73afd2c8d84e6c3044f0662525f97bc8ca1d36a9305fdb959ef0e577846d606.json: Language not supported
  • opsqueue/.sqlx/query-e92c5478fe8f1e5dee3d5e73ecf4cb3f2b7e422cefb1ecc00cf17299edec83c8.json: Language not supported
  • opsqueue/.sqlx/query-eda8781445cef23e17446ca9007955f377d4059478a2bda4e5bd39ecd836e838.json: Language not supported
  • opsqueue/.sqlx/query-ef677e899bf812760d0d24c9fa1fb791a5585629b14baab7a35185469c2e2e85.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ReinierMaas ReinierMaas requested a review from Qqwy April 28, 2026 14:17
@ReinierMaas ReinierMaas assigned Qqwy and unassigned ReinierMaas Apr 29, 2026
@ReinierMaas ReinierMaas removed the request for review from Qqwy April 29, 2026 08:38
@ReinierMaas
Copy link
Copy Markdown
Contributor Author

@Qqwy is taking over this PR because he wants to simplify the packaging story further.

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.

3 participants