-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo publish
behaves differently than cargo test
in workspace with prepared data
#3644
Comments
Tried it with SQLx version 0.8.2, but it has the same behavior :/ |
Setting
It seems it is not saving the offline data somehow. I have successfully published this crate with older rustc versions, so I am not sure what broke. |
Setting
|
Publishing https://doc.rust-lang.org/cargo/reference/manifest.html#the-exclude-and-include-fields |
ah thank you. didn‘t know about this. about finding the workspace root: You are using this command already, but without the workspace argument. |
I tried to set the following
|
Bug Description
I have a workspace setup, where I ran
cargo sqlx prepare --workspace
.The workspace repository is public at https://github.com/mhatzl/mantra
You can see that there is a
.sqlx
folder at workspace root, and also amantra.db
SQLite database file used to prepare the queries for offline use.The
SQLX_OFFLINE
env is set totrue
to force SQLX to also use the prepared data for local development.I am able to build and test the whole workspace by running
cargo test
.Therefore, all SQL queries inside the
mantra
crate, located at/mantra
in the workspace, should be correct.However, running
cargo publish --package mantra
at workspace root fails, because SQLX cannot find the ".sqlx" folder.Running
cargo publish --package mantra --no-verify
works, but then installing mantra usingcargo install mantra
fails.I have tried to prepare and publish
mantra
from the subfolder, but the behavior remained the same.No idea what I am missing, because
cargo test
works, butcargo publish
fails to build.Minimal Reproduction
A bit tough to reproduce without publishing some crate using
cargo publish
.Info
rustc --version
: 1.82.0The text was updated successfully, but these errors were encountered: