elixir-sqlite / exqlite

An SQLite3 driver for Elixir
https://hexdocs.pm/exqlite
MIT License
198 stars 46 forks source link

Error happened while installing exqlite from precompiled binary message #243

Closed axelson closed 2 months ago

axelson commented 1 year ago

I recently update exqlite and now when I run mix compile I see the following error printed in red text:

Error happened while installing exqlite from precompiled binary: cannot find download url for current target "x86_64-linux-musl". Available targets are: [{"x86_64-windows-msvc", "2.16"}, {"x86_64-linux-gnu", "2.16"}, {"x86_64-linux-gnu", "2.15"}, {"s390x-linux-gnu", "2.16"}, {"s390x-linux-gnu", "2.15"}, {"riscv64-linux-gnu", "2.16"}, {"riscv64-linux-gnu", "2.15"}, {"powerpc64le-linux-gnu", "2.16"}, {"powerpc64le-linux-gnu", "2.15"}, {"i686-linux-gnu", "2.16"}, {"i686-linux-gnu", "2.15"}, {"armv7l-linux-gnueabihf", "2.16"}, {"armv7l-linux-gnueabihf", "2.15"}, {"aarch64-linux-gnu", "2.16"}, {"aarch64-linux-gnu", "2.15"}, {"x86_64-apple-darwin", "2.16"}, {"x86_64-apple-darwin", "2.15"}, {"aarch64-apple-darwin", "2.16"}, {"aarch64-apple-darwin", "2.15"}].

Attempting to compile exqlite from source...

If I'm understanding correctly this is more or less expected since exqlite won't be compiled for every system/platform (although I'm slightly surprised because I'm currently on Linux mint which I wouldn't expect to be too exotic).

My suggestion is to "downgrade" this from an error to a warning and change the default text color from red to yellow.

Something like:

Warning: Unable to install exqlite from precompiled binary: cannot find...

warmwaffles commented 1 year ago

To not use the precompiled binaries, throw this into your config

config :exqlite, make_force_build: true

https://github.com/elixir-sqlite/exqlite#compile-time-configuration

warmwaffles commented 1 year ago

@axelson I'll look into what it is going to take to compile for a musl based distribution.

warmwaffles commented 1 year ago

@cocoa-xu have you had anyone ask for musl precompiled binary support before?

cocoa-xu commented 1 year ago

@warmwaffles Yeah, it's customizable in cc_precompiler, and I just updated it to v0.1.7 with a :include_default_ones key, which makes it much easier to just add some more targets or override some default ones.

I'll send a PR!

warmwaffles commented 1 year ago

@axelson we have precompiled binaries for musl now under v0.3.17

axelson commented 1 year ago

That's great, thanks!

What do you think about the idea of considering it only a warnings instead of an error when there are no precompiled binaries available for the current system?

warmwaffles commented 1 year ago

cc @cocoa-xu

warmwaffles commented 1 year ago

I do believe it should warn and just fallback to building it from source. Or even not say anything at all and just build from source.

cocoa-xu commented 1 year ago

I do believe it should warn and just fallback to building it from source. Or even not say anything at all and just build from source.

Yeah, I agree. Just submitted a PR to elixir_make.

josevalim commented 2 months ago

I believe this can be closed now. :)

warmwaffles commented 2 months ago

It certainly can be.