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

Build failure due to conflicting strum versions in deltalake-core dependencies #3267

Open
mag1cfrog opened this issue Feb 25, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@mag1cfrog
Copy link

Environment

Delta-rs version:
0.24.0

Binding:
Rust

Environment:

  • Cloud provider: local
  • OS: WSL-ubuntu
  • Other: Rust 1.83.0

Bug

What happened:

When started a new cargo repo and only add deltalake("0.24.0") and run 'cargo build', build fails with type mismatch errors between [email protected] (via delta_kernel) and [email protected] (direct dependency of deltalake-core):

   Compiling deltalake-core v0.24.0
error[E0308]: mismatched types
   --> /home/hanbo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deltalake-core-0.24.0/src/kernel/models/actions.rs:567:9
    |
566 |     fn try_from(value: &TableFeatures) -> Result<Self, Self::Error> {
    |                                           ------------------------- expected `Result<ReaderFeatures, strum::ParseError>` because of return type
567 |         ReaderFeatures::try_from(value.as_ref())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `strum::ParseError`, found a different `strum::ParseError`
    |
    = note: `strum::ParseError` and `strum::ParseError` have similar names, but are actually distinct types
note: `strum::ParseError` is defined in crate `strum`
   --> /home/hanbo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/strum-0.26.3/src/lib.rs:42:1
    |
42  | pub enum ParseError {
    | ^^^^^^^^^^^^^^^^^^^
note: `strum::ParseError` is defined in crate `strum`
   --> /home/hanbo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/strum-0.27.1/src/lib.rs:42:1
    |
42  | pub enum ParseError {
    | ^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `strum` are being used?

error[E0308]: mismatched types
   --> /home/hanbo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deltalake-core-0.24.0/src/kernel/models/actions.rs:575:9
    |
574 |     fn try_from(value: &TableFeatures) -> Result<Self, Self::Error> {
    |                                           ------------------------- expected `Result<WriterFeatures, strum::ParseError>` because of return type
575 |         WriterFeatures::try_from(value.as_ref())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `strum::ParseError`, found a different `strum::ParseError`
    |
    = note: `strum::ParseError` and `strum::ParseError` have similar names, but are actually distinct types
note: `strum::ParseError` is defined in crate `strum`
   --> /home/hanbo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/strum-0.26.3/src/lib.rs:42:1
    |
42  | pub enum ParseError {
    | ^^^^^^^^^^^^^^^^^^^
note: `strum::ParseError` is defined in crate `strum`
   --> /home/hanbo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/strum-0.27.1/src/lib.rs:42:1
    |
42  | pub enum ParseError {
    | ^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `strum` are being used?

For more information about this error, try `rustc --explain E0308`.
error: could not compile `deltalake-core` (lib) due to 2 previous errors

What you expected to happen: Clean build without version conflicts when adding the deltalake crate as a dependency.

How to reproduce it:

  1. cargo new test_delta

  2. Add deltalake = "0.24.0" to Cargo.toml

  3. Run cargo build

  4. Observe compilation errors about mismatched strum::ParseError types

More details:
The dependency tree shows:

❯ cargo tree -p [email protected] --invert
strum v0.26.3
└── delta_kernel v0.6.0
    └── deltalake-core v0.24.0
        └── deltalake v0.24.0
            └── test_delta v0.1.0 (/home/hanbo/repositories/test_delta)
❯ cargo tree -p [email protected] --invert
strum v0.27.1
└── deltalake-core v0.24.0
    └── deltalake v0.24.0
        └── test_delta v0.1.0 (/home/hanbo/repositories/test_delta)

Also I found a workaround, is to use cargo download to manually download deltalake-core locally, and then modify the Cargo.toml file on the strum dependency from

[dependencies.strum]
version = "0"

to

[dependencies.strum]
version = "0.26"

and then in the test repo's Cargo.toml file add this patch:

[patch.crates-io]
deltalake-core = { path = "/home/hanbo/repositories/deltalake-core-0.24.0", version = "0.24.0" }

and then it can build:

cargo build
     Locking 1 package to latest compatible version
      Adding deltalake-core v0.24.0 (/home/hanbo/repositories/deltalake-core-0.24.0)
   Compiling deltalake-core v0.24.0 (/home/hanbo/repositories/deltalake-core-0.24.0)
warning: static `ARROW_HANDLER` is never used
  --> /home/hanbo/repositories/deltalake-core-0.24.0/src/kernel/mod.rs:26:8
   |
26 | static ARROW_HANDLER: LazyLock<ArrowExpressionHandler> =
   |        ^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: static `LOG_SCHEMA` is never used
   --> /home/hanbo/repositories/deltalake-core-0.24.0/src/kernel/models/fields.rs:228:8
    |
228 | static LOG_SCHEMA: LazyLock<StructType> = LazyLock::new(|| {
    |        ^^^^^^^^^^

warning: function `log_schema_ref` is never used
   --> /home/hanbo/repositories/deltalake-core-0.24.0/src/kernel/models/fields.rs:276:15
    |
276 | pub(crate) fn log_schema_ref() -> &'static Arc<StructType> {
    |               ^^^^^^^^^^^^^^

warning: function `get_target_file_size` is never used
   --> /home/hanbo/repositories/deltalake-core-0.24.0/src/operations/mod.rs:355:15
    |
355 | pub(crate) fn get_target_file_size(
    |               ^^^^^^^^^^^^^^^^^^^^

   Compiling deltalake v0.24.0
warning: `deltalake-core` (lib) generated 4 warnings
   Compiling test_delta v0.1.0 (/home/hanbo/repositories/test_delta)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.67s
@mag1cfrog mag1cfrog added the bug Something isn't working label Feb 25, 2025
@ion-elgreco
Copy link
Collaborator

This is fixed in main. @rtyler were you planning a release soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants