fix: move migrations into zeph-memory for crates.io publishing#704
Merged
fix: move migrations into zeph-memory for crates.io publishing#704
Conversation
sqlx::migrate! macro resolves paths relative to CARGO_MANIFEST_DIR, which breaks when the crate is packaged for crates.io since the workspace root migrations/ directory is not included in the tarball.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
migrations/from workspace root intocrates/zeph-memory/migrations/sqlx::migrate!path from../../migrationsto./migrationssqlx::migrate!resolves paths relative toCARGO_MANIFEST_DIR. Whencargo publishpackages the crate, only the crate directory is included in the tarball, so the workspace-levelmigrations/directory was absent, causing a build failure.Test plan
cargo +nightly fmt --checkpassescargo clippy --workspace -- -D warningspassescargo nextest run --workspace --lib --bins— 2241 passedcargo publish -p zeph-memory --dry-run