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

Fails to compile on Apple Intel with libsodium >=1.0.19 #73

Open
IslandUsurper opened this issue Jul 29, 2024 · 0 comments · May be fixed by #74
Open

Fails to compile on Apple Intel with libsodium >=1.0.19 #73

IslandUsurper opened this issue Jul 29, 2024 · 0 comments · May be fixed by #74

Comments

@IslandUsurper
Copy link

I had run into this error before, but ended up not worrying about it because I was using Nix to provide libsodium. Since my colleague is using Homebrew, and it doesn't provide older versions, this is going to become more of a problem.

enacl doesn't compile on MacOS (x86_64) when libsodium is above version 1.0.18. Both 1.0.19 and 1.0.20 don't work any more. Interestingly, the same Nix expression does allow enacl to compile on Linux, regardless of libsodium's version.

❯ mix deps.compile enacl
===> Fetching pc v1.13.0
===> Analyzing applications...
===> Compiling pc
===> Compiling c_src/aead.c
===> Compiling c_src/enacl.c
===> Compiling c_src/enacl_ext.c
===> Compiling /--redacted--/deps/enacl/c_src/enacl_nif.c
===> /--redacted--/deps/enacl/c_src/enacl_nif.c:435:83: error: incompatible function pointer types initializing 'void (*)(ErlNifEnv *, void *)' (aka 'void (*)(struct enif_environment_t *, void *)') with an expression of type 'int (ErlNifEnv *, void **, ERL_NIF_TERM)' (aka 'int (struct enif_environment_t *, void **, unsigned long)') [-Wincompatible-function-pointer-types]
ERL_NIF_INIT(enacl_nif, nif_funcs, enacl_crypto_load, NULL, enacl_crypto_upgrade, enacl_crypto_unload);
                                                                                  ^~~~~~~~~~~~~~~~~~~
/nix/store/m7zydgpnsqiqnzf8sbbrhqcvxicbm396-erlang-25.3.2.10/lib/erlang/erts-13.2.2.7/include/erl_nif.h:422:25: note: expanded from macro 'ERL_NIF_INIT'
        LOAD, RELOAD, UPGRADE, UNLOAD,  \
                               ^~~~~~
1 error generated.

I see the existing issues and PRs about Apple silicon, but I have none available to test with.

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

Successfully merging a pull request may close this issue.

1 participant