Skip to content

Compilation failures due to conflicting versions of rand crate #9682

@scovich

Description

@scovich

Describe the bug

arrow-rs directly pulls in rand-0.9.2 (#7126), but #9029 pulls in half-2.4.1 which pulls rand-0.8.4.

Result: unit tests using float16 fail to compile.

To Reproduce

% cargo test -p parquet-variant-compute --lib 
error[E0277]: the trait bound `StandardUniform: rand::distr::Distribution<half::f16>` is not satisfied
   --> arrow/src/util/bench_util.rs:799:26
    |
799 |                 Some(rng.random())
    |                          ^^^^^^ the trait `rand::distr::Distribution<half::f16>` is not implemented for `StandardUniform`
    |
note: there are multiple different versions of crate `rand` in the dependency graph

Expected behavior

Compiles and runs.

Additional context

Excerpt of cargo tree -p parquet-variant-compute output:

parquet-variant-compute v58.1.0 (/Users/ryan.johnson/arrow-rs/parquet-variant-compute)
├── arrow v58.1.0 (/Users/ryan.johnson/arrow-rs/arrow)
│   ├── arrow-arith v58.1.0 (/Users/ryan.johnson/arrow-rs/arrow-arith)
│   │   ├── arrow-array v58.1.0 (/Users/ryan.johnson/arrow-rs/arrow-array)
  ...
│   │   │   ├── arrow-buffer v58.1.0 (/Users/ryan.johnson/arrow-rs/arrow-buffer)
│   │   │   │   ├── bytes v1.11.0
│   │   │   │   ├── half v2.4.1
  ...
│   │   │   │   │   ├── rand v0.8.5
│   │   │   │   │   │   └── rand_core v0.6.4
│   │   │   │   │   └── rand_distr v0.4.3
│   │   │   │   │       ├── num-traits v0.2.19 (*)
│   │   │   │   │       └── rand v0.8.5 (*)
  ...
│   └── rand v0.9.2
  ...
[dev-dependencies]
  ...
└── rand v0.9.2 (*)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions