libpg_query icon indicating copy to clipboard operation
libpg_query copied to clipboard

Binaries on GitHub Releases?

Open karlhorky opened this issue 1 year ago • 3 comments

The GitHub releases, eg the 16-5.1.0 release seen below, do not currently have binaries for common platforms like win32-x64, darwin-x64, darwin-arm64, linux-x64, linux-arm64:

Screenshot 2024-01-25 at 12 33 18

Would @pganalyze be open to publishing binaries with releases (eg. as a part of a CI action)?

This would be helpful for projects based on libpg_query, such as the libpg-query npm package by @pyramation and others:

  • https://github.com/launchql/libpg-query-node/issues/22#issuecomment-1909812739

karlhorky avatar Jan 25 '24 11:01 karlhorky

Would @pganalyze be open to publishing binaries with releases (eg. as a part of a CI action)?

We probably could, since we're already running the test infrastructure on Linux and Windows anyway, and I think we just need to do this conditionally when its a release tag.

That said, the current Windows MSVC makefile generates a static object (.lib), instead of a shared library (.dll). I'm not sure if a downstream user like @pyramation's npm package can use a static object, or requires a DLL?

lfittl avatar Jan 25 '24 17:01 lfittl

That said, the current Windows MSVC makefile generates a static object (.lib), instead of a shared library (.dll). I'm not sure if a downstream user like @pyramation's npm package can use a static object, or requires a DLL?

Before publishing, I have linux and mac covered with .a files:

libpg_query
libpg_query/osx
libpg_query/osx/libpg_query.a
libpg_query/osx/.gitkeep
libpg_query/include
libpg_query/include/.gitkeep
libpg_query/include/pg_query.h
libpg_query/linux
libpg_query/linux/libpg_query.a
libpg_query/linux/.gitkeep
libpg_query/windows
libpg_query/windows/.gitkeep

My process for managing this was

  1. I would build it on mac (outputs osx/libpg_query.a)
  2. run docker, mount volume to same output dir, build on linux (outputs linux/libpg_query.a)
  3. Finally, npm publish after both libpg_query.a files are built in the output libpg_query/ folder

So my guess is, which is a wild guess since I don't use windows, that the build would stick the new file (.lib or other) in the libpg_query/windows folder, and it would hopefully "just work" for windows users

Perhaps if we do this with a CI, my question would be — is there a way to build all three operating systems somehow? My process was doing all three builds then publish. Not sure how to map this properly, but I'm sure we can figure it out!

pyramation avatar Jan 25 '24 21:01 pyramation

Having the (shared) binaries compiled upstream would be great for us.

I am currently doing a manual cross compilation and persisting the objects to git: https://github.com/premium-minds/sonar-postgres-plugin/blob/master/generate_libpg_query.sh

froque avatar Jan 26 '24 14:01 froque