philss / rustler_precompiled

Use precompiled NIFs from trusted sources in your Elixir code
181 stars 25 forks source link

`force_build` no longer works on non-precompiled targets since 0.5.3 #38

Closed benhaney closed 1 year ago

benhaney commented 1 year ago

Hello! I recently got this bug report on my project that uses rustler_precompiled: https://github.com/benhaney/Jsonrs/issues/12

Looking into it, I can reproduce the issue with rustler_precompiled 0.5.3, but not with 0.5.2 or earlier. This seems to be caused by the new build_metadata/1 function calling target/2, which always returns an error tuple if the current target isn't on the list of supported targets, bubbling all the way back up to the __using__ macro which then throws before force_build is ever checked.

The easiest way I've found to reproduce this is to remove your current target triple from the list of targets that rustler_precompiled is configured to use, then try to force a build.

philss commented 1 year ago

Hi @benhaney!

Thanks for the report! I'm going to work on this today/tomorrow. This should be an easy fix. Sorry about that :/

philss commented 1 year ago

@benhaney please update rustler_precompiled to version 0.5.4. The issue should be fixed.