asciinema / asciinema-server

Platform for hosting and sharing terminal session recordings
https://docs.asciinema.org/manual/server/
Apache License 2.0
2.29k stars 263 forks source link

docker build: Rust NIF compile error (rustc exit code 101) #392

Closed florianschroen closed 1 year ago

florianschroen commented 2 years ago

As noted at https://github.com/asciinema/asciinema-server/wiki/Installation-guide#customizations self compiling the software should be possible.

But an error occurs.

# docker build -t asciinema/asciinema-server .
Sending build context to Docker daemon  2.469MB
Step 1/37 : ARG ALPINE_VERSION=3.14.2
Step 2/37 : ARG ERLANG_OTP_VERSION=24.1.4
Step 3/37 : ARG ELIXIR_VERSION=1.12.1
Step 4/37 : FROM hexpm/elixir:${ELIXIR_VERSION}-erlang-${ERLANG_OTP_VERSION}-alpine-${ALPINE_VERSION} as builder
 ---> eacaaded65f3
Step 5/37 : ARG MIX_ENV=prod
 ---> Using cache
 ---> 5b725e2b8a3e
Step 6/37 : WORKDIR /opt/app
 ---> Using cache
 ---> d136e7235f2c
Step 7/37 : RUN apk upgrade &&   apk add     nodejs     npm     rust     cargo     build-base &&   mix local.rebar --force &&   mix local.hex --force
 ---> Using cache
 ---> b722b4aa237e
Step 8/37 : COPY mix.* ./
 ---> Using cache
 ---> a266e4caa855
Step 9/37 : RUN mix do deps.get --only prod, deps.compile
 ---> Using cache
 ---> 2f552adafffc
Step 10/37 : COPY assets/ assets/
 ---> Using cache
 ---> 3bb1105b0627
Step 11/37 : RUN cd assets &&   npm install &&   npm run deploy
 ---> Using cache
 ---> e0896b9da447
Step 12/37 : COPY config/config.exs config/
 ---> Using cache
 ---> e1044c2ca50e
Step 13/37 : COPY config/prod.exs config/
 ---> Using cache
 ---> 730c92a66879
Step 14/37 : RUN mix phx.digest
 ---> Using cache
 ---> 6079b591a04f
Step 15/37 : COPY config/*.exs config/
 ---> Using cache
 ---> c3c129b4cac0
Step 16/37 : COPY lib lib/
 ---> Using cache
 ---> 53f69761f6b5
Step 17/37 : COPY priv priv/
 ---> Using cache
 ---> 03defacd1567
Step 18/37 : COPY native native/
 ---> Using cache
 ---> 6b659454ac15
Step 19/37 : RUN mix deps.compile sentry --force
 ---> Using cache
 ---> 18a8ac33e3ff
Step 20/37 : COPY rel rel/
 ---> Using cache
 ---> 4cada6861f31
Step 21/37 : ENV RUSTLER_NIF_VERSION 2.15
 ---> Using cache
 ---> ab1e54a68bc5
Step 22/37 : RUN mix release
 ---> Running in 6cdee687fadf
Compiling NIF crate :vt_nif (native/vt_nif)...
    Updating crates.io index
error: failed to get `vt` as a dependency of package `vt_nif v0.1.0 (/opt/app/native/vt_nif)`

Caused by:
  failed to load source for dependency `vt`

Caused by:
  Unable to update /opt/app/native/vt

Caused by:
  failed to read `/opt/app/native/vt/Cargo.toml`

Caused by:
  No such file or directory (os error 2)
** (RuntimeError) Rust NIF compile error (rustc exit code 101)
    (rustler 0.21.1) lib/mix/tasks/compile.rustler.ex:68: Mix.Tasks.Compile.Rustler.compile_crate/1
    (elixir 1.12.1) lib/enum.ex:1553: Enum."-map/2-lists^map/1-0-"/2
    (rustler 0.21.1) lib/mix/tasks/compile.rustler.ex:15: Mix.Tasks.Compile.Rustler.run/1
    (mix 1.12.1) lib/mix/task.ex:394: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.12.1) lib/mix/tasks/compile.all.ex:90: Mix.Tasks.Compile.All.run_compiler/2
    (mix 1.12.1) lib/mix/tasks/compile.all.ex:70: Mix.Tasks.Compile.All.compile/4
    (mix 1.12.1) lib/mix/tasks/compile.all.ex:57: Mix.Tasks.Compile.All.with_logger_app/2
    (mix 1.12.1) lib/mix/tasks/compile.all.ex:35: Mix.Tasks.Compile.All.run/1
The command '/bin/sh -c mix release' returned a non-zero code: 1

tested with develop and master branch:

commit bc6f605dfe57fcf9992e4a547908a0654ef2f5cb (HEAD -> develop, origin/develop, origin/HEAD)
commit f55d49210d5d19d9b3c087843bbf382d92799383 (HEAD -> master, tag: v20220327, origin/master)

Can someone verify this, please?

ku1ik commented 1 year ago

Looks like you were missing git submodule vt. Have you cloned with git clone --recursive https://github.com/asciinema/asciinema-server.git ?

Try git submodule update --init and then docker build again.