Skip to content

Compilation failure with only storage-fs feature used #1303

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

Closed
dentiny opened this issue May 9, 2025 · 3 comments · Fixed by #1304
Closed

Compilation failure with only storage-fs feature used #1303

dentiny opened this issue May 9, 2025 · 3 comments · Fixed by #1304
Labels
bug Something isn't working

Comments

@dentiny
Copy link
Contributor

dentiny commented May 9, 2025

Apache Iceberg Rust version

0.4.0 (latest version)

Describe the bug

I'm using main branch, and suffers compilation failure when only storage-fs feature included.

To Reproduce

Reproduce code and repo: https://github.com/dentiny/iceberg-rust-namespace-exists
The above repo attempts to include only storage-fs feature, and regular build command cargo build fails with compilation failure:

error[E0282]: type annotations needed
   --> /usr/local/cargo/git/checkouts/iceberg-rust-1cfaaa0dd97c960f/7a5ad1f/crates/iceberg/src/io/storage.rs:115:21
    |
115 |                     Ok((op, stripped))
    |                     ^^ cannot infer type of the type parameter `E` declared on the enum `Result`
    |
help: consider specifying the generic arguments
    |
115 |                     Ok::<(Operator, &str), E>((op, stripped))
    |                       +++++++++++++++++++++++

Expected behavior

Compilation and link pass with no issues.

Willingness to contribute

None

@dentiny
Copy link
Contributor Author

dentiny commented May 9, 2025

A followup question: what's the idiomatic way to test different combination of features in CI, to prevent it happen?
Local cargo test and cargo build only build for default / all features, which is purpose for "features".

@Xuanwo
Copy link
Member

Xuanwo commented May 10, 2025

Interesting. I didn’t expect that we would need a type hint here. Let me take a look.

@dentiny
Copy link
Contributor Author

dentiny commented May 11, 2025

Interesting. I didn’t expect that we would need a type hint here. Let me take a look.

I also find it weird, returning the explicit error type is the easiest fix I could think of.

@sdd sdd closed this as completed in #1304 May 12, 2025
sdd pushed a commit that referenced this issue May 12, 2025
## Which issue does this PR close?

- Closes #1303

## What changes are included in this PR?

This PR makes return type `Return<>` explicit.

## Are these changes tested?

I included a reproduction environment on the issue, and verify it
compiles with no issue after my fix.
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

Successfully merging a pull request may close this issue.

2 participants