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

Enable cross compiling extensions #1994

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

rhelmot
Copy link

@rhelmot rhelmot commented Mar 6, 2025

Two pieces here in order to enable my successful build of some pgrx extensions from x86_64-linux to x86_64-freebsd:

  • cargo pgrx init --no-run does not attempt to run the discovered postgreses, since they could be for the target architecture or OS.
  • --target flag to some other commands is passed along to cargo build invocations and injected into the calculation of the build directory path. The builds done in order to generate bindings (?) are still done native, since the result has to run at build time.

Note that I was doing this within nix and nixpkgs, but I think it should generalize pretty well to the normal rust cross toolchains.

Note also that I haven't actually tested this diff precisely, since I was working with something that pinned, of all things, 0.12.0-alpha1. The rebase was pretty straightforward but if you want to see the diff that I know for sure works, check here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant