Skip to content

Tracking issues for RFC-6828: Core #6829

@Xuanwo

Description

@Xuanwo

Prompts

For joining this event, please clarify the tools and LLMs you are using.

Splitting service/layer {name} into its own crate

- Goals & constraints
  - Extract `core/src/{kind}s/{name}` into a new crate `core/{kind}s/{name}`, crate name `opendal-{kind}-{name}`, while keeping the public surface (`opendal::{kind}s::{Name}`) unchanged.
  - Preserve the existing feature flag: `services-{name}` for services, `layers-{name}` for layers. No behavior-test changes.

- Steps
  1) Workspace & dependencies
     - Create `core/{kind}s/{name}/Cargo.toml`: depend on `opendal-core` (path, default-features=false); move all {kind}-specific third-party deps/versions here.
     - In root crate `core/Cargo.toml`:
       - Add optional dependency `opendal-{kind}-{name}`.
       - Map feature `services-{name}` -> `["dep:opendal-service-{name}"]` or `layers-{name}` -> `["dep:opendal-layer-{name}"]`.
     - In `core/core/Cargo.toml`, remove this {kind}’s feature and its deps.

  2) Code migration
     - Move all `core/core/src/{kind}s/{name}/**` into `core/{kind}s/{name}/src/`, flatten modules in `lib.rs` (`mod backend; ...` or layer-specific modules) and re-export public types (`pub use backend::{NameBuilder as Name}` / layer types).
     - Remove `mod {name}; pub use {name}::*;` from `core/core/src/{kind}s/mod.rs`.
     - Fix imports: `crate::` -> `opendal_core::` (or `crate::` inside the new crate); resolve visibility by making shared helpers `pub` in core rather than duplicating.
     - Registration: if applicable, keep `#[ctor] fn register() { DEFAULT_OPERATOR_REGISTRY.register::<Name>(SCHEME); }` in the new crate.

  3) Facade re-export
     - In `core/src/lib.rs`, under the relevant feature gate, `pub use opendal-{kind}-{name}::*;` so `opendal::{kind}s::{Name}` remains available.

  4) Docs & examples
     - Update docs/examples imports to the new crate (or facade) paths.
     - If core docs/examples depended on this {kind}, optionally swap to another built-in {kind} during the migration to keep docs building.

  5) Tests & behavior
     - Move unit/integration tests with the code (keep paths/features). If core tests reference it, ensure they go through the facade feature.
     - Minimal verify: `cargo check -p opendal-{kind}-{name}`; optionally `cargo check -p opendal --features {kind}s-{name}`.

  6) Cleanup & compatibility
     - Delete sources and deps from core.
     - If external use needs a core-private helper, expose it (`pub`) instead of duplicating.

- Risks to watch
  - Cross-crate visibility: widen visibility rather than copy code.
  - Preserve existing API/feature names and behavior.

Tasks

Metadata

Metadata

Assignees

No one assigned

    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