Build Phoenix app fails - OTP release 26 or later is required.
syepes
HOBBY
3 days ago
Hello,
I have been trying to build my Elixir / Phoenix app but can seam to find a why to specify a newer version of the OTP release.
Could someone please indicate me what what options do I need to configure to fix this build issue?
This is app requires the following dependencies
{:broadway_kafka, "~> 0.4"},
{:snappyer, "~> 1.2"},
# nixpacks.toml
[variables]
MIX_ENV = 'prod'
PHX_SERVER = 'true'
ELIXIR_ERL_OPTIONS = '+fnu'
RAILPACK_ELIXIR_VERSION = '1.18'
RAILPACK_ERLANG_VERSION = '27.3'
[phases.setup]
nixPkgs = ['...', 'erlang', 'cmake', 'gcc', 'libtool', 'patch']
[phases.install]
cmds = [
'mix local.hex --force',
'mix local.rebar --force',
'mix deps.get --only prod',
]
[phases.build]
cmds = ['mix compile', 'mix assets.deploy', 'mix release']
[start]
cmd = "mix ecto.setup && mix phx.server"
2 Replies
Railway
BOT
3 days ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
syepes
HOBBY
3 days ago
I have set the variable RAILPACK_ELIXIR_VERSION = '1.18', RAILPACK_ERLANG_VERSION = '27.3' but its still not building.
gmake[3]: Entering directory '/app/deps/crc32cer/c_build'
[ 90%] Building C object CMakeFiles/crc32cer_nif.dir/c_src/crc32c_nif.c.o
[100%] Linking C shared library /app/deps/crc32cer/priv/libcrc32cer_nif.so
/nix/store/vcvhwiilizhijk7ywyn58p9l005n9sbn-binutils-2.43.1/bin/ld: external/src/google-crc32c-build/libcrc32c.a(crc32c.cc.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/nix/store/vcvhwiilizhijk7ywyn58p9l005n9sbn-binutils-2.43.1/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
gmake[3]: *** [CMakeFiles/crc32cer_nif.dir/build.make:98: /app/deps/crc32cer/priv/libcrc32cer_nif.so] Error 1
gmake[3]: Leaving directory '/app/deps/crc32cer/c_build'
gmake[2]: *** [CMakeFiles/Makefile2:85: CMakeFiles/crc32cer_nif.dir/all] Error 2
gmake[2]: Leaving directory '/app/deps/crc32cer/c_build'
gmake[1]: *** [Makefile:136: all] Error 2
gmake[1]: Leaving directory '/app/deps/crc32cer/c_build'
make: *** [Makefile:9: nif] Error 2
===> Hook for compile failed!
** (Mix) Could not compile dependency :crc32cer, "/root/.mix/elixir/1-17/rebar3 bare compile --paths /app/_build/prod/lib/*/ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile crc32cer --force", update it with "mix deps.update crc32cer" or clean it with "mix deps.clean crc32cer"
ā [10/13] RUN mix compile
process "/bin/bash -ol pipefail -c mix compile" did not complete successfully: exit code: 1
Dockerfile:25
-------------------
23 | # build phase
24 | COPY . /app/.
25 | >>> RUN mix compile
26 | RUN mix assets.deploy
27 | RUN mix release
-------------------
ERROR: failed to build: failed to solve: process "/bin/bash -ol pipefail -c mix compile" did not complete successfully: exit code: 1
Error: Docker build failed