5 months 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
5 months 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"]
5 months 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?
5 months 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)
Hey there, sorry i just saw this.
here's the logfile.
5 months 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?
5 months ago
You can install Nixpacks locally: https://nixpacks.com/docs/install
5 months ago
And then use nixpacks build .
5 months ago
Great!
@root interestingly, it fixed it when using nixpacks build ., but not when deploying to railway. here's the new logs:
5 months 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 status5 months ago
Could you send your full nixpacks.toml?
Status changed to Open brody • 5 months ago
[packages]
pkgs = ["...", "postgresql.lib"]
[phases.setup]
nixLibs = ["...", "postgresql.lib"]5 months 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