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

Postgrest fails to build on aarch64-darwin using nixpkgs #2412

Closed
axeltlarsson opened this issue Aug 8, 2022 · 8 comments
Closed

Postgrest fails to build on aarch64-darwin using nixpkgs #2412

axeltlarsson opened this issue Aug 8, 2022 · 8 comments

Comments

@axeltlarsson
Copy link

Environment

  • PostgreSQL version: 12.11
  • PostgREST version: 9.0.1
  • Operating system: macOS 12.5

Description of issue

Refuses to evaluate as it's marked as broken, due to 'configurator-pg-0.2.5' is marked as broken. Forcing the build does seem to confirm that configurator-pg is indeed broken unfortunately.

Also tried to build postgrest locally on my aarch64-darwin, with nix-build -A postgrestPackage but failed with:

error: builder for '/nix/store/1ivg35hg69v2fzx3mwwh59w78d2csary-aarch64-unknown-linux-gnu-stage-final-gcc-debug-11.2.0.drv' failed with exit code 2;
       last 10 log lines:
       > checking that generated files are newer than configure... done
       > configure: error: conditional "ENABLE_DARWIN_AT_RPATH" was never defined.
       > Usually this means the macro was only invoked conditionally.
       > make[1]: *** [Makefile:16550: configure-target-libatomic] Error 1
       > checking that generated files are newer than configure... done
       > configure: error: conditional "ENABLE_DARWIN_AT_RPATH" was never defined.
       > Usually this means the macro was only invoked conditionally.
       > make[1]: *** [Makefile:15634: configure-target-libgomp] Error 1
       > make[1]: Leaving directory '/private/tmp/nix-build-aarch64-unknown-linux-gnu-stage-final-gcc-debug-11.2.0.drv-0/build'
       > make: *** [Makefile:974: all] Error 2
       For full logs, run 'nix log /nix/store/1ivg35hg69v2fzx3mwwh59w78d2csary-aarch64-unknown-linux-gnu-stage-final-gcc-debug-11.2.0.drv'.
error: 1 dependencies of derivation '/nix/store/kwcs9794l9vhjpzxhjqc643q9wzkqc5r-aarch64-unknown-linux-gnu-stage-final-gcc-debug-wrapper-11.2.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/bsw00biz4vy0zn4ycqdr6kblvx24wsl4-stdenv-darwin.drv' failed to build
error: 1 dependencies of derivation '/nix/store/9ps339zkx80r2f1kxsj8q0b1470zzwrp-hello-aarch64-unknown-linux-gnu-2.12.drv' failed to build

😔

Thanks for wonderful software regardless and any ideas/advice to fix/work around this are most welcome.

@steve-chavez
Copy link
Member

@robx Would it be possible to fix configurator-pg for aarch64-darwin?

@robx
Copy link
Contributor

robx commented Aug 9, 2022

@steve-chavez
Where do you see that configurator-pg is broken on aarch64-darwin? I doubt that's the case, but if it is, could you file a bug report at https://github.com/robx/configurator-pg/issues.

@axeltlarsson
The first issue you describe seems to be building within nixpkgs proper? In that case I'd rather consider it an issue with https://github.com/nixos/nixpkgs. (Though fixing that will likely need to wait for an updated PostgREST release from our side, to bring in the aeson-2 change, from here #2288. @steve-chavez is such a release in sight?)

For the second issue you describe, which PostgREST version are you trying to build? Is this a recent git checkout? I'm afraid I don't really understand what's going wrong, but it seems like there's something fundamental wrong with the nixpkgs setup. Might be that updating the nixpkgs version in nix/nixpkgs-version.nix helps?

@robx
Copy link
Contributor

robx commented Aug 9, 2022

See also NixOS/nixpkgs#137877. I have no idea why a cross-compiling gcc would be used, though.

@steve-chavez
Copy link
Member

Where do you see that configurator-pg is broken on aarch64-darwin?

@robx Sorry, really I have no idea how nixpkgs works there.

is such a release in sight?

Yes, v10 should be released this week. Once #2419 and #2414 are merged.

@axeltlarsson
Copy link
Author

@robx You're correct, pg-configurator is not the issue, it is not marked broken, and builds just fine. I thought I'd updated my local channel for nix-shell, but apparently that failed silently as nix-channel --list was empty (sudo needed for whatever reason, unrelated issue) 🤦 . So it only used to be marked broken, I suppose fixed in NixOS/nixpkgs#181110
Apologies for the confusion.

In a recent nixkgs local checkout, I can successfully do nix-build -A haskellPackages.configurator-pg, but nix-build -a haskellPackages.postgrest is still marked broken, and forcing a build fails with:

Configuring postgrest-9.0.1...

Setup: Encountered missing or private dependencies:
aeson >=1.4.7 && <1.6,
hasql >=1.4 && <1.5,
hasql-dynamic-statements ==0.3.1,
jose >=0.8.1 && <0.9,
swagger2 >=2.4 && <2.7

error: builder for '/nix/store/xrj0q2xm1r6s6bqb9zd2idsmqqdd94za-postgrest-9.0.1.drv' failed with exit code 1;
       last 10 log lines:
       > Using Parsec parser
       > Configuring postgrest-9.0.1...
       >
       > Setup: Encountered missing or private dependencies:
       > aeson >=1.4.7 && <1.6,
       > hasql >=1.4 && <1.5,
       > hasql-dynamic-statements ==0.3.1,
       > jose >=0.8.1 && <0.9,
       > swagger2 >=2.4 && <2.7
       >
       For full logs, run 'nix log /nix/store/xrj0q2xm1r6s6bqb9zd2idsmqqdd94za-postgrest-9.0.1.drv'.

But that issue seems like it might be resolved with version 10 of postgrest? 🤞

@wolfgangwalther
Copy link
Member

Yes, v10 should be released this week. Once #2419 and #2414 are merged.

That's, again, a very quick process. #2419 is quite a major feature, so it would be good to give a little bit of time to make sure it doesn't break anything unexpectedly.

@axeltlarsson
Copy link
Author

I just tried bulding it locally again and now it works fine!
Regarding getting into it into nixpkgs, I suppose it first needs to be updated to hackage?

@axeltlarsson
Copy link
Author

Fixed now.

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

No branches or pull requests

4 participants