Skip to content
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

Factor out "build" code from pgrx-pg-config #1451

Open
workingjubilee opened this issue Dec 28, 2023 · 1 comment
Open

Factor out "build" code from pgrx-pg-config #1451

workingjubilee opened this issue Dec 28, 2023 · 1 comment
Labels
build-sys Regarding the "build system" of pgrx which is split between cargo-pgrx, pg-sys, and sql-entity-graph cargo-pgrx test-support

Comments

@workingjubilee
Copy link
Member

workingjubilee commented Dec 28, 2023

pgrx-pg-config is better off being solely responsible for interacting with the pg_config binary, but it contains logic used in two other places, that doesn't really have anything to do with interacting with pg_config, like createdb (used in cargo-pgrx and pgrx-tests).

This has a few problems:

  • Code that is actually version-independent being in pgrx-tests is slightly problematic, as that is a versioned library, and so we are potentially building the same code several times for no reason (contributing to issues like PGRX uses so many artifacts it destroys smaller drives #1404). While this doesn't apply to createdb specifically, it does apply to the code invoking createdb...
  • This code shared between cargo-pgrx and pgrx-tests creates a boundary where the integration code can be wrong or confused. It is probably actually better, in cases involving only 2 sites, to simply duplicate the code.
  • There's barely a need for pgrx-tests to be responsible for createdb, anyways: it can use other tooling for that.
@workingjubilee workingjubilee added the build-sys Regarding the "build system" of pgrx which is split between cargo-pgrx, pg-sys, and sql-entity-graph label Dec 28, 2023
@workingjubilee workingjubilee changed the title Factor out "build" code fri pgrx-pg-config Factor out "build" code from pgrx-pg-config Dec 28, 2023
@eeeebbbbrrrr
Copy link
Contributor

This code shared between cargo-pgrx and pgrx-tests needs

that seems like an incomplete thought, but...

I wonder if cargo-pgrx could benefit from a "createdb" command (probably "dropdb" too), then pgrx-tests could just shell out to PGPORT=xxxx PGDATA=xxxx cargo pgrx createdb ${test_db_name}.

I don't really see any particular harm in that since cargo-pgrx is a required build tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-sys Regarding the "build system" of pgrx which is split between cargo-pgrx, pg-sys, and sql-entity-graph cargo-pgrx test-support
Projects
None yet
Development

No branches or pull requests

2 participants