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

Error running tests with --all-features (cannot find function lz4_decompress_to_buffer) #210

Open
aldanor opened this issue Dec 24, 2022 · 1 comment

Comments

@aldanor
Copy link
Contributor

aldanor commented Dec 24, 2022

Here's just cloning the repo and trying to run the tests (note that the same error occurs if you try to run all tests for arrow2):

   Compiling parquet2 v0.17.0
error[E0425]: cannot find function `lz4_decompress_to_buffer` in this scope
   --> src/compression.rs:196:13
    |
196 |             lz4_decompress_to_buffer(input_buf, Some(output_buf.len() as i32), output_buf)
    |             ^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `lz4_decompress_to_buffer` in this scope
   --> src/compression.rs:265:33
    |
265 |         let decompressed_size = lz4_decompress_to_buffer(
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

I understand this has to do with lz4_flex and inconsistent feature sets, but having --all-features cause invalid feature sets is not very nice if it can be avoided.

lz4_decompress_to_buffer() is only defined for lz4 && !lz4_flex or for !lz4_flex && lz4, however that's not what the match checks. Perhaps lz4_flex && lz4 should be treated as lz4_flex for all intents and purposes? (so that --all-features would make sense)

Here's what the match checks:

        #[cfg(all(feature = "lz4_flex", not(feature = "lz4")))]
        Compression::Lz4Raw => lz4_flex::block::decompress_into(...),
        #[cfg(feature = "lz4")]
        Compression::Lz4Raw => lz4::block::decompress_to_buffer(...),
        #[cfg(all(not(feature = "lz4"), not(feature = "lz4_flex")))]
        Compression::Lz4Raw => Err(Error::FeatureNotActive(...)),
        #[cfg(any(feature = "lz4_flex", feature = "lz4"))]
        Compression::Lz4 => try_decompress_hadoop(...),
        // ^ lz4_decompress_to_buffer() also used here, error!
        #[cfg(all(not(feature = "lz4_flex"), not(feature = "lz4")))]
        Compression::Lz4 => Err(Error::FeatureNotActive(...)),

(I know it's a breaking change but, just saying, another option is converting a feature, like lz4_flex, into a 'negative' feature, so that --all-features wouldn't enable it by default)

@douglas-raillard-arm
Copy link

Also just hit this issue while trying to enable lz4 support for arrow2

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

No branches or pull requests

2 participants