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

nix build working on aarch64-darwin #936

Open
samrose opened this issue Apr 5, 2024 · 2 comments
Open

nix build working on aarch64-darwin #936

samrose opened this issue Apr 5, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@samrose
Copy link
Contributor

samrose commented Apr 5, 2024

Chore

Currently the nix portion of this project will not build directly/natively on darwin (but will build if you configure a remote vm or physical machine builder).

It's not critical that the nix portion of this project build on aarch64-darwin today, as our targets are aarch64-linux and x86_64-linux however for people in the organization or open source users to work with the nix portions of this project, it could be optimal to be able to build it on aarch64-darwin

The current known limitations seem to be rooted in https://github.com/pgcentralfoundation/pgrx/blob/develop/flake.nix while it tries to support the system https://github.com/pgcentralfoundation/pgrx/blob/develop/flake.nix#L16

...it might lack the needed ld linking to xcode -sourced libs when building on aarch64-darwin https://github.com/pgcentralfoundation/pgrx/blob/develop/flake.nix#L98 which is usually something like

(if stdenv.cc.isClang && stdenv.isDarwin then [ NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";] else []);

So, this task is to try and either upstream that solution, or override locally, and possibly tease out other issues beyond that, so that users can opt to build natively in aarch64-darwin

In order to maintain this, we would also need to set up a macos builder as well (which is another task)

@garrettmichaelgeorge
Copy link

garrettmichaelgeorge commented May 10, 2024

The current known limitations seem to be rooted in https://github.com/pgcentralfoundation/pgrx/blob/develop/flake.nix while it tries to support the system https://github.com/pgcentralfoundation/pgrx/blob/develop/flake.nix#L16

@samrose The link appears to be broken due to Nix code being removed in pgcentralfoundation/pgrx#1682. The last valid reference to flake.nix on their develop branch is https://github.com/pgcentralfoundation/pgrx/blob/99dee7c4a27883e7a9880397e419a2e359ee2da7/flake.nix. Nix is, however, reintroduced in pgcentralfoundation/pgrx#1683, which might benefit from input.

@samrose
Copy link
Contributor Author

samrose commented May 10, 2024

@garrettmichaelgeorge thanks.

I actually think my theory above was wrong, and that the issue is simply referencing the correct sdk paths when isDarwin in a build, to get the all of the extensions etc to build natively that use pgrx

Probably I will be able to dig into this later next week

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

No branches or pull requests

2 participants