From 896c887f2918aa59dc106828a6a47de76ae28716 Mon Sep 17 00:00:00 2001 From: Evan O'Brien Date: Sun, 7 Jun 2026 22:36:19 +0100 Subject: [PATCH 1/4] Prepare Explorer 0.13.0 release artifacts Co-authored-by: Cursor --- .github/workflows/release.yml | 11 --------- README.md | 22 +---------------- lib/explorer/polars_backend/native.ex | 34 --------------------------- mix.exs | 4 ++-- 4 files changed, 3 insertions(+), 68 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1476fa1c6..f6f2a64c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,18 +36,7 @@ jobs: # https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/... # choose-the-runner-for-a-job#standard-github-hosted-runners-for-public-repositories - { target: aarch64-apple-darwin, os: macos-15 } - - { target: aarch64-unknown-linux-gnu, os: ubuntu-22.04, use-cross: true } - - { target: aarch64-unknown-linux-musl, os: ubuntu-22.04, use-cross: true } - - { target: x86_64-apple-darwin, os: macos-15 } - - { target: x86_64-pc-windows-gnu, os: windows-2025, rustflags: "-C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma" } - - { target: x86_64-pc-windows-gnu, os: windows-2025, variant: "legacy_cpu" } - - { target: x86_64-pc-windows-msvc, os: windows-2025, rustflags: "-C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma" } - - { target: x86_64-pc-windows-msvc, os: windows-2025, variant: "legacy_cpu" } - - { target: x86_64-unknown-freebsd, os: ubuntu-22.04, use-cross: true, rustflags: "-C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma" } - - { target: x86_64-unknown-freebsd, os: ubuntu-22.04, use-cross: true, variant: "legacy_cpu" } - { target: x86_64-unknown-linux-gnu, os: ubuntu-22.04, rustflags: "-C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma" } - - { target: x86_64-unknown-linux-gnu, os: ubuntu-22.04, variant: "legacy_cpu" } - - { target: x86_64-unknown-linux-musl, os: ubuntu-22.04, use-cross: true } steps: - name: Checkout source code diff --git a/README.md b/README.md index df97aa112..c7d43c724 100644 --- a/README.md +++ b/README.md @@ -264,37 +264,17 @@ mix test --only cloud_integration ## Precompilation -Explorer ships with the NIF code precompiled for the most popular architectures out there. +Explorer ships with the NIF code precompiled for the supported production and development targets. We support the following: - `aarch64-apple-darwin` - MacOS running on ARM 64 bits CPUs. -- `aarch64-unknown-linux-gnu` - Linux running on ARM 64 bits CPUs, compiled with GCC. -- `aarch64-unknown-linux-musl` - Linux running on ARM 64 bits CPUs, compiled with Musl. -- `x86_64-apple-darwin` - MacOS running on Intel/AMD 64 bits CPUs. -- `x86_64-pc-windows-msvc` - Windows running on Intel/AMD 64 bits CPUs, compiled with Visual C++. -- `x86_64-pc-windows-gnu` - Windows running on Intel/AMD 64 bits CPUs, compiled with GCC. - `x86_64-unknown-linux-gnu` - Linux running on Intel/AMD 64 bits CPUs, compiled with GCC. -- `x86_64-unknown-linux-musl` - Linux running on Intel/AMD 64 bits CPUs, compiled with Musl. -- `x86_64-unknown-freebsd` - FreeBSD running on Intel/AMD 64 bits. This means that Explorer is going to work without the need to compile it from source. This currently **only works for Hex releases**. For more information on how it works, please check the [RustlerPrecompiled project](https://hexdocs.pm/rustler_precompiled). -### Legacy CPUs - -We ship some of the precompiled artifacts with modern CPU features enabled by default. But in -case your computer is not compatible with them, you can set an application environment that is -going to be read at compile time, enabling the legacy variants of artifacts. - -```elixir -config :explorer, use_legacy_artifacts: true -``` - -If you see the error message "Illegal instruction" after your project compiles, you need to -enable the legacy artifacts. - ### Features disabled Some of the features cannot be compiled to some targets, because one of the dependencies diff --git a/lib/explorer/polars_backend/native.ex b/lib/explorer/polars_backend/native.ex index 1118c278c..d38cc5b17 100644 --- a/lib/explorer/polars_backend/native.ex +++ b/lib/explorer/polars_backend/native.ex @@ -8,48 +8,14 @@ defmodule Explorer.PolarsBackend.Native do # We want "debug" in dev and test because it's faster to compile. mode = if Mix.env() in [:dev, :test], do: :debug, else: :release - use_legacy = - Application.compile_env( - :explorer, - :use_legacy_artifacts, - System.get_env("EXPLORER_USE_LEGACY_ARTIFACTS") in ["true", "1"] - ) - - variants_for_linux = [ - legacy_cpu: fn -> - # These are the same from the release workflow. - # See the meaning in: https://unix.stackexchange.com/a/43540 - needed_caps = ~w[fxsr sse sse2 ssse3 sse4_1 sse4_2 popcnt avx fma] - - use_legacy or - (is_nil(use_legacy) and - not Explorer.ComptimeUtils.cpu_with_all_caps?(needed_caps)) - end - ] - - other_variants = [legacy_cpu: fn -> use_legacy end] - use RustlerPrecompiled, otp_app: :explorer, version: version, base_url: "#{github_url}/releases/download/v#{version}", targets: ~w( aarch64-apple-darwin - aarch64-unknown-linux-gnu - aarch64-unknown-linux-musl - x86_64-apple-darwin - x86_64-pc-windows-msvc - x86_64-pc-windows-gnu x86_64-unknown-linux-gnu - x86_64-unknown-linux-musl - x86_64-unknown-freebsd ), - variants: %{ - "x86_64-unknown-linux-gnu" => variants_for_linux, - "x86_64-pc-windows-msvc" => other_variants, - "x86_64-pc-windows-gnu" => other_variants, - "x86_64-unknown-freebsd" => other_variants - }, # We don't use any features of newer NIF versions, so 2.15 is enough. nif_versions: ["2.15"], mode: mode, diff --git a/mix.exs b/mix.exs index 48e93229c..6167914ba 100644 --- a/mix.exs +++ b/mix.exs @@ -1,8 +1,8 @@ defmodule Explorer.MixProject do use Mix.Project - @source_url "https://github.com/elixir-nx/explorer" - @version "0.12.0-dev" + @source_url "https://github.com/liveflow-io/explorer" + @version "0.13.0" @dev? String.ends_with?(@version, "-dev") @force_build? System.get_env("EXPLORER_BUILD") in ["1", "true"] From a75cefc33caa1030465c94d20ef99025afd1d958 Mon Sep 17 00:00:00 2001 From: Evan O'Brien Date: Tue, 9 Jun 2026 14:15:16 +0100 Subject: [PATCH 2/4] Add checksum --- checksum-Elixir.Explorer.PolarsBackend.Native.exs | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 checksum-Elixir.Explorer.PolarsBackend.Native.exs diff --git a/checksum-Elixir.Explorer.PolarsBackend.Native.exs b/checksum-Elixir.Explorer.PolarsBackend.Native.exs new file mode 100644 index 000000000..2f5c8dfed --- /dev/null +++ b/checksum-Elixir.Explorer.PolarsBackend.Native.exs @@ -0,0 +1,4 @@ +%{ + "libexplorer-v0.12.0-nif-2.15-aarch64-apple-darwin.so.tar.gz" => "sha256:6003bdadd77aabda0c987c37a602597152087047a5f98665c7a919655c607c54", + "libexplorer-v0.12.0-nif-2.15-x86_64-unknown-linux-gnu.so.tar.gz" => "sha256:11242e92e412f07710a1db300e7cf57909ff2564c291cc5e00da5d5544fbd64a", +} From 0ab1ba7ccdaf04625c569be1acbf3bb52b14d975 Mon Sep 17 00:00:00 2001 From: Evan O'Brien Date: Sat, 11 Jul 2026 15:52:09 +0100 Subject: [PATCH 3/4] Update checksum for 0.13.0 artifacts Co-authored-by: Cursor --- checksum-Elixir.Explorer.PolarsBackend.Native.exs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/checksum-Elixir.Explorer.PolarsBackend.Native.exs b/checksum-Elixir.Explorer.PolarsBackend.Native.exs index 2f5c8dfed..483113dc0 100644 --- a/checksum-Elixir.Explorer.PolarsBackend.Native.exs +++ b/checksum-Elixir.Explorer.PolarsBackend.Native.exs @@ -1,4 +1,6 @@ %{ - "libexplorer-v0.12.0-nif-2.15-aarch64-apple-darwin.so.tar.gz" => "sha256:6003bdadd77aabda0c987c37a602597152087047a5f98665c7a919655c607c54", - "libexplorer-v0.12.0-nif-2.15-x86_64-unknown-linux-gnu.so.tar.gz" => "sha256:11242e92e412f07710a1db300e7cf57909ff2564c291cc5e00da5d5544fbd64a", + "libexplorer-v0.13.0-nif-2.15-aarch64-apple-darwin.so.tar.gz" => + "sha256:8f4fd5e4137bdf974a977f54889e76da5bc461629675405969e3046170b121bb", + "libexplorer-v0.13.0-nif-2.15-x86_64-unknown-linux-gnu.so.tar.gz" => + "sha256:57acecd87aa66f7bd5bfacf355763db69f45f25cc15dd71680437b2d7fb4931a" } From 5435307cb3cb153dc9459c56c975ceaa955dd664 Mon Sep 17 00:00:00 2001 From: Evan O'Brien Date: Sat, 11 Jul 2026 16:38:34 +0100 Subject: [PATCH 4/4] Use final 0.13.0 release checksums Co-authored-by: Cursor --- checksum-Elixir.Explorer.PolarsBackend.Native.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checksum-Elixir.Explorer.PolarsBackend.Native.exs b/checksum-Elixir.Explorer.PolarsBackend.Native.exs index 483113dc0..8bdf7c95d 100644 --- a/checksum-Elixir.Explorer.PolarsBackend.Native.exs +++ b/checksum-Elixir.Explorer.PolarsBackend.Native.exs @@ -1,6 +1,6 @@ %{ "libexplorer-v0.13.0-nif-2.15-aarch64-apple-darwin.so.tar.gz" => - "sha256:8f4fd5e4137bdf974a977f54889e76da5bc461629675405969e3046170b121bb", + "sha256:3e565666bd519a58dcdd715714e555cc14101883ebdde4e3e1292adfd03723d9", "libexplorer-v0.13.0-nif-2.15-x86_64-unknown-linux-gnu.so.tar.gz" => - "sha256:57acecd87aa66f7bd5bfacf355763db69f45f25cc15dd71680437b2d7fb4931a" + "sha256:20c192064ea27db483f7e21affa322f503526e5091d30f4e471153682610bb9d" }