Skip to content

Does not compile on Elixir 1.20.x without comeonin. #71

Description

@jimsynz

Hi there! 👋

We use argon2_elixir to provide password hashing in ash_authentication. It used to work fine without comeoninas a dependency, but now won't compile because it cannot infer types:

==> argon2_elixir
mkdir -p /Users/jmshrtn/Dev/github.com/REDACTED_CLIENT/redacted_app/_build/dev/lib/argon2_elixir/priv
cc -g -O3 -pthread -Wall -I"/Users/jmshrtn/.asdf/installs/erlang/29.0.2/erts-17.0.2/include" -Iargon2/include -Iargon2/src -Ic_src -dynamiclib -undefined dynamic_lookup  argon2/src/argon2.c argon2/src/core.c argon2/src/blake2/blake2b.c argon2/src/thread.c argon2/src/encoding.c argon2/src/ref.c c_src/argon2_nif.c -o /Users/jmshrtn/Dev/github.com/REDACTED_CLIENT/redacted_app/_build/dev/lib/argon2_elixir/priv/argon2_nif.so
Compiling 3 files (.ex)
warning: cannot infer signatures from :comeonin because it is not loaded

    error: module Comeonin is not loaded and could not be found
    │
 43 │   use Comeonin
    │   ^^^^^^^^^^^^
    │
    └─ lib/argon2.ex:43: Argon2 (module)


== Compilation error in file lib/argon2.ex ==
** (CompileError) lib/argon2.ex: cannot compile module Argon2 (errors have been logged)
    (elixir 1.20.1) expanding macro: Kernel.use/1
    lib/argon2.ex:43: Argon2 (module)
could not compile dependency :argon2_elixir, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile argon2_elixir --force", update it with "mix deps.update argon2_elixir" or clean it with "mix deps.clean argon2_elixir"

It looks like Comeonin.__using__/2 is not adding a whole lot of value - would you be open to a PR which guards the use statement with a Code.loaded?(Comeonin)?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions