Skip to content

Commit

Permalink
Update Rust nightly to 2023-11-12 (#734)
Browse files Browse the repository at this point in the history
* Update Rust Nightly to 2023-11-12

It's an attempt to solve the high memory usage.

* Enable riscv target for releases again

* Fix linter issues

* Disable riscv target again

Cross is not working for that target, so we should revisit it later.
  • Loading branch information
philss authored Nov 14, 2023
1 parent a2495b2 commit ae6f5ac
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 51 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Rust is going to be installed in the first compilation of the project. Otherwise
install the correct version:

```sh
rustup toolchain install nightly-2023-07-27
rustup toolchain install nightly-2023-11-12
```

You can also use [asdf](https://asdf-vm.com/):
Expand Down
2 changes: 1 addition & 1 deletion native/explorer/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2023-10-12"
channel = "nightly-2023-11-12"
components = ["rustfmt", "clippy"]
profile = "minimal"
66 changes: 25 additions & 41 deletions native/explorer/src/dataframe/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ pub fn df_to_parquet_cloud(
.finish(&mut data.clone())?;
Ok(())
}

#[cfg(feature = "aws")]
fn object_store_to_explorer_error(error: impl std::fmt::Debug) -> ExplorerError {
ExplorerError::Other(format!("Internal ObjectStore error: #{error:?}"))
}
Expand Down Expand Up @@ -580,31 +582,25 @@ pub fn df_from_ndjson(
_infer_schema_length: Option<usize>,
_batch_size: usize,
) -> Result<ExDataFrame, ExplorerError> {
Err(ExplorerError::Other(format!(
"Explorer was compiled without the \"ndjson\" feature enabled. \
Err(ExplorerError::Other("Explorer was compiled without the \"ndjson\" feature enabled. \
This is mostly due to this feature being incompatible with your computer's architecture. \
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation"
)))
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation".to_string()))
}

#[cfg(not(feature = "ndjson"))]
#[rustler::nif]
pub fn df_to_ndjson(_data: ExDataFrame, _filename: &str) -> Result<(), ExplorerError> {
Err(ExplorerError::Other(format!(
"Explorer was compiled without the \"ndjson\" feature enabled. \
Err(ExplorerError::Other("Explorer was compiled without the \"ndjson\" feature enabled. \
This is mostly due to this feature being incompatible with your computer's architecture. \
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation"
)))
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation".to_string()))
}

#[cfg(not(feature = "ndjson"))]
#[rustler::nif]
pub fn df_dump_ndjson(_data: ExDataFrame) -> Result<Binary<'static>, ExplorerError> {
Err(ExplorerError::Other(format!(
"Explorer was compiled without the \"ndjson\" feature enabled. \
Err(ExplorerError::Other("Explorer was compiled without the \"ndjson\" feature enabled. \
This is mostly due to this feature being incompatible with your computer's architecture. \
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation"
)))
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation".to_string()))
}

#[cfg(not(feature = "ndjson"))]
Expand All @@ -614,11 +610,9 @@ pub fn df_load_ndjson(
_infer_schema_length: Option<usize>,
_batch_size: usize,
) -> Result<ExDataFrame, ExplorerError> {
Err(ExplorerError::Other(format!(
"Explorer was compiled without the \"ndjson\" feature enabled. \
Err(ExplorerError::Other("Explorer was compiled without the \"ndjson\" feature enabled. \
This is mostly due to this feature being incompatible with your computer's architecture. \
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation"
)))
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation".to_string()))
}

#[cfg(not(feature = "aws"))]
Expand All @@ -628,26 +622,22 @@ pub fn df_to_parquet_cloud(
_ex_entry: ExS3Entry,
_ex_compression: ExParquetCompression,
) -> Result<(), ExplorerError> {
Err(ExplorerError::Other(format!(
"Explorer was compiled without the \"aws\" feature enabled. \
Err(ExplorerError::Other("Explorer was compiled without the \"aws\" feature enabled. \
This is mostly due to this feature being incompatible with your computer's architecture. \
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation"
)))
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation".to_string()))
}

#[cfg(not(feature = "aws"))]
#[rustler::nif]
pub fn df_to_csv_cloud(
data: ExDataFrame,
ex_entry: ExS3Entry,
has_headers: bool,
delimiter: u8,
_data: ExDataFrame,
_ex_entry: ExS3Entry,
_has_headers: bool,
_delimiter: u8,
) -> Result<(), ExplorerError> {
Err(ExplorerError::Other(format!(
"Explorer was compiled without the \"aws\" feature enabled. \
Err(ExplorerError::Other("Explorer was compiled without the \"aws\" feature enabled. \
This is mostly due to this feature being incompatible with your computer's architecture. \
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation"
)))
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation".to_string()))
}

#[cfg(not(feature = "aws"))]
Expand All @@ -657,11 +647,9 @@ pub fn df_to_ipc_cloud(
_ex_entry: ExS3Entry,
_compression: Option<&str>,
) -> Result<(), ExplorerError> {
Err(ExplorerError::Other(format!(
"Explorer was compiled without the \"aws\" feature enabled. \
Err(ExplorerError::Other("Explorer was compiled without the \"aws\" feature enabled. \
This is mostly due to this feature being incompatible with your computer's architecture. \
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation"
)))
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation".to_string()))
}

#[cfg(not(feature = "aws"))]
Expand All @@ -671,19 +659,15 @@ pub fn df_to_ipc_stream_cloud(
_ex_entry: ExS3Entry,
_compression: Option<&str>,
) -> Result<(), ExplorerError> {
Err(ExplorerError::Other(format!(
"Explorer was compiled without the \"aws\" feature enabled. \
Err(ExplorerError::Other("Explorer was compiled without the \"aws\" feature enabled. \
This is mostly due to this feature being incompatible with your computer's architecture. \
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation"
)))
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation".to_string()))
}

#[cfg(not(any(feature = "ndjson", feature = "aws")))]
#[rustler::nif(schedule = "DirtyIo")]
pub fn df_to_ndjson_cloud(data: ExDataFrame, ex_entry: ExS3Entry) -> Result<(), ExplorerError> {
Err(ExplorerError::Other(format!(
"Explorer was compiled without the \"aws\" and \"ndjson\" features enabled. \
pub fn df_to_ndjson_cloud(_data: ExDataFrame, _ex_entry: ExS3Entry) -> Result<(), ExplorerError> {
Err(ExplorerError::Other("Explorer was compiled without the \"aws\" and \"ndjson\" features enabled. \
This is mostly due to these feature being incompatible with your computer's architecture. \
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation"
)))
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation".to_string()))
}
12 changes: 4 additions & 8 deletions native/explorer/src/lazyframe/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ pub fn lf_from_parquet_cloud(
_stop_after_n_rows: Option<usize>,
_columns: Option<Vec<String>>,
) -> Result<ExLazyFrame, ExplorerError> {
Err(ExplorerError::Other(format!(
"Explorer was compiled without the \"aws\" feature enabled. \
Err(ExplorerError::Other("Explorer was compiled without the \"aws\" feature enabled. \
This is mostly due to this feature being incompatible with your computer's architecture. \
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation"
)))
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation".to_string()))
}

#[rustler::nif(schedule = "DirtyIo")]
Expand Down Expand Up @@ -208,9 +206,7 @@ pub fn lf_from_ndjson(
_infer_schema_length: Option<usize>,
_batch_size: usize,
) -> Result<ExLazyFrame, ExplorerError> {
Err(ExplorerError::Other(format!(
"Explorer was compiled without the \"ndjson\" feature enabled. \
Err(ExplorerError::Other("Explorer was compiled without the \"ndjson\" feature enabled. \
This is mostly due to this feature being incompatible with your computer's architecture. \
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation"
)))
Please read the section about precompilation in our README.md: https://github.com/elixir-explorer/explorer#precompilation".to_string()))
}

0 comments on commit ae6f5ac

Please sign in to comment.