philss / rustler_precompiled

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

fix: variants lib name on download (attempt 1 quick workaround) #62

Closed grzuy closed 8 months ago

grzuy commented 9 months ago

Hi there! :wave:

Facing the following issue:

$ mix rustler_precompiled.download Candlex.Native --all --print

16:44:50.287 [debug] Downloading NIF from https://github.com/mimiquate/candlex/releases/download/v0.1.3-alpha1/libcandlex-v0.1.3-alpha1-nif-2.16-aarch64-apple-darwin.so.tar.gz

16:44:53.658 [debug] Downloading NIF from https://github.com/mimiquate/candlex/releases/download/v0.1.3-alpha1/libcandlex-v0.1.3-alpha1-nif-2.16-aarch64-unknown-linux-gnu.so.tar.gz

16:44:55.615 [debug] Downloading NIF from https://github.com/mimiquate/candlex/releases/download/v0.1.3-alpha1/libcandlex-v0.1.3-alpha1-nif-2.16-x86_64-apple-darwin.so.tar.gz

16:44:57.307 [debug] Downloading NIF from https://github.com/mimiquate/candlex/releases/download/v0.1.3-alpha1/libcandlex-v0.1.3-alpha1-nif-2.16-x86_64-unknown-linux-gnu.so.tar.gz

16:44:59.133 [debug] Downloading NIF from https://github.com/mimiquate/candlex/releases/download/v0.1.3-alpha1/libcandlex-v0--cuda.so.tar.gz

16:45:00.637 [info] Attempt 1 failed with {:error, "couldn't fetch NIF from https://github.com/mimiquate/candlex/releases/download/v0.1.3-alpha1/libcandlex-v0--cuda.so.tar.gz: {:ok, {{~c\"HTTP/1.1\", 404, ~c\"Not Found\"}, [{~c\"cache-control\", ~c\"no-cache\"}, {~c\"date\", ~c\"Fri, 03 Nov 2023 19:43:33 GMT\"}, {~c\"server\", ~c\"GitHub.com\"}, {~c\"vary\", ~c\"X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With\"}, {~c\"content-length\", ~c\"9\"}, {~c\"content-type\", ~c\"text/plain; charset=utf-8\"}, {~c\"strict-transport-security\", ~c\"max-age=31536000; includeSubdomains; preload\"}, {~c\"x-frame-options\", ~c\"deny\"}, {~c\"x-content-type-options\", ~c\"nosniff\"}, {~c\"x-xss-protection\", ~c\"0\"}, {~c\"referrer-policy\", ~c\"no-referrer-when-downgrade\"}, {~c\"content-security-policy\", ~c\"default-src 'none'; base-uri 'self'; connect-src 'self'; form-action 'self'; img-src 'self' data:; script-src 'self'; style-src 'unsafe-inline'\"}, {~c\"x-github-request-id\", ~c\"5BAE:1D444:182656:19C3F7:65454D84\"}], \"Not Found\"}}"}

With this fix

$ mix rustler_precompiled.download Candlex.Native --all --print
==> rustler_precompiled
Compiling 4 files (.ex)
Generated rustler_precompiled app

17:36:29.352 [debug] Downloading NIF from https://github.com/mimiquate/candlex/releases/download/v0.1.3-alpha1/libcandlex-v0.1.3-alpha1-nif-2.16-aarch64-apple-darwin.so.tar.gz

17:36:32.845 [debug] Downloading NIF from https://github.com/mimiquate/candlex/releases/download/v0.1.3-alpha1/libcandlex-v0.1.3-alpha1-nif-2.16-aarch64-unknown-linux-gnu.so.tar.gz

17:36:34.992 [debug] Downloading NIF from https://github.com/mimiquate/candlex/releases/download/v0.1.3-alpha1/libcandlex-v0.1.3-alpha1-nif-2.16-x86_64-apple-darwin.so.tar.gz

17:36:37.011 [debug] Downloading NIF from https://github.com/mimiquate/candlex/releases/download/v0.1.3-alpha1/libcandlex-v0.1.3-alpha1-nif-2.16-x86_64-unknown-linux-gnu.so.tar.gz

17:36:39.058 [debug] Downloading NIF from https://github.com/mimiquate/candlex/releases/download/v0.1.3-alpha1/libcandlex-v0.1.3-alpha1-nif-2.16-x86_64-unknown-linux-gnu--cuda.so.tar.gz

...

A bit ugly fix implementation, on a hurry now, but helps show what's causing the problem I guess. Plan to revisit in the coming days and try come up more clean fix.

grzuy commented 8 months ago

Superseded by #63