-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Labels
S-triageStatus: Waiting for a maintainer to triage this issue/PRStatus: Waiting for a maintainer to triage this issue/PR
Description
Problem
OpenDAL 0.55.0+ removed the Scheme enum from its public API. The current rustic_backend implementation in crates/backend/src/opendal.rs uses Scheme::from_str(), which causes compilation errors with newer OpenDAL versions.
Current error:
error[E0432]: unresolved import `opendal::Scheme`
--> crates/backend/src/opendal.rs:8:5
|
8 | Scheme,
| ^^^^^^ no `Scheme` in the root
Root Cause
OpenDAL changed its API in 0.55.0:
- Old API (0.54.x):
Operator::via_iter(Scheme::from_str(path)?, options) - New API (0.55.x):
Operator::via_iter(scheme_string, options)- accepts&strdirectly
Solution
Update crates/backend/src/opendal.rs to extract the scheme string directly from the path instead of using the removed Scheme enum:
-use opendal::{
- Scheme,
- blocking::Operator,
- layers::{ConcurrentLimitLayer, LoggingLayer, RetryLayer, ThrottleLayer},
- options::{ListOptions, ReadOptions},
-};
+use opendal::{
+ blocking::Operator,
+ layers::{ConcurrentLimitLayer, LoggingLayer, RetryLayer, ThrottleLayer},
+ options::{ListOptions, ReadOptions},
+};- let schema = Scheme::from_str(path.as_ref()).map_err(|err| {
- RusticError::with_source(
- ErrorKind::InvalidInput,
- "Parsing scheme from path `{path}` failed, the path must contain a valid scheme.",
- err,
- )
- .attach_context("path", path.as_ref().to_string())
- })?;
- let mut operator = opendal::Operator::via_iter(schema, options)
+ let scheme = path
+ .as_ref()
+ .split(':')
+ .next()
+ .unwrap_or(path.as_ref());
+
+ let mut operator = opendal::Operator::via_iter(scheme, options)
.map_err(|err| {
RusticError::with_source(
ErrorKind::Backend,
"Creating Operator from path `{path}` failed. Please check the given schema and options.",
err,
)
.attach_context("path", path.as_ref().to_string())
- .attach_context("schema", schema.to_string())
+ .attach_context("schema", scheme.to_string())
})?Timeline & Dependencies
- OpenDAL PR merged: fix(services/gdrive): include size and modifiedTime in list() metadata apache/opendal#7058 (fixes Google Drive metadata in list operations)
- OpenDAL release: Waiting for 0.55.1 or 0.56.0 release
- rustic_backend update needed: After OpenDAL release, update dependency and apply this fix
Testing
The fix has been tested locally with:
- OpenDAL 0.55.0 from the fix branch
- Google Drive backend (backup/repoinfo/check operations successful)
- No regressions in other backends expected (change is minimal and follows OpenDAL's new API)
Related
- bug: services/gdrive:
list()returns size=0 for all files - missing size field in API call and metadata mapping apache/opendal#7057 - Original issue reporting Google Drive metadata bug - fix(services/gdrive): include size and modifiedTime in list() metadata apache/opendal#7058 - PR fixing the Google Drive metadata issue
- This fix enables rustic to use the corrected Google Drive backend once released
Metadata
Metadata
Assignees
Labels
S-triageStatus: Waiting for a maintainer to triage this issue/PRStatus: Waiting for a maintainer to triage this issue/PR