elixir-web / weber

[WiP] Web framework for Elixir inspired by Rails [#WeberMVC at freenode]
http://elixir-web.github.io/weber/
MIT License
371 stars 33 forks source link

compilation issues and Plug versions #191

Closed leikind closed 10 years ago

leikind commented 10 years ago

Elixir 0.13.1

mix deps.get fetches Plug 0.4.2 ( c496fbb9dd2968e7c1406902d5351fa6a0d86415 ) . Its compilation fails:

== Compilation error on file lib/plug/adapters/cowboy/conn.ex ==
could not compile dependency plug, mix compile failed. You can recompile this dependency with `mix deps.compile plug` or update it with `mix deps.update plug`
** (CompileError) deps/plug/lib/plug/adapters/cowboy/conn.ex:33: File.Stat.__struct__/0 is undefined, cannot expand struct File.Stat
    (elixir) src/elixir_map.erl:55: :elixir_map.translate_struct/4
    (elixir) src/elixir_clauses.erl:26: :elixir_clauses.match/3
    (elixir) src/elixir_translator.erl:18: :elixir_translator.translate/2
    (elixir) src/elixir_translator.erl:350: :elixir_translator.translate_block/4
    (elixir) src/elixir_translator.erl:39: :elixir_translator.translate/2
    (elixir) src/elixir_clauses.erl:36: :elixir_clauses.clause/7
    (elixir) src/elixir_def.erl:182: :elixir_def.translate_clause/7

I can still compile Weber if I require Plug 0.4.1:

{:plug, github: "elixir-lang/plug", tag: "v0.4.1"},

But then the compilation of a generated webapp fails:

== Compilation failed ==
Compilation failed on the following files:

* lib/weber/handler/weber_req_handler.ex is missing module Weber.Session
lib/weber/i18n/i18n.ex:3: warning: unused import Weber.Time
lib/weber/handler/weber_req_handler.ex:8: warning: unused import Weber.Route
* lib/weber/handler/weber_websocket_handler.ex is missing module Plug.Conn
* lib/weber/http/params.ex is missing module Plug.Conn.Query
* lib/weber/i18n/i18n.ex is missing module Weber.Session
lib/weber/handler/weber_req_handler.ex:7: warning: unused import Weber.Utils
* lib/weber/session/session.ex is missing module Weber.Http.Params

One of the failures is shown below...
== Compilation error on file lib/weber/http/params.ex ==
could not compile dependency weber, mix compile failed. You can recompile this dependency with `mix deps.compile weber` or update it with `mix deps.update weber`
** (CompileError) deps/weber/lib/weber/http/params.ex:25: module Plug.Conn.Query is not loaded and could not be found
    (elixir) src/elixir_exp.erl:121: :elixir_exp.expand/2
    (stdlib) lists.erl:1352: :lists.mapfoldl/3
    (stdlib) lists.erl:1353: :lists.mapfoldl/3
    (elixir) src/elixir_exp.erl:49: :elixir_exp.expand/2
    (elixir) src/elixir.erl:150: :elixir.quoted_to_erl/3

I think it would make sense to always specify versions of dependencies.

sdogruyol commented 10 years ago

Yeah i'm getting the same issue using Elixir 0.13.1.

Is there any solution ?

0xAX commented 10 years ago

Hello @leikind, @leikind,

I was busy sometimes ago, and need to adapt Weber to the last Elixir and deps. Will do it in the nearest time. Thanks for the report.

Thank you.

rcdilorenzo commented 10 years ago

I think this issue with compiling weber is now resolved with new versions of plug and elixir. Can this issue be closed?