Blockscout: `make start` broken: spandex_phoenix error

Created on 11 Dec 2018  路  4Comments  路  Source: blockscout/blockscout

After rebasing on the latest changes on master, the Makefile/Dockerfile is broken with this error.

...
==> spandex_phoenix
Compiling 5 files (.ex)

== Compilation error in file lib/spandex_phoenix/instrumenter.ex ==
** (RuntimeError) You must configure a :tracer for :spandex_phoenix
    lib/spandex_phoenix/instrumenter.ex:21: (module)
could not compile dependency :spandex_phoenix, "mix compile" failed. You can recompile this dependency with "mix deps.compile spandex_phoenix", update it with "mix deps.update spandex_phoenix" or clean it with "mix deps.clean spandex_phoenix"
The command '/bin/sh -c mix do deps.get, deps.compile' returned a non-zero code: 1
Makefile:55: recipe for target 'build' failed
make: *** [build] Error 1

Environment

  • Elixir & Erlang/OTP versions (elixir -version): Docker bitwalker/alpine-elixir-phoenix:latest
  • Operating System: Ubuntu 18.04.1 LTS

Steps to reproduce

  1. Pull master
  2. cd docker
  3. make start

Expected behaviour

Makefile completes with success and docker containers start.

Actual behaviour

Makefile errors with spandex_phoenix error.

bug high

Most helpful comment

Seems it's because spandex_phoenix dependency needs BlockScoutWeb.Tracer module for compiling. But Dockerfile describes to compile dependencies first and copy all other files after that, so they are not available during compilation.
Worked when I added ADD . . here and removed all other ADD commands.

All 4 comments

@zachdaniel Can you please assist here?

In your apps/block_scout_web/config/config.exs do you see

  config :spandex_phoenix, tracer: BlockScoutWeb.Tracer

anywhere? If not, place that there and you should be good to go.

Seems it's because spandex_phoenix dependency needs BlockScoutWeb.Tracer module for compiling. But Dockerfile describes to compile dependencies first and copy all other files after that, so they are not available during compilation.
Worked when I added ADD . . here and removed all other ADD commands.

Interesting. Using those other ADD commands are an optimization to not require dep compilation when unrelated files change. Try adding ADD apps/block_scout_web/config ./apps/block_scout_web. I should see if I can't loosen this up on Spandex's side, but for now that ought to work.

Was this page helpful?
0 / 5 - 0 ratings