a year ago
Hello!
my app can't seem to compile, after updating my nixpacks config (below), this error came out.
[phases.setup]
nixPkgs = ["...", "postgresql.lib"]
[packages]
pkgs = ["...", "postgresql.lib"]23 Replies
a year ago
do not use both of them the first one is a phase level and 2nd one is top level both do the similar work so use one only
The problem is that you are defining the packages in two different ways in the same file. Nixpacks is likely getting confused by the duplicate declarations. You only need to specify the packages once.
example
# nixpacks.toml
[phases.setup]
# This tells Nixpacks to add the PostgreSQL client library (libpq)
# to the environment before the build starts.
# The "..." ensures that all default packages are still included.
nixPkgs = ["...", "postgresql.lib"]
a year ago
using only the [phases.setup] or [packages] config change returns the CC linker error, whereas using both stops the CC linker error, but halts the build due to not being able to compile Ring. what can i do about this?
a year ago
This shouldn't be related to the PGSQL package. Could you send the full build log? (the button to download it should be just to the right of the search box)
a year ago
Try adding postgresql.lib to nixLibs as well.
any way for me to test this locally instead of continuing to add commits to my repo?
a year ago
You can install Nixpacks locally: https://nixpacks.com/docs/install
a year ago
And then use nixpacks build .
a year ago
Great!
@root interestingly, it fixed it when using nixpacks build ., but not when deploying to railway. here's the new logs:
a year ago
Alright, try adding libpq-dev to your aptPkgs list.
note: /nix/store/z91k46jmcm1lz2c3xl6ffaic887r6w3h-binutils-2.43.1/bin/ld: cannot find -lp
q: No such file or directory
8.776 collect2: error: ld returned 1 exit statusa year ago
Could you send your full nixpacks.toml?
Status changed to Open brody • 12 months ago
[packages]
pkgs = ["...", "postgresql.lib"]
[phases.setup]
nixLibs = ["...", "postgresql.lib"]a year ago
Move pkgs to nixPkgs in phases.setup.
8.816 error: linking with `cc` failed: exit status: 1
...
= note: /nix/store/z91k46jmcm1lz2c3xl6ffaic887r6w3h-binutils-2.43.1/bin/ld: cannot find -lp
q: No such file or directory
8.816 collect2: error: ld returned 1 exit status