Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cargo.toml dependencies aren't accurate #3849

Closed
max-sixty opened this issue Mar 12, 2023 · 4 comments · Fixed by #4482
Closed

Cargo.toml dependencies aren't accurate #3849

max-sixty opened this issue Mar 12, 2023 · 4 comments · Fixed by #4482
Labels

Comments

@max-sixty
Copy link
Contributor

Describe the bug

Currently arrow-rs doesn't compile successfully with the full range of dependencies in its Cargo.toml.

This is similar to the issue reported by #3525. That was closed with a suggestion to bump dependencies, but doesn't help for other projects that want to test that their Cargo is accurate — duckdb/duckdb-rs#135 & PRQL/prql#2112. The intention behind Cargo.toml is that it specifies the full range of dependencies, IIUC.

To Reproduce

cargo +nightly update -Z minimal-versions
cargo build
error[E0599]: no method named `powi` found for struct `f16` in the current scope
   --> arrow-array/src/arithmetic.rs:351:25
    |
351 |                 Ok(self.powi(exp as i32))
    |                         ^^^^ method not found in `f16`
...
380 | native_type_float_op!(f16, f16::ONE, f16::ZERO);
    | ----------------------------------------------- in this macro invocation
    |
    = help: items from traits can only be used if the trait is in scope
    = note: this error originates in the macro `native_type_float_op` (in Nightly builds, run with -Z macro-backtrace for more info)
help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
    |
18  | use num::Float;
    |
18  | use num::traits::float::FloatCore;
    |
18  | use num::traits::real::Real;
    |
...

Thank you!

@alamb
Copy link
Contributor

alamb commented Mar 16, 2023

Thank you for the report @max-sixty -- it would be great to get Cargo.toml updated and accurate for all crates in this repo (as well as figure out how to verify this in CI)

@max-sixty
Copy link
Contributor Author

max-sixty commented Mar 16, 2023

Great, there's a test in PRQL/prql#2112, which guided me to arrow-rs, and could be used here too

@mwlon
Copy link
Contributor

mwlon commented Jul 8, 2023

I was getting errors trying to install recent versions of arrow:

error[E0432]: unresolved import `num::complex::ComplexFloat`
  --> /Users/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/arrow-array-30.0.1/src/arithmetic.rs:21:5
   |
21 | use num::complex::ComplexFloat;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ComplexFloat` in `complex`

error[E0599]: no method named `powi` found for struct `f16` in the current scope
   --> /Users/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/arrow-array-30.0.1/src/arithmetic.rs:351:25
    |
351 |                 Ok(self.powi(exp as i32))
    |                         ^^^^ method not found in `f16`
...
380 | native_type_float_op!(f16, f16::ONE, f16::ZERO);
    | ----------------------------------------------- in this macro invocation
    |
    = help: items from traits can only be used if the trait is in scope
    = note: this error originates in the macro `native_type_float_op` (in Nightly builds, run with -Z macro-backtrace for more info)
help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
    |
18  + use num::Float;
    |
18  + use num::traits::float::FloatCore;
    |
18  + use num::traits::real::Real;
    |

error[E0599]: no method named `powi` found for struct `f16` in the current scope
   --> /Users/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/arrow-array-30.0.1/src/arithmetic.rs:356:22
    |
356 |                 self.powi(exp as i32)
    |                      ^^^^ method not found in `f16`
...
380 | native_type_float_op!(f16, f16::ONE, f16::ZERO);
    | ----------------------------------------------- in this macro invocation
    |
    = help: items from traits can only be used if the trait is in scope
    = note: this error originates in the macro `native_type_float_op` (in Nightly builds, run with -Z macro-backtrace for more info)
help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
    |
18  + use num::Float;
    |
18  + use num::traits::float::FloatCore;
    |
18  + use num::traits::real::Real;
    |

It seemed to become problematic between 30 and 35. I was able to fix this by adding

num-complex = "0.4.3"

to my Cargo.toml. I've submitted #4482 .

@alamb
Copy link
Contributor

alamb commented Jul 8, 2023

I filed #4486 to track adding a CI check for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants