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

Could not compile dependency :exqlite #272

Closed
aukuste opened this issue Dec 18, 2023 · 9 comments
Closed

Could not compile dependency :exqlite #272

aukuste opened this issue Dec 18, 2023 · 9 comments

Comments

@aukuste
Copy link

aukuste commented Dec 18, 2023

I seem to have an issue with getting exqlite compiled.

I updated my dependencies recently for a project, where one of them is ecto_sqlite3.

When trying to compile the project, the compilation fails when trying to compile exqlite:

==> exqlite
Downloading precompiled NIF to /home/user/.cache/exqlite-nif-2.17-x86_64-linux-gnu-0.17.0.tar.gz
could not compile dependency :exqlite, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile exqlite --force", update it with "mix deps.update exqlite" or clean it with "mix deps.clean exqlite"
** (ArgumentError) unknown application: :certifi
    (elixir 1.15.7) lib/application.ex:1010: Application.app_dir/1
    (elixir 1.15.7) lib/application.ex:1037: Application.app_dir/2
    (elixir_make 0.7.7) lib/elixir_make/artefact.ex:267: ElixirMake.Artefact.cacerts_options/0
    (elixir_make 0.7.7) lib/elixir_make/artefact.ex:244: ElixirMake.Artefact.download/1
    (elixir_make 0.7.7) lib/mix/tasks/compile.elixir_make.ex:222: Mix.Tasks.Compile.ElixirMake.download_or_reuse_nif/3
    (elixir_make 0.7.7) lib/mix/tasks/compile.elixir_make.ex:160: Mix.Tasks.Compile.ElixirMake.run/1
    (mix 1.15.7) lib/mix/task.ex:455: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.15.7) lib/mix/tasks/compile.all.ex:124: Mix.Tasks.Compile.All.run_compiler/2

Exqlite is version 0.17.0.

Some system info:
I'm running Fedora Linux 38
Erlang version: Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns]
Elixir version: Elixir 1.15.7 (compiled with Erlang/OTP 26)

Any ideas on why this is happening?

@warmwaffles
Copy link
Member

@aukuste
Copy link
Author

aukuste commented Dec 19, 2023

It seems like it's the download of exqlite-nif-2.17-x86_64-linux-gnu-0.17.0.tar.gz that just fails immediately. If I manually download that file from the github releases and place it in ~/.cache, exqlite compiles without any issues.

@warmwaffles
Copy link
Member

@cocoa-xu I'm not well versed in the precompile logic, do you think you can lend a hand here?

@cocoa-xu
Copy link
Contributor

@aukuste That's kinda strange... and I cannot reproduce it in my Linux machine (which runs Ubuntu 20.04). Maybe I'll try to find a Fedora machine and try it tomorrow. And could you please let me know the exact version of Erlang installed on your computer? I was using 26.0.2 in my setup.

$ erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().' -noshell
26.0.2

@aukuste
Copy link
Author

aukuste commented Dec 19, 2023

@cocoa-xu 26.2.1

@aukuste
Copy link
Author

aukuste commented Dec 19, 2023

If I create a new project and add ecto_sqlite3 and ecto_sql to it, it works without problem, but if I then remove ~/.cache/exqlite-nif-2.17-x86_64-linux-gnu-0.17.0.tar.gz and add {:timex, "~> 3.7"} to the deps in mix.exs, run mix deps.get, and the mix compile, then I can reproduce the problem consistently.

@ollien
Copy link

ollien commented Jan 16, 2024

I'm seeing this exact same failure signature using the official elixir:1.16.0 docker image.

@josevalim
Copy link

Fixed in elixir_make. Thanks @cocoa-xu for the report and initial fix.

@warmwaffles
Copy link
Member

Awesome, thank you @cocoa-xu and @josevalim

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

5 participants