alex9spiridonov

alex9spiridonov

How can I change deps compilation order?

I have a problem with compiling dependencies in my phoenix project.

defp deps do
    [
      # default phoenix deps
      {:phoenix, "~> 1.4.9"},
      {:phoenix_pubsub, "~> 1.1"},
      {:phoenix_ecto, "~> 4.0"},
      {:ecto_sql, "~> 3.1"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 2.11"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:gettext, "~> 0.11"},
      {:jason, "~> 1.0"},
      {:plug_cowboy, "~> 2.0"},
      # deps for exometer
      {:elixometer, github: "pinterest/elixometer"},
      {:exometer_core, override: true},
      {:exometer, github: "PSPDFKit-labs/exometer", runtime: false}
    ]
  end

I have an error on compiling exometer.

mix deps.compile
===> Compiling setup
src/setup.erl:944: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
src/setup.erl:1163: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
src/setup.erl:1588: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace

===> Building escript...
===> Compiling bear
===> Compiling parse_trans
==> hut (compile)
Compiled src/hut.erl

11:06:45.120 [info]  Compiling file system watcher for Mac...

11:06:46.564 [info]  Done.
==> file_system
Compiling 7 files (.ex)
Generated file_system app
==> connection
Compiling 1 file (.ex)
Generated connection app
==> gettext
Compiling 1 file (.yrl)
Compiling 1 file (.erl)
Compiling 20 files (.ex)
Generated gettext app
===> Compiling ranch
===> Compiling telemetry
==> decimal
Compiling 1 file (.ex)
Generated decimal app
===> Compiling folsom
===> Compiling exometer_core
src/exometer_proc.erl:219: Warning: sys:get_debug/3: Deprecated function. Incorrectly documented and in fact only for internal use. Can often be replaced with sys:get_log/1.

===> Compiling exometer
===> Compiling src/exometer_app.erl failed
src/exometer_app.erl:none: undefined parse transform 'lager_transform'

==> little_phoenix
** (Mix) Could not compile dependency :exometer, "/Users/alex/.mix/rebar3 bare compile --paths "/Users/alex/Development/little_phoenix/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile exometer", update it with "mix deps.update exometer" or clean it with "mix deps.clean exometer"

But if I compile project in 2 steps:

  1. remove exometer and compile without it
mix deps.compile
===> Compiling setup
src/setup.erl:944: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
src/setup.erl:1163: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
src/setup.erl:1588: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace

===> Building escript...
===> Compiling bear
===> Compiling parse_trans
==> hut (compile)
Compiled src/hut.erl

11:18:44.667 [info]  Compiling file system watcher for Mac...

11:18:45.357 [info]  Done.
==> file_system
Compiling 7 files (.ex)
Generated file_system app
==> connection
Compiling 1 file (.ex)
Generated connection app
==> gettext
Compiling 1 file (.yrl)
Compiling 1 file (.erl)
Compiling 20 files (.ex)
Generated gettext app
===> Compiling ranch
===> Compiling telemetry
==> decimal
Compiling 1 file (.ex)
Generated decimal app
===> Compiling folsom
===> Compiling exometer_core
src/exometer_proc.erl:219: Warning: sys:get_debug/3: Deprecated function. Incorrectly documented and in fact only for internal use. Can often be replaced with sys:get_log/1.

==> jason
Compiling 8 files (.ex)
Generated jason app
===> Fetching rebar3_proper ({pkg,<<"rebar3_proper">>,<<"0.11.1">>})
===> Version cached at /Users/alex/.cache/rebar3/hex/default/packages/rebar3_proper-0.11.1.tar is up to date, reusing it
===> Compiling rebar3_proper
===> Compiling pobox
==> db_connection
Compiling 14 files (.ex)
Generated db_connection app
==> ecto
Compiling 54 files (.ex)
Generated ecto app
==> phoenix_pubsub
Compiling 13 files (.ex)
Generated phoenix_pubsub app
===> Compiling cowlib
===> Compiling cowboy
==> mime
Compiling 2 files (.ex)
Generated mime app
===> Compiling goldrush
===> Compiling lager
==> elixometer
Compiling 5 files (.ex)
Generated elixometer app
==> postgrex
Compiling 61 files (.ex)
Generated postgrex app
==> ecto_sql
Compiling 25 files (.ex)
Generated ecto_sql app
==> plug_crypto
Compiling 4 files (.ex)
Generated plug_crypto app
==> plug
Compiling 1 file (.erl)
Compiling 39 files (.ex)
warning: System.stacktrace/0 outside of rescue/catch clauses is deprecated. If you want to support only Elixir v1.7+, you must access __STACKTRACE__ inside a rescue/catch. If you want to support earlier Elixir versions, move System.stacktrace/0 inside a rescue/catch
  lib/plug/conn/wrapper_error.ex:23

Generated plug app
==> phoenix_html
Compiling 8 files (.ex)
Generated phoenix_html app
==> plug_cowboy
Compiling 6 files (.ex)
Generated plug_cowboy app
==> phoenix
Compiling 67 files (.ex)
Generated phoenix app
==> phoenix_live_reload
Compiling 4 files (.ex)
Generated phoenix_live_reload app
==> phoenix_ecto
Compiling 6 files (.ex)
Generated phoenix_ecto app
  1. add exometer and compile it
mix deps.compile
===> Compiling setup
===> Building escript...
===> Compiling bear
===> Compiling parse_trans
==> hut (compile)
===> Compiling ranch
===> Compiling telemetry
===> Compiling folsom
===> Compiling exometer_core
===> Compiling exometer
===> Compiling pobox
===> Compiling cowlib
===> Compiling cowboy
===> Compiling goldrush
===> Compiling lager

all is well

How can I change the compilation order?
I think I should compile a lager before of the exometer.

Deps compiled in the following order:

Mix.Dep.load_and_cache |> Enum.map(fn(x) -> IO.puts Map.get(x, :app) end)
setup
bear
parse_trans
hut
file_system
connection
gettext
ranch
telemetry
decimal
folsom
exometer_core
exometer
jason
pobox
db_connection
ecto
phoenix_pubsub
cowlib
cowboy
mime
goldrush
lager
elixometer
postgrex
ecto_sql
plug_crypto
plug
phoenix_html
plug_cowboy
phoenix
phoenix_live_reload
phoenix_ecto

Deps tree:

mix deps.tree
little_phoenix
├── gettext ~> 0.11 (Hex package)
├── exometer_core (Hex package) *override*
│   ├── folsom 0.8.7 (Hex package)
│   │   └── bear 0.8.7 (Hex package)
│   ├── hut 1.2.1 (Hex package)
│   ├── parse_trans 3.3.0 (Hex package)
│   └── setup 2.0.2 (Hex package)
├── exometer (https://github.com/PSPDFKit-labs/exometer.git)
│   └── exometer_core ~r/.*/ (git://github.com/PSPDFKit-labs/exometer_core.git) *override*
├── jason ~> 1.0 (Hex package)
│   └── decimal ~> 1.0 (Hex package)
├── phoenix_pubsub ~> 1.1 (Hex package)
├── elixometer (https://github.com/pinterest/elixometer.git)
│   ├── lager >= 3.2.1 (Hex package)
│   │   └── goldrush 0.1.9 (Hex package)
│   ├── exometer_core ~> 1.5 (Hex package)
│   └── pobox ~> 1.2 (Hex package)
├── postgrex >= 0.0.0 (Hex package)
│   ├── connection ~> 1.0 (Hex package)
│   ├── db_connection ~> 2.1 (Hex package)
│   │   └── connection ~> 1.0.2 (Hex package)
│   ├── decimal ~> 1.5 (Hex package)
│   └── jason ~> 1.0 (Hex package)
├── ecto_sql ~> 3.1 (Hex package)
│   ├── db_connection ~> 2.0 (Hex package)
│   ├── ecto ~> 3.1.0 (Hex package)
│   │   ├── decimal ~> 1.6 (Hex package)
│   │   └── jason ~> 1.0 (Hex package)
│   ├── postgrex ~> 0.14.0 or ~> 0.15.0 (Hex package)
│   └── telemetry ~> 0.4.0 (Hex package)
├── phoenix_html ~> 2.11 (Hex package)
│   └── plug ~> 1.5 (Hex package)
│       ├── mime ~> 1.0 (Hex package)
│       ├── plug_crypto ~> 1.0 (Hex package)
│       └── telemetry ~> 0.4 (Hex package)
├── plug_cowboy ~> 2.0 (Hex package)
│   ├── cowboy ~> 2.5 (Hex package)
│   │   ├── cowlib ~> 2.7.3 (Hex package)
│   │   └── ranch ~> 1.7.1 (Hex package)
│   └── plug ~> 1.7 (Hex package)
├── phoenix ~> 1.4.9 (Hex package)
│   ├── jason ~> 1.0 (Hex package)
│   ├── phoenix_pubsub ~> 1.1 (Hex package)
│   ├── plug ~> 1.8.1 or ~> 1.9 (Hex package)
│   ├── plug_cowboy ~> 1.0 or ~> 2.0 (Hex package)
│   └── telemetry ~> 0.4 (Hex package)
├── phoenix_live_reload ~> 1.2 (Hex package)
│   ├── file_system ~> 0.2.1 or ~> 0.3 (Hex package)
│   └── phoenix ~> 1.4 (Hex package)
└── phoenix_ecto ~> 4.0 (Hex package)
    ├── ecto ~> 3.0 (Hex package)
    ├── phoenix_html ~> 2.9 (Hex package)
    └── plug ~> 1.0 (Hex package)

Most Liked

NobbZ

NobbZ

You can not alter the order of compilation, it is determined automatically and make sure that dependencies are compiled before their dependants. Sadly exometer uses lager but hasn’t specified it as a dependency. Please file a bug report on their repository.

alex9spiridonov

alex9spiridonov

Thank you for a good idea!
I made exometer fork, added a dependency. Everything works!

Where Next?

Popular in Questions Top

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
nobody
How to bind a phoenix app to a specific ip address? could not find anything about that, nowhere, unfortunately, but for me this is quite...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; ...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement