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

Error compiling deps since last update, not sure.... #2278

Closed
Rovel opened this issue Oct 13, 2017 · 2 comments
Closed

Error compiling deps since last update, not sure.... #2278

Rovel opened this issue Oct 13, 2017 · 2 comments

Comments

@Rovel
Copy link

Rovel commented Oct 13, 2017

Environment

  • Elixir version (elixir -v): 1.5.1
  • Database and version (PostgreSQL 9.4, MongoDB 3.2, etc.): PG 9.6
  • Ecto version (mix deps): 2.2.6
  • Database adapter and version (mix deps): postgrex, "0.13.3
  • Operating system: OSX sierra

Current behavior

Hi,
I was going to update a personal project that was built when phoenix 1.3 was just released, so when I run:
mix deps.get && mix deps.compile I get a error from a Hex package called apartmentex with the following output:

== Compilation error in file lib/apartmentex/migrations_path_builder.ex ==
** (CompileError) lib/apartmentex/migrations_path_builder.ex:2: cannot import Mix.Ecto.build_repo_priv/1 because it is undefined or private
    (elixir) src/elixir_import.erl:77: :elixir_import.calculate/6
    (elixir) src/elixir_import.erl:18: :elixir_import.import/4
could not compile dependency :apartmentex, "mix compile" failed. You can recompile this dependency with "mix deps.compile apartmentex", update it with "mix deps.update apartmentex" or clean it with "mix deps.clean apartmentex"

Since the lib didn't changed from there to here I must assume that this maybe have something to do with the recent changes in Ecto, specially about this line:
(CompileError) lib/apartmentex/migrations_path_builder.ex:2: cannot import Mix.Ecto.build_repo_priv/1 because it is undefined or private

This lib was fine since then, so I tried to look for changes in Ecto and Phoenix Ecto to see if Mix.Ecto.build_repo_priv/1 exists but couldn't find it so I could use some help here.

I tried to built a new mix phx.new my_project and add {:apartmentex, "~> 0.2.3"} to mix.exs but the same error goes in the mix deps.compile but no success.

The lib block that origins the error:

defmodule Apartmentex.MigrationsPathBuilder do
  import Mix.Ecto, only: [build_repo_priv: 1]
  @migrations_folder Application.get_env(:apartmentex, :migrations_folder) || "tenant_migrations"

  def tenant_migrations_path(repo) do
    Path.join(build_repo_priv(repo), @migrations_folder)
  end
end

So any help here would be appreciated.

Thanks.

@josevalim
Copy link
Member

Apartmentex was using private modules of Ecto. We changed our private modules, as we are allowed to do, and that broke Apartmentex. The solution is to copy the private functions Apartmentex was using to their repo (or at least file a report there). Thanks!

@Rovel
Copy link
Author

Rovel commented Oct 13, 2017 via email

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