Explorer - dev on x86 but prod on arm

Hello!

I’m having problems with a compiled application in x86 and deploying it in arm arch. The thing is because Explorer lib but i don’t know how can I still dev in x86 and using arm for prod.

I used this as doc says

Explorer will download a precompiled version of its native code upon installation. You can force a local build by setting the environment variable EXPLORER_BUILD=1 and including :rustler as a dependency:

  {:explorer, "~> 0.8.0", system_env: %{"EXPLORER_BUILD" => "1"}},
  {:rustler, ">= 0.0.0"}

If necessary, clean up before rebuilding with mix deps.clean explorer.

but no success… other languages is just about setting an env var, Is there something similar?

Thanks

Details about what specifically fails would be helpful.

What specifically are you doing to deploy to production? Some mechanisms don’t like to build across architectures as much as others.

Details about what specifically fails would be helpful.

I get this error msg because arm doesnt have libexplorer-v0.8.2-nif-2.15-x86_64-unknown-linux-gnu.so

=CRASH REPORT==== 28-May-2024::10:53:18.378218 ===
  crasher:
    initial call: kernel:init/1
    pid: <0.2611.0>
    registered_name: []
    exception exit: {on_load_function_failed,
                        'Elixir.Explorer.PolarsBackend.Native',
                        {error,
                            {load_failed,
                                "Failed to load NIF library: '/home/ubuntu/stats/lib/explorer-0.8.2/priv/native/libexplorer-v0.8.2-nif-2.15-x86_64-unknown-linux-gnu.so: cannot open shared object file: No such file or directory'"}}}
      in function  init:run_on_load_handlers/0 
      in call from kernel:init/1 (kernel.erl, line 227)
    ancestors: [kernel_sup,<0.2604.0>]
    message_queue_len: 0
    messages: []
    links: [<0.2606.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 610
    stack_size: 28
    reductions: 182
  neighbours:

=SUPERVISOR REPORT==== 28-May-2024::10:53:18.378372 ===
    supervisor: {local,kernel_sup}
    errorContext: start_error
    reason: {on_load_function_failed,'Elixir.Explorer.PolarsBackend.Native',
                {error,
                    {load_failed,
                        "Failed to load NIF library: '/home/ubuntu/stats/lib/explorer-0.8.2/priv/native/libexplorer-v0.8.2-nif-2.15-x86_64-unknown-linux-gnu.so: cannot open shared object file: No such file or directory'"}}}
    offender: [{pid,undefined},
               {id,on_load},
               {mfargs,{proc_lib,start_link,[kernel,init,[on_load]]}},
               {restart_type,transient},
               {significant,false},
               {shutdown,2000},
               {child_type,worker}]

What specifically are you doing to deploy to production? Some mechanisms don’t like to build across architectures as much as others.

what i do to deploy is just a release
mix release ${NAME} --version ${VERSION} --overwrite --force

Tried several things… nothing worked. I’m building the release on prod