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

FORCE_JSONRS_BUILD doesn't seem to work #12

Closed
cjbottaro opened this issue Nov 4, 2022 · 4 comments
Closed

FORCE_JSONRS_BUILD doesn't seem to work #12

cjbottaro opened this issue Nov 4, 2022 · 4 comments

Comments

@cjbottaro
Copy link

Hello.

$ FORCE_JSONRS_BUILD=true mix deps.compile jsonrs
==> jsonrs
Compiling 2 files (.ex)

== Compilation error in file lib/jsonrs.ex ==
** (RuntimeError) precompiled NIF is not available for this target: "aarch64-unknown-linux-musl".
The available targets are:
 - aarch64-apple-darwin
 - x86_64-apple-darwin
 - x86_64-unknown-linux-gnu
 - x86_64-unknown-linux-musl
 - arm-unknown-linux-gnueabihf
 - aarch64-unknown-linux-gnu
 - x86_64-pc-windows-msvc
 - x86_64-pc-windows-gnu
    lib/jsonrs.ex:8: (module)
    (elixir 1.14.0) lib/kernel/parallel_compiler.ex:346: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/7
could not compile dependency :jsonrs, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile jsonrs", update it with "mix deps.update jsonrs" or clean it with "mix deps.clean jsonrs"

Also how do I go about requesting aarch64-unknown-linux-musl target? I'm running in an Alpine 3 container on a Mac M1 host.

Thank you.

@benhaney
Copy link
Owner

benhaney commented Nov 5, 2022

Hey, this seems to be a bug introduced in the latest version of rustler_precompiled. You can explicitly set your rustler_precompiled version to 0.5.2 in your deps to downgrade it and that should work around it for now. I'll open an issue in the rustler_precompiled repo about it.

how do I go about requesting aarch64-unknown-linux-musl target?

I see an open PR in rustler_precompiled about adding this. I think the main issue is what's supported by cross, which currently doesn't have a release that supports aarch64-unknown-linux-musl, but does support it when built from bleeding edge source. I've seen an example somewhere of a workflow that installs cross from source for the one runner that builds the aarch64-unknown-linux-musl release, so that might be an option worth looking into if it's going to be a while before cross cuts a new release

@adriankumpf
Copy link

I see an open PR in rustler_precompiled about adding this. I think the main issue is what's supported by cross, which currently doesn't have a release that supports aarch64-unknown-linux-musl, but does support it when built from bleeding edge source. I've seen an example somewhere of a workflow that installs cross from source for the one runner that builds the aarch64-unknown-linux-musl release, so that might be an option worth looking into if it's going to be a while before cross cuts a new release

Using cross v0.2.4 should do the trick. Here's an example workflow which build a release for aarch64-unknown-linux-musl among others: https://github.com/kloeckner-i/mail_parser/blob/main/.github/workflows/release.yml

@benhaney
Copy link
Owner

benhaney commented Nov 6, 2022

@adriankumpf Thanks! I didn't know cross 0.2.4 supported aarch64-unknown-linux-musl already.

@cjbottaro I just cut a Jsonrs release that updates the rustler_precompiled dep to the latest version that includes a bugfix for the issue you were seeing, and am now shipping precompiled binaries for aarch64-unknown-linux-musl. Let me know how it works for you.

@benhaney benhaney closed this as completed Nov 6, 2022
@cjbottaro
Copy link
Author

@benhaney Yes, that worked, thank you very much. And it's about 2.5x faster than Jason for parsing 200 mb worth of JSON, nice!

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

3 participants