BennyHallett / obelisk

Static Site Generator written in Elixir.
MIT License
392 stars 34 forks source link

Obelisk doesn't compile with elixir 1.3.1 ? #44

Open mszmurlo opened 7 years ago

mszmurlo commented 7 years ago

I'm using recent versions of Erlang and Elixir:

maurice@tessy> elixir -v
Erlang/OTP 19 [erts-8.0] [source] [64-bit] [smp:2:2] [async-threads:10] [kernel-poll:false]

Elixir 1.3.1

Following the instructions, my mix.exs looks like this:

defp deps do
  [{ :obelisk, "~> 0.7.1" }, { :yamerl, github: "yakaz/yamerl"} ]
end

mix deps.get goes well. But mix.deps.compile generates warnings and errors:

maurice@tessy> mix deps.compile
==> anubis
warning: the dependency :anubis requires Elixir "~> 1.0.0" but you are running on v1.3.1
Compiling 1 file (.ex)
Generated anubis app
==> chronos
Compiling 3 files (.ex)
warning: this clause cannot match because a previous clause at line 227 always matches
  lib/chronos/formatter.ex:229

warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
  lib/chronos.ex:13

Generated chronos app
==> yamerl
Compiling 27 files (.erl)
Generated yamerl app
==> ranch (compile)
Compiled src/ranch_transport.erl
Compiled src/ranch_sup.erl
Compiled src/ranch_server.erl
Compiled src/ranch_acceptor.erl
Compiled src/ranch_listener_sup.erl
Compiled src/ranch_protocol.erl
Compiled src/ranch.erl
Compiled src/ranch_acceptors_sup.erl
Compiled src/ranch_conns_sup.erl
Compiled src/ranch_app.erl
Compiled src/ranch_ssl.erl
Compiled src/ranch_tcp.erl
==> rss
warning: the dependency :rss requires Elixir "~> 1.0.0" but you are running on v1.3.1
Compiling 1 file (.ex)
Generated rss app
==> earmark
Compiling 9 files (.ex)
warning: the variable "blocks" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark.ex:177

warning: the variable "context" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark.ex:177

warning: the variable "line" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/helpers.ex:10

warning: parentheses are required when piping into a function call. For example:

    foo 1 |> bar 2 |> baz 3

is ambiguous and should be written as

    foo(1) |> bar(2) |> baz(3)

Ambiguous pipe found at:
  lib/earmark/inline.ex:307

warning: the variable "rule_updates" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/inline.ex:304

warning: the variable "rule_updates" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/inline.ex:302

warning: the variable "rule_updates" is unsafe as it has been set inside a case/cond/receive/if/&&/||.  Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/inline.ex:306

warning: the variable "html" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/html_renderer.ex:85

warning: the variable "rest" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/block.ex:175

warning: the variable "html_lines" is unsafe as it has been set inside a case/cond/receive/if/&&/||.     Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/block.ex:211

warning: the variable "rest" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/block.ex:212

Generated earmark app
==> cowlib (compile)
Compiled src/cow_cookie.erl
Compiled src/cow_http_te.erl
Compiled src/cow_mimetypes.erl
Compiled src/cow_http_hd.erl
Compiled src/cow_http.erl
Compiled src/cow_qs.erl
Compiled src/cow_date.erl
src/cow_multipart.erl:392: Warning: crypto:rand_bytes/1 is deprecated and will be removed in a future release; use crypto:strong_rand_bytes/1
Compiled src/cow_multipart.erl
Compiled src/cow_spdy.erl
==> cowboy (compile)
Compiled src/cowboy_middleware.erl
Compiled src/cowboy_sub_protocol.erl
Compiled src/cowboy_static.erl
Compiled src/cowboy_clock.erl
Compiled src/cowboy_router.erl
Compiled src/cowboy_http.erl
Compiled src/cowboy_rest.erl
Compiled src/cowboy_app.erl
Compiled src/cowboy.erl
Compiled src/cowboy_sup.erl
Compiled src/cowboy_loop_handler.erl
Compiled src/cowboy_bstr.erl
Compiled src/cowboy_spdy.erl
Compiled src/cowboy_http_handler.erl
Compiled src/cowboy_protocol.erl
Compiled src/cowboy_websocket.erl
Compiled src/cowboy_req.erl
Compiled src/cowboy_websocket_handler.erl
Compiled src/cowboy_handler.erl
==> plug
Compiling 38 files (.ex)
warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
  lib/plug/upload.ex:156

== Compilation error on file lib/plug/conn/unfetched.ex ==
** (ArgumentError) Access is not a protocol
    (elixir) lib/protocol.ex:76: Protocol.assert_protocol!/2
    lib/plug/conn/unfetched.ex:9: (module)
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6

could not compile dependency :plug, "mix compile" failed. You can recompile this dependency with     "mix deps.compile plug", update it with "mix deps.update plug" or clean it with "mix deps.clean plug"
/home/maurice/public_html/blog
maurice@tessy> 

Any idea?

Maurice

pgmcdonnell commented 7 years ago

hey @mszmurlo

I hope you've managed to work around this but if not, or for anyone else experiencing the same issue, you can change the deps in mix.exs to include:

{:yamerl, "~> 0.4.0"}

in place of:

{ :yamerl, github: "yakaz/yamerl"}

It should then compile fine.

Hope that helps.

Patrick

mszmurlo commented 7 years ago

Hi, I'll try it asap. Thanks

Le 3 déc. 2016 13:21, "Patrick G McDonnell" notifications@github.com a écrit :

hey @mszmurlo https://github.com/mszmurlo

I hope you've managed to work around this but if not, or for anyone else experiencing the same issue, you can change the deps in mix.exs to include:

{:yamerl, "~> 0.4.0"}

in place of:

{ :yamerl, github: "yakaz/yamerl"}

It should then compile fine.

Hope that helps.

Patrick

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BennyHallett/obelisk/issues/44#issuecomment-264630671, or mute the thread https://github.com/notifications/unsubscribe-auth/ADHPjJAzrSvOjuhHYNmKVxZdioGMGS5sks5rEULEgaJpZM4Kwexv .

BennyHallett commented 7 years ago

Hey - thanks for the report @mszmurlo , and thanks for the workaround @pgmcdonnell

Sorry for being so slack with Obelisk by the way. I'll be updating it shortly to work with Elixir v1.4.0