-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
pgx-utils
goes away!
#911
pgx-utils
goes away!
#911
Conversation
- Move the `sql_entity_graph` module out of `pgx-utils` and into its own crate. - Move `pgx-utils/src/rewriter.rs` into `pgx-macros/src` and delete the `pgx-utils` crate entirely - Some dead code removal From there, the changes here are largely mechanical to account for the crate changes. A few 3rd-party dependencies have been eliminated here and there as well. `pgx-pg-sys/build.rs` now applies `#[pg_guard]` to bindgen `extern "C"` FFI blocks instead of embedding it directly. In testing this doesn't seem to hurt compilation performance and it removes a dependency in our build chain.
As you said yourself, we probably don't want to just rename |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is basically good -- admittedly I just skimmed stuff that looked like it's part of the rename/move.
A lot of this is stuff I wanted to do anyway after the JSON patch, which this will likely simplify (although it does mean that patch will need rewriting ⚰️).
There's some other follow-up stuff that I think we'll want -- (this will regress macro error messages slightly, and possibly compile-times for pgx users), but none of that is urgent or needs to block this (I'll try to get to those issues as part of a follow-up soon).
@@ -150,9 +140,9 @@ impl PgGuardRewriter { | |||
arg_list.extend(quote! { #ident, }); | |||
} | |||
} else { | |||
eyre::bail!( | |||
panic!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we'd use syn::Error
here, since panic will give a pretty bad error message inside a macro/build script.
It is a rename, but at least it's clear what the code is used for now. It sounds like @thomcc has further ideas that might let us eliminate the crate entirely, which would be great, but I think this is still important just for clarity. The big thing here was being able to move |
Fair enough, then! |
- Move the `sql_entity_graph` module out of `pgx-utils` and into its own crate. - Move `pgx-utils/src/rewriter.rs` into `pgx-macros/src` and delete the `pgx-utils` crate entirely - Some dead code removal From there, the changes here are largely mechanical to account for the crate changes. A few 3rd-party dependencies have been eliminated here and there as well. `pgx-pg-sys/build.rs` now applies `#[pg_guard]` to bindgen `extern "C"` FFI blocks instead of automatically rewriting to its output directly. In testing this doesn't seem to hurt compilation performance and it removes a dependency in our build chain. Relates to Issue pgcentralfoundation#655.
#911 introduced using the wrong signature and this UB was missed in review amidst the thousands of lines of changes. Signed-off-by: usamoi <[email protected]>
#911 introduced using the wrong signature and this UB was missed in review amidst the thousands of lines of changes. Signed-off-by: usamoi <[email protected]>
sql_entity_graph
module out ofpgx-utils
and into its own crate.pgx-utils/src/rewriter.rs
intopgx-macros/src
and delete thepgx-utils
crate entirelyFrom there, the changes here are largely mechanical to account for the crate changes. A few 3rd-party dependencies have been eliminated here and there as well.
pgx-pg-sys/build.rs
now applies#[pg_guard]
to bindgenextern "C"
FFI blocks instead of automatically rewriting to its output directly. In testing this doesn't seem to hurt compilation performance and it removes a dependency in our build chain.Relates to Issue #655.