ecto icon indicating copy to clipboard operation
ecto copied to clipboard

Dependency compile error

Open jwarwick opened this issue 13 years ago • 11 comments

I'm trying to use Ecto and Postgrex as dependencies in a project, but I'm getting an error when doing mix deps.get.

It appears that ecto, postgrex and poolboy are fetched correctly, then poolboy builds correctly, but building ecto fails. postgrex is never built.

Error message:

Compiled lib/ecto/query/api.ex
lib/ecto/adapters/postgres.ex:17: unused alias Normalizer
lib/ecto/adapters/postgres.ex:15: unused alias QueryExpr
lib/ecto/adapters/postgres.ex:16: unused alias Util
== Compilation error on file lib/ecto/adapters/postgres.ex ==
could not compile dependency ecto, mix compile failed. You can recompile this dependency with `mix deps.compile ecto` or update it with `mix deps.update ecto`
** (CompileError) deps/ecto/lib/ecto/adapters/postgres.ex:43: module Postgrex.Result is not loaded and could not be found
    /Users/jwarwick/Projects/elixir/lib/elixir/lib/kernel.ex:3286: Kernel."MACRO-access"/3
    deps/ecto/lib/ecto/adapters/postgres.ex:43: Kernel.access/2

Don't know if this is a problem with ecto not having a dependency on postgrex, so some macro is unavailable or if it's related to the recent parallel compiler updates.

Sample project available at: https://github.com/jwarwick/ecto_dep_test

Relevant system info:

[jw-macbook-2 ~/Projects/ecto_dep_test]$ erl --version                                                                                                    [master][] 
Erlang R16B02 (erts-5.10.3) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.10.3  (abort with ^G)
1> 
User switch command
 --> q
[jw-macbook-2 ~/Projects/ecto_dep_test]$ iex --version                                                                                                    [master][] 
Erlang R16B02 (erts-5.10.3) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 0.11.1-dev
[jw-macbook-2 ~/Projects/ecto_dep_test]$ mix --version                                                                                                    [master][] 
Elixir 0.11.1-dev
[jw-macbook-2 ~/Projects/ecto_dep_test]$ uname -a                                                                                                         [master][] 
Darwin jw-macbook-2.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64

jwarwick avatar Nov 05 '13 15:11 jwarwick

We fixed a bunch of related bugs on elixir master. Are on you latest elixir? If it fails on latest master, let me know and I will investigate.

On Tuesday, November 5, 2013, John Warwick wrote:

I'm trying to use Ecto and Postgrex as dependencies in a project, but I'm getting an error when doing mix deps.get.

It appears that ecto, postgrex and poolboy are fetched correctly, then poolboy builds correctly, but building ecto fails. postgrex is never built.

Error message:

Compiled lib/ecto/query/api.ex lib/ecto/adapters/postgres.ex:17: unused alias Normalizer lib/ecto/adapters/postgres.ex:15: unused alias QueryExpr lib/ecto/adapters/postgres.ex:16: unused alias Util == Compilation error on file lib/ecto/adapters/postgres.ex == could not compile dependency ecto, mix compile failed. You can recompile this dependency with mix deps.compile ecto or update it with mix deps.update ecto ** (CompileError) deps/ecto/lib/ecto/adapters/postgres.ex:43: module Postgrex.Result is not loaded and could not be found /Users/jwarwick/Projects/elixir/lib/elixir/lib/kernel.ex:3286: Kernel."MACRO-access"/3 deps/ecto/lib/ecto/adapters/postgres.ex:43: Kernel.access/2

Don't know if this is a problem with ecto not having a dependency on postgrex, so some macro is unavailable or if it's related to the recent parallel compiler updates.

Sample project available at: https://github.com/jwarwick/ecto_dep_test

Relevant system info:

[jw-macbook-2 ~/Projects/ecto_dep_test]$ erl --version [master][] Erlang R16B02 (erts-5.10.3) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.10.3 (abort with ^G) 1> User switch command --> q [jw-macbook-2 ~/Projects/ecto_dep_test]$ iex --version [master][] Erlang R16B02 (erts-5.10.3) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 0.11.1-dev [jw-macbook-2 ~/Projects/ecto_dep_test]$ mix --version [master][] Elixir 0.11.1-dev [jw-macbook-2 ~/Projects/ecto_dep_test]$ uname -a [master][] Darwin jw-macbook-2.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64

— Reply to this email directly or view it on GitHubhttps://github.com/elixir-lang/ecto/issues/108 .

José Valim www.plataformatec.com.br Skype: jv.ptec Founder and Lead Developer

josevalim avatar Nov 05 '13 15:11 josevalim

@josevalim It happens on master. Looks like mix doesn't honor the order you specify the dependencies in your mixfile anymore. Also, we shouldn't output unused warnings when compilation fails.

ericmj avatar Nov 05 '13 16:11 ericmj

Sad panda! Let's talk in about 1h?

José Valimwww.plataformatec.com.br http://www.plataformatec.com.br/Founder and Lead Developer

josevalim avatar Nov 05 '13 16:11 josevalim

Confirm with @ericmj sees. Running latest master (f65ef1d), with a clean build and seeing the error.

jwarwick avatar Nov 05 '13 16:11 jwarwick

@josevalim Sure, call me when you are available.

ericmj avatar Nov 05 '13 16:11 ericmj

@jwarwick Should be fixed when using elixir and ecto master. Thanks for the report!

ericmj avatar Nov 05 '13 20:11 ericmj

Well, the updates appears to have fixed my project with ecto as a dependency. But I'm now getting the same compile error if I attempt to build ecto master.

jwarwick avatar Nov 05 '13 20:11 jwarwick

Working on a fix :)

On Tue, Nov 5, 2013 at 9:48 PM, John Warwick [email protected]:

Well, the updates appears to have fixed my project with ecto as a dependency. But I'm now getting the same compile error if I attempt to build ecto master.

— Reply to this email directly or view it on GitHubhttps://github.com/elixir-lang/ecto/issues/108#issuecomment-27810877 .

Eric Meadows-Jönsson

ericmj avatar Nov 05 '13 20:11 ericmj

@jwarwick Fixed on elixir master. Sorry for the inconvenience.

ericmj avatar Nov 05 '13 21:11 ericmj

No inconvenience at all, thanks for fixing it so quick.

jwarwick avatar Nov 06 '13 02:11 jwarwick

You can add the deps to additional applications if master isn't acceptable.

noizu avatar Nov 20 '23 19:11 noizu