Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error on status #86

Closed
hl opened this issue Oct 22, 2018 · 3 comments
Closed

Compile error on status #86

hl opened this issue Oct 22, 2018 · 3 comments

Comments

@hl
Copy link

hl commented Oct 22, 2018

Sometimes the status value contains the atom :compile instead of {:ok, ecto_version}, this has to do with https://github.com/elixir-lang/elixir/blob/master/lib/mix/lib/mix/dep.ex#L84-L88 part I believe.

Example error:

➜  nexus git:(master) ✗ mix deps.compile ex_money
==> ex_money
Compiling 25 files (.ex)

== Compilation error in file lib/money/migration.ex ==
** (MatchError) no match of right hand side value: 
[
  %Mix.Dep{
    app: :ecto,
    deps: [
      %Mix.Dep{
        app: :db_connection,
        deps: [],
        extra: [],
        from: "/Users/henricus/Code/nexus/deps/ecto/mix.exs",
        manager: nil,
        opts: [
          env: :prod,
          build: "/Users/henricus/Code/nexus/_build/dev/lib/db_connection",
          dest: "/Users/henricus/Code/nexus/deps/db_connection",
          hex: "db_connection",
          repo: "hexpm",
          optional: true
        ],
        requirement: "~> 1.1",
        scm: Hex.SCM,
        status: {:ok, nil},
        system_env: [],
        top_level: false
      },
      %Mix.Dep{
        app: :decimal,
        deps: [],
        extra: [],
        from: "/Users/henricus/Code/nexus/deps/ecto/mix.exs",
        manager: nil,
        opts: [
          env: :prod,
          build: "/Users/henricus/Code/nexus/_build/dev/lib/decimal",
          dest: "/Users/henricus/Code/nexus/deps/decimal",
          hex: "decimal",
          repo: "hexpm",
          optional: false
        ],
        requirement: "~> 1.2",
        scm: Hex.SCM,
        status: {:ok, nil},
        system_env: [],
        top_level: false
      },
      %Mix.Dep{
        app: :poison,
        deps: [],
        extra: [],
        from: "/Users/henricus/Code/nexus/deps/ecto/mix.exs",
        manager: nil,
        opts: [
          env: :prod,
          build: "/Users/henricus/Code/nexus/_build/dev/lib/poison",
          dest: "/Users/henricus/Code/nexus/deps/poison",
          hex: "poison",
          repo: "hexpm",
          optional: true
        ],
        requirement: "~> 2.2 or ~> 3.0",
        scm: Hex.SCM,
        status: {:ok, nil},
        system_env: [],
        top_level: false
      },
      %Mix.Dep{
        app: :poolboy,
        deps: [],
        extra: [],
        from: "/Users/henricus/Code/nexus/deps/ecto/mix.exs",
        manager: nil,
        opts: [
          env: :prod,
          build: "/Users/henricus/Code/nexus/_build/dev/lib/poolboy",
          dest: "/Users/henricus/Code/nexus/deps/poolboy",
          hex: "poolboy",
          repo: "hexpm",
          optional: false
        ],
        requirement: "~> 1.5",
        scm: Hex.SCM,
        status: {:ok, nil},
        system_env: [],
        top_level: false
      },
      %Mix.Dep{
        app: :postgrex,
        deps: [],
        extra: [],
        from: "/Users/henricus/Code/nexus/deps/ecto/mix.exs",
        manager: nil,
        opts: [
          env: :prod,
          build: "/Users/henricus/Code/nexus/_build/dev/lib/postgrex",
          dest: "/Users/henricus/Code/nexus/deps/postgrex",
          hex: "postgrex",
          repo: "hexpm",
          optional: true
        ],
        requirement: "~> 0.13.0",
        scm: Hex.SCM,
        status: {:ok, nil},
        system_env: [],
        top_level: false
      }
    ],
    extra: [],
    from: "/Users/henricus/Code/nexus/mix.exs",
    manager: :mix,
    opts: [
      optional: true,
      lock:
        {:hex, :ecto, "2.2.11",
         "4bb8f11718b72ba97a2696f65d247a379e739a0ecabf6a13ad1face79844791c", [:mix],
         [
           {:db_connection, "~> 1.1", [hex: :db_connection, repo: "hexpm", optional: true]},
           {:decimal, "~> 1.2", [hex: :decimal, repo: "hexpm", optional: false]},
           {:mariaex, "~> 0.8.0", [hex: :mariaex, repo: "hexpm", optional: true]},
           {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]},
           {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]},
           {:postgrex, "~> 0.13.0", [hex: :postgrex, repo: "hexpm", optional: true]},
           {:sbroker, "~> 1.0", [hex: :sbroker, repo: "hexpm", optional: true]}
         ], "hexpm"},
      env: :prod,
      repo: "hexpm",
      hex: "ecto",
      build: "/Users/henricus/Code/nexus/_build/dev/lib/ecto",
      dest: "/Users/henricus/Code/nexus/deps/ecto"
    ],
    requirement: "~> 2.2",
    scm: Hex.SCM,
    status: :compile,
    system_env: [],
    top_level: true
  }
]
    lib/money/migration.ex:4: (module)
    (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
could not compile dependency :ex_money, "mix compile" failed. You can recompile this dependency with "mix deps.compile ex_money", update it with "mix deps.update ex_money" or clean it with "mix deps.clean ex_money"
@kipcole9
Copy link
Owner

@hl Apologies for the inconvenience.

I need to know the version of Ecto being loaded so that I can determine which function to call to use to get the migrations path (it changed from Ecto version to Ecto version 3). Looks like this is not the right way.

I'm revisiting this right now. Thanks for the issue report.

@hl
Copy link
Author

hl commented Oct 22, 2018

@kipcole9 no apologies necessary and thank you for all your hard work!

@kipcole9
Copy link
Owner

Fixed in ex_money version 2.12.1 using a much more robust mechanism that just detects if the function Ecto.Migrator.migrations_path/0 is exported. Thanks for your patience and the bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants