tembo-io / trunk

Package manager and registry for Postgres extensions
PostgreSQL License
256 stars 14 forks source link

contrib: publish pg_smtp_client 0.1.0 #724

Closed brianpursley closed 2 months ago

brianpursley commented 3 months ago

I think this install_command will work, but I don't see any other extensions doing it this way (except for jsonschema which does it via a Makefile).

If not, I can change to copy files from the target directories manually.

aws-amplify-us-east-1[bot] commented 3 months ago

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-724.d2qgksbj4k37j8.amplifyapp.com

ChuckHend commented 2 months ago

Is there anything preventing this from merging?

brianpursley commented 2 months ago

Is there anything preventing this from merging?

From my perspective, it is ready to merge.

I don't know if there is anything else that needs to happen in the process.

brianpursley commented 2 months ago

I tested this out using the tembo-local docker instance, and it isn't working. :disappointed:

trunk install pg_smtp_client runs sucessfully, but the extension is not really installed.

postgres@f50bf8202acd:/postgresql-15.3$ trunk install pg_smtp_client
Using pg_config: /usr/lib/postgresql/15/bin/pg_config
Using pkglibdir: "/var/lib/postgresql/data/tembo/15/lib"
Using sharedir: "/var/lib/postgresql/data/tembo"
Downloading from: https://cdb-plat-use1-prod-pgtrunkio.s3.amazonaws.com/extensions/pg_smtp_client/pg_smtp_client-pg15-0.1.0.tar.gz
Dependent extensions to be installed: []
Installing pg_smtp_client 0.1.0
Skipping license file licenses/LICENSE

***************************
* POST INSTALLATION STEPS *
***************************

Enable the extension with:
CREATE EXTENSION IF NOT EXISTS pg_smtp_client CASCADE;

And when I do this, I get this error about the control file missing:

postgres> CREATE EXTENSION IF NOT EXISTS pg_smtp_client CASCADE
[2024-07-31 11:16:14] [0A000] ERROR: extension "pg_smtp_client" is not available
[2024-07-31 11:16:14] Detail: Could not open extension control file "/var/lib/postgresql/data/tembo/extension/pg_smtp_client.control": No such file or directory.
[2024-07-31 11:16:14] Hint: The extension must first be installed on the system where PostgreSQL is running.

I downloaded the archive from the s3 bucket, and indeed, it only has a manifest.json and license file.

I think this must be because I was trying to make cargo pgrx install work (as mentioned here), but most extensions simply mv the build output to the appropriate directory, which is what I think I should probably do.

@ChuckHend I need to update my Trunk.toml. What is the best way forward? Should I open another PR with the change, or should this PR be reverted first?

ChuckHend commented 2 months ago

@brianpursley, no need to revert that PR. Just open a new one patching whatever needs to be fixed :)