-
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
Overhauling cargo sqlx prepare --merged
#1793
Comments
So how does this interact with #1770 which I want to release this week as 0.6.0? |
From a quick peek it looks like #1770 still triggers a recompilation with a For the CLI bits it looks like the same changes would be needed, but with I didn't realize that 0.6.0 was planned so soon. I could get the changes that I mentioned out on Wednesday and fix any merge conflicts with #1770 which should be minor. I also understand if you don't want to hold up the release on these changes and would want to slot it for 0.7.0 instead |
Yeah I have a number of breaking dependency upgrades (like |
Just for reference, I have an implementation hashed out for this. Just need to tidy things up and then I'll throw a PR up for it later today |
I wanted to get some feedback before submitting my idea as a PR.
Currently
cargo sqlx prepare --merged
runs acargo clean
to ensure a recompile on all the compile-time queries which is rather heavy-handed. I'll enumerate the attempts and other information I've come across along the way, and then follow it up with the current technique I was thinking ofRemoving
cargo clean
?Without
--merged
prepare usescargo rustc
to compile the crate with a ever-changing--cfg
to trigger a consistent recompile.--merged
usescargo check
instead becausecargo rustc
can't be run on a workspace. If we remove the clean and just trycargo check
with an ever changing--cfg
then it still triggers a full recompile withCARGO_LOG=cargo::core::compiler::fingerprint=info
indicating that it's due to the differing--cfg
Removing the ever-changing
--cfg
too runs into the issue of queries not actually being compiled and getting missed unsurisinglyRunning multiple
cargo rustc
s?We could invoke multiple
cargo rustc
commands to cover all the crates we need. The issues here arecargo check
would be passed to individualcargo rustc
s like--features
Triggering recompiles without a full
clean
The implementation that's stuck with me so far is to extend Removing
cargo clean
wherecargo clean
and the ever-changing--cfg
is removed. Instead recompiles are triggered by modifying the mtime of crates within the workspace and bycargo clean --package [<SPEC>]
ing crates outside of the workspace. The list of crates totouch
/clean
are all crates in the dep graph that depend onsqlx-macros
somewhere in their dep tree with an ignore list that can be specified to avoid recompiling crates that are known to depend onsqlx-macros
without actually containing any compile-time queries themselves (e.g.sqlx
andormx
)New CLI structure
(Feel free to bikeshed naming and all if we're going to end up changing stuff anyways)
We need some way to be able to pass the ignorelist mentioned above. The easiest way I could think of was to switch
--merged
to a subcommand that has an--ignore
flag that can be used to specify cratesThe text was updated successfully, but these errors were encountered: