terenceponce

terenceponce

I’m using Phoenix 1.4.8 and I’m trying to use Distillery to compile the app inside Alpine (elixir:1.8.2-alpine). Do I need to install some library to make the compilation work? I’m using Gitlab CI to compile the app:

distillery:
  stage: build
  image: elixir:1.8.2-alpine
  cache:
    paths:
      - _build
      - deps
  before_script:
    - apk --no-cache add git
    - mix local.rebar --force
    - mix local.hex --force
    - mix deps.get
    - mix deps.compile
  script:
    - MIX_ENV=prod mix release --verbose
$ mix deps.compile
==> inflex
Compiling 6 files (.ex)
Generated inflex app
==> base64url (compile)
Compiled src/base64url.erl
==> gettext
Compiling 1 file (.erl)
Compiling 20 files (.ex)
==> jose
Compiling 90 files (.erl)
Compiling 8 files (.ex)
warning: function Poison.EncodeError.exception/1 is undefined (module Poison.EncodeError is not available)
  lib/jose/poison/lexical_encoder.ex:8

Generated jose app
===> Compiling ranch
===> Compiling telemetry
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
==> rarex
** (Mix) Could not compile dependency :telemetry, "/root/.mix/rebar3 bare compile --paths "/builds/rarex/core/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile telemetry", update it with "mix deps.update telemetry" or clean it with "mix deps.clean telemetry"

Showing Posts 1 to 10

tristan

tristan

Rebar3 Core Team

Can you run with the environment variable DEBUG=1 or copy out the rebar3.crashdump file from the container so the error can be seen?

terenceponce

terenceponce OP

Here’s what I got when I ran it again:

$ DEBUG=1 mix deps.compile
==> inflex
Compiling 6 files (.ex)
Generated inflex app
==> base64url (compile)
Compiled src/base64url.erl
==> gettext
Compiling 1 file (.erl)
Compiling 20 files (.ex)
==> jose
Compiling 90 files (.erl)
Compiling 8 files (.ex)
warning: function Poison.EncodeError.exception/1 is undefined (module Poison.EncodeError is not available)
  lib/jose/poison/lexical_encoder.ex:8

Generated jose app
===> Expanded command sequence to be run: []
===> Provider: {default,do}
===> Expanded command sequence to be run: [{default,app_discovery},
                                           {bare,compile}]
===> Provider: {default,app_discovery}
===> Provider: {bare,compile}
===> Compiling ranch
===> run_hooks("/builds/rarex/core/deps/ranch", pre_hooks, compile) -> no hooks defined

===> run_hooks("/builds/rarex/core/deps/ranch", pre_hooks, erlc_compile) -> no hooks defined

===> erlopts [debug_info]
===> files to compile ["/builds/rarex/core/deps/ranch/src/ranch_app.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_acceptors_sup.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_crc32c.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_server.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_transport.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_protocol.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_tcp.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_conns_sup.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_sup.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_acceptor.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_listener_sup.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_proxy_header.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_ssl.erl"]
===> run_hooks("/builds/rarex/core/deps/ranch", post_hooks, erlc_compile) -> no hooks defined

===> run_hooks("/builds/rarex/core/deps/ranch", pre_hooks, app_compile) -> no hooks defined

===> run_hooks("/builds/rarex/core/deps/ranch", post_hooks, app_compile) -> no hooks defined

===> run_hooks("/builds/rarex/core/deps/ranch", post_hooks, compile) -> no hooks defined

===> Expanded command sequence to be run: []
===> Provider: {default,do}
===> Expanded command sequence to be run: [{default,app_discovery},
                                           {bare,compile}]
===> Provider: {default,app_discovery}
===> Provider: {bare,compile}
===> Compiling telemetry
===> run_hooks("/builds/rarex/core/deps/telemetry", pre_hooks, compile) -> no hooks defined

===> run_hooks("/builds/rarex/core/deps/telemetry", pre_hooks, erlc_compile) -> no hooks defined

===> erlopts [debug_info]
===> files to compile ["/builds/rarex/core/deps/telemetry/src/telemetry_app.erl",
                       "/builds/rarex/core/deps/telemetry/src/telemetry_handler_table.erl",
                       "/builds/rarex/core/deps/telemetry/src/telemetry_sup.erl",
                       "/builds/rarex/core/deps/telemetry/src/telemetry.erl"]
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badmatch,{error,enoent}}
===> Stack trace to the error location:
[{rebar_erlc_compiler,modify_erlcinfo,5,
                      [{file,"/home/tristan/Devel/rebar3/_build/prod/lib/rebar/src/rebar_erlc_compiler.erl"},
                       {line,477}]},
 {rebar_erlc_compiler,'-update_erlcinfo_fun/2-fun-0-',4,
                      [{file,"/home/tristan/Devel/rebar3/_build/prod/lib/rebar/src/rebar_erlc_compiler.erl"},
                       {line,463}]},
 {lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
 {rebar_erlc_compiler,update_erlcinfo,3,
                      [{file,"/home/tristan/Devel/rebar3/_build/prod/lib/rebar/src/rebar_erlc_compiler.erl"},
                       {line,448}]},
 {rebar_erlc_compiler,'-update_erlcinfo_fun/2-fun-0-',4,
                      [{file,"/home/tristan/Devel/rebar3/_build/prod/lib/rebar/src/rebar_erlc_compiler.erl"},
                       {line,463}]},
 {lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
 {rebar_erlc_compiler,init_erlcinfo,4,
                      [{file,"/home/tristan/Devel/rebar3/_build/prod/lib/rebar/src/rebar_erlc_compiler.erl"},
                       {line,411}]},
 {rebar_erlc_compiler,compile_dirs,5,
                      [{file,"/home/tristan/Devel/rebar3/_build/prod/lib/rebar/src/rebar_erlc_compiler.erl"},
                       {line,195}]}]
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
==> rarex
** (Mix) Could not compile dependency :telemetry, "/root/.mix/rebar3 bare compile --paths "/builds/rarex/core/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile telemetry", update it with "mix deps.update telemetry" or clean it with "mix deps.clean telemetry"
tristan

tristan

Rebar3 Core Team

Have you tried with the cache deleted? I think this can also happen if some of what you have cached is not readable..

terenceponce

terenceponce OP

I haven’t tried that yet although the app I’m doing this on is pretty fresh, so I’m not sure if this is the cause. So does this mean that I don’t need to install any libraries using apk before doing the compilation?

NobbZ

NobbZ

Seeing this path in a dockerized build makes me think…

It looks like a path from your host OS, not like one I’d expect to see in the guest.

Can you please verify that you have deps and _build in your .dockerignore?

tristan

tristan

Rebar3 Core Team

No, that is actually my path :). It is using an old prebuilt rebar3 escript that was built on my machine.

NobbZ

NobbZ

That might actually be an issue, mix local.rebar installs versions it is known to work with, you should not use a different rebar when compiling mix projects.

tristan

tristan

Rebar3 Core Team

They aren’t, it is using the version installed my mix local.rebar.

NobbZ

NobbZ

Can you share access to the code? Or at least recreate the issue in a clean/fresh phoenix application which we could clone and experiment with?

tristan

tristan

Rebar3 Core Team

This is unrelated to apk, I’m simply suggesting rerunning without _build and deps cached (and deleted locally in case you are including them in the context, better to put them in .dockerignore).

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews