-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
Add a default cshim
feature flag
#958
Conversation
I think this is ready for merge. |
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.
Strictly speaking this should probably be a cshim
feature enabled by default (enabling a cargo feature is never supposed to remove functionality).
But in practice I don't think this matters much, and it might be a hassle to disable otherwise.
Hmm. I think that would be incredibly invasive, code wise. Would that not mean basically putting a |
I think it would mostly be a matter of changing |
That said this isn't really a feature we expect users to enable, so it's probably fine. |
Would it not mean adding this to everything that currently doesn't have this feature flag at all? Am I missing something. |
@eeeebbbbrrrr No, it would involve adding the feature flag only to things enabled specifically by the |
Do we like that? Sometimes using cargo across the entire pgx repo ( I can do it this way, of course, if it's preferred and otherwise idiomatic. |
Yeah, I don't mind setting features like that. We can prevent settings creep by making sure at least one feature includes all default features that aren't a Postgres version. |
Okay, I'll rearrange this. |
3729fcf
to
f3442a0
Compare
no-cshim
feature flagcshim
feature flag
135e11a
to
f3442a0
Compare
I don't think this PR is going to survive in this state after our discord discussions around |
This adds a `no-cshim` feature flag to `pgx` and pushes it down to `pgx-pg-sys` and `pgx-tests`. With this turned on we lose low-level access to a few things: - `pgx_list*` functions - `pgx_planner_rt_fetch()` - `pgx_SpinLock*` functions From `pgx`' perspective, this means a few modules are just not available under `no-cshim`: - `hooks` (uses `PgList`) - `list` (impl for `PgList` which uses `pgx_list*` functions) - `namespace` (uses `PgList`) - `spinlock` (uses `pgx_SpinLock*` functions) This feature flag will hopefully make it easier to cross-compile pgx with only a small bit of compromises. This feature flag was initially designed with [plrust](https://github.com/tcdi/plrust) user functions in mind, and they won't need access to any of the above.
f3442a0
to
2936a79
Compare
… due to rust-lang/cargo#7160 and how if it were default we wouldn't be able to turn it off from a top-level `cargo test --all --no-default-features --features pg14`.
This PR is slightly complicated by rust-lang/cargo#4753. The "solution", if you can call it that, is for our 9646bdf does that, assuming it passes CI. |
…itly turn on the cshim feature
I'm content with this now. Merging. |
This adds a
cshim
feature flag topgx
, enabled by default, and pushes it down topgx-pg-sys
andpgx-tests
.With this turned off we lose low-level access to a few things:
pgx_list*
functionspgx_planner_rt_fetch()
pgx_SpinLock*
functionsFrom
pgx
' perspective, this means a few modules are just not available withoutcshim
:hooks
(usesPgList
)list
(impl forPgList
which usespgx_list*
functions)namespace
(usesPgList
)spinlock
(usespgx_SpinLock*
functions)This feature flag will hopefully make it easier to cross-compile pgx with only a small bit of compromises. This feature flag was initially designed with plrust user functions in mind, and they won't need access to any of the above.