tembo-io / pgmq

A lightweight message queue. Like AWS SQS and RSMQ but on Postgres.
PostgreSQL License
2.52k stars 55 forks source link

`META.json.in` ignored via `.gitattributes` #276

Closed CGenie closed 1 week ago

CGenie commented 2 months ago

Hello,

Any idea why the pgmq-extension/META.json.in file is ignored via .gitattributes?

https://github.com/tembo-io/pgmq/blob/main/.gitattributes#L4

This is kinda nasty because I wanted to build the extension from scratch and when I git clone the repository, the file is there, but when I use github's tarballs it's not there anymore. I wasted some time figuring out why is this...

ChuckHend commented 2 months ago

pgmq-extension/META.json.in is not required to build the extension. That part is only used for publishing the extension to pgxn.org Are you receiving an error related to it during the installation steps?

v0idpwn commented 2 months ago

Running make will run make all, which tries to make META.json, which requires META.json.in.

v0idpwn commented 2 months ago

I think this file was ignored in an attempt to avoid shipping it in the built tarball, but we are already shipping an inclusive subset of files, so it has no effect: https://github.com/tembo-io/pgmq/blob/4277086f3b660d61678d9b184c3a9334fde472ce/pgmq-extension/Makefile#L26

ChuckHend commented 2 months ago

Ahhh I see what you mean now. @theory, do you remember why that line is in .gitattributes and can it be removed to resolve this?

theory commented 2 months ago

Yes, it's ignored for export so that it's excluded from the zip file. We can fix the GitHub tarballs by making a proper release file, like this. But you can also download a properly formatted release archive from PGXN.

theory commented 2 months ago

And in truth, we should probably remove META.json from the all: target. I don't think there's any reason for it.

v0idpwn commented 2 months ago

@theory why is it needed to ignore it in gitattributes if the makefile already specifies files to be included?

CGenie commented 2 months ago

For the context: I wanted to create a nix flake for pgmq for my own purposes (there are already various postgres extensions in nix). Hence, I used fetchFromGitHub and TIL that it uses tarballs instead of cloning the repo. And I was puzzled why doesn't it want to build in nix when it does build properly with make when I clone via git.

And so I used fetchgit from nix which just clones the repo so the META.json.in file was there.

theory commented 2 months ago

@theory why is it needed to ignore it in gitattributes if the makefile already specifies files to be included?

It is ignored in .gitattributes so that it will be excluded from PGXN releases created by git archive. It in fact is not needed except to create META.json for PGXN, so not important to include in any other archives. #278 should fix the issue.

ChuckHend commented 1 month ago

I think this was resolved in https://github.com/tembo-io/pgmq/commit/3c486310c6243c47f842c47191e125a7f3aceceb, correct?

@CGenie can you confirm that this is resolved for you?

ChuckHend commented 1 week ago

@CGenie - I am going to close this but let us know if this is still a problem.