Cannot install explorer/nx - could not compile `arrow2` due to 17 previous errors

Hi, I cannot run “iex -S mix” with nx/explorer.
In mix.exs i have

defp deps do
    [
      {:explorer, "~> 0.1.0-dev", github: "elixir-nx/explorer", branch: "main"}
    ]
end

But got error :

error: could not compile `arrow2` due to 17 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed

== Compilation error in file lib/explorer/polars_backend/native.ex ==
** (RuntimeError) Rust NIF compile error (rustc exit code 101)
    (rustler 0.24.0) lib/rustler/compiler.ex:40: Rustler.Compiler.compile_crate/2
    lib/explorer/polars_backend/native.ex:8: (module)

I’ve got : Elixir 1.13.0 (compiled with Erlang/OTP 24) , and rustc 1.57.0

Thanks for help in advance

1 Like

Hi there! I think I’d need to see the previous errors to work out what’s going on. What kind of system are you on (OS and architecture)?

2 Likes

HI, OS and architecture:

Linux Mint 20.1 Ulyssa (Ubuntu Focal) , x86_64 GNU/Linux

 iex -S mix
Erlang/OTP 24 [erts-12.1.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]

==> explorer
Compiling 14 files (.ex)
Compiling crate explorer in release mode (native/explorer)
   Compiling libc v0.2.97
   Compiling autocfg v1.0.1
   Compiling proc-macro2 v1.0.27
   Compiling unicode-xid v0.2.2
   ........
   ........
   Compiling zstd v0.10.0+zstd.1.5.2
   Compiling parquet2 v0.10.3
   Compiling arrow2 v0.10.0
error: there is no argument named `child_data_type`
  --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/fixed_size_list/mod.rs:48:110
   |
48 | ...   format!("FixedSizeListArray's child's DataType must match. However, the expected DataType is {child_data_type:?} while it got {valu...
   |                                                                                                    ^^^^^^^^^^^^^^^^^^^

error: there is no argument named `values_data_type`
  --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/fixed_size_list/mod.rs:48:143
   |
48 | ...he expected DataType is {child_data_type:?} while it got {values_data_type:?}."),
   |                                                             ^^^^^^^^^^^^^^^^^^^^

error: there is no argument named `child_data_type`
  --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/list/mod.rs:65:101
   |
65 | ...   format!("ListArray's child's DataType must match. However, the expected DataType is {child_data_type:?} while it got {values_data_t...
   |                                                                                           ^^^^^^^^^^^^^^^^^^^

error: there is no argument named `values_data_type`
  --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/list/mod.rs:65:134
   |
65 | ...he expected DataType is {child_data_type:?} while it got {values_data_type:?}."),
   |                                                             ^^^^^^^^^^^^^^^^^^^^

error: there is no argument named `child_data_type`
   --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/list/mod.rs:162:101
    |
162 | ...   format!("ListArray's child's DataType must match. However, the expected DataType is {child_data_type:?} while it got {values_data_t...
    |                                                                                           ^^^^^^^^^^^^^^^^^^^

error: there is no argument named `values_data_type`
   --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/list/mod.rs:162:134
    |
162 | ...he expected DataType is {child_data_type:?} while it got {values_data_type:?}."),
    |                                                             ^^^^^^^^^^^^^^^^^^^^

error: there is no argument named `index`
  --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/struct_/mod.rs:74:45
   |
74 |                          However, the field {index} has data type {data_type:?} but the value has data type {child:?}"
   |                                             ^^^^^^^

error: there is no argument named `data_type`
  --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/struct_/mod.rs:74:67
   |
74 |                          However, the field {index} has data type {data_type:?} but the value has data type {child:?}"
   |                                                                   ^^^^^^^^^^^^^

error: there is no argument named `child`
  --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/struct_/mod.rs:74:109
   |
74 |                          However, the field {index} has data type {data_type:?} but the value has data type {child:?}"
   |                                                                                                             ^^^^^^^^^

error: there is no argument named `index`
  --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/struct_/mod.rs:90:46
   |
90 |                          However, the values {index} has a length of {a_len}, which is different from values 0, {len}."
   |                                              ^^^^^^^

error: there is no argument named `a_len`
  --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/struct_/mod.rs:90:70
   |
90 |                          However, the values {index} has a length of {a_len}, which is different from values 0, {len}."
   |                                                                      ^^^^^^^

error: there is no argument named `len`
  --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/struct_/mod.rs:90:113
   |
90 |                          However, the values {index} has a length of {a_len}, which is different from values 0, {len}."
   |                                                                                                                 ^^^^^

error: there is no argument named `index`
  --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/union/mod.rs:70:45
   |
70 |                          However, the field {index} has data type {data_type:?} but the value has data type {child:?}"
   |                                             ^^^^^^^

error: there is no argument named `data_type`
  --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/union/mod.rs:70:67
   |
70 |                          However, the field {index} has data type {data_type:?} but the value has data type {child:?}"
   |                                                                   ^^^^^^^^^^^^^

error: there is no argument named `child`
  --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/array/union/mod.rs:70:109
   |
70 |                          However, the field {index} has data type {data_type:?} but the value has data type {child:?}"
   |                                                                                                             ^^^^^^^^^

error: there is no argument named `item_dt`
   --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/ffi/stream.rs:149:103
    |
149 | ...   private.error = Some(CString::new(format!("The iterator produced an item of data type {item_dt:?} but the producer expects data typ...
    |                                                                                             ^^^^^^^^^^^

error: there is no argument named `expected_dt`
   --> /home/tomthestorm/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow2-0.10.0/src/ffi/stream.rs:149:150
    |
149 | ...f data type {item_dt:?} but the producer expects data type {expected_dt:?}").as_bytes().to_vec()).unwrap());
    |                                                               ^^^^^^^^^^^^^^^

error: could not compile `arrow2` due to 17 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed

== Compilation error in file lib/explorer/polars_backend/native.ex ==
** (RuntimeError) Rust NIF compile error (rustc exit code 101)
    (rustler 0.24.0) lib/rustler/compiler.ex:40: Rustler.Compiler.compile_crate/2
    lib/explorer/polars_backend/native.ex:8: (module)
could not compile dependency :explorer, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile explorer", update it with "mix deps.update explorer" or clean it with "mix deps.clean explorer"

Hi,
is it possible use explorer precompiled files like is written in :

Regards .

I’m not sure what the problem is. Are you on stable or nightly? Very strange! You’ll be able to use precompiled Explorer once we cut a hex release, which we’re working towards now. It might be a couple weeks.

Hi, problem solved.
Maybe it helps someone
I’ve uninstalled rust ver. 1.57

sudo apt remove cargo
sudo apt autoremove

and i’ve installed it locally (in home directory) using rustup:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

and now it works, no errors.

2 Likes