Skip to content

Create logfwd-input crate, move file tailer + IO #265

Closed

Description

@strawgate

Summary

Create logfwd-input crate and move IO-dependent code out of logfwd-core.

No backward compatibility needed — we have no external users. Just move the code and update all imports.

What moves

File Lines Why it can't stay in core
tail.rs 1141 filesystem IO, notify crate
input.rs 76 wraps tailer, IO types
checkpoint.rs 339 filesystem IO, serde_json

Steps

  1. Create crates/logfwd-input/Cargo.toml (deps: logfwd-core, notify, serde, serde_json, xxhash-rust, glob)
  2. Move tail.rs, input.rs, checkpoint.rs to logfwd-input/src/
  3. Create logfwd-input/src/lib.rs with pub mod declarations
  4. Update logfwd binary crate to depend on logfwd-input
  5. Update all imports (grep for logfwd_core::tail, logfwd_core::input, logfwd_core::checkpoint)
  6. Move related test files if any (check tests/ directory)
  7. All existing tests pass

This is purely mechanical

Whole files move. No function splitting. No trait extraction. The only work is updating import paths.

Assignability

Copilot-assignable. Independent from Phase 1a — can run in parallel.

Parent: #262

Activity

  1. self-assigned this
    on Mar 30, 2026
  2. strawgate commented on Mar 30, 2026

    @strawgate
    OwnerAuthor

    @copilot This is a mechanical file move. Create crates/logfwd-input/ and move tail.rs, input.rs, checkpoint.rs from crates/logfwd-core/src/. Update all imports across the workspace. No backward compat needed — just update the import paths everywhere. All existing tests must pass.

    Read dev-docs/DIRECTION.md and dev-docs/CRATE_RULES.md for context on the crate restructuring.

  3. strawgate commented on Mar 31, 2026

    @strawgate
    OwnerAuthor

    @copilot Step 1 (logfwd-arrow) has merged. You can now do Step 2.

    Create crates/logfwd-input/ and move IO-dependent code out of logfwd-core. No backward compatibility needed — just move files and update all imports.

    Files to move:

    • crates/logfwd-core/src/tail.rs → crates/logfwd-input/src/tail.rs
    • crates/logfwd-core/src/input.rs → crates/logfwd-input/src/input.rs
    • crates/logfwd-core/src/checkpoint.rs → crates/logfwd-input/src/checkpoint.rs

    Steps:

    1. Create crates/logfwd-input/Cargo.toml with these deps:

      [package]
      name = "logfwd-input"
      version = "0.1.0"
      edition = "2024"
      publish = false
      
      [dependencies]
      logfwd-core = { path = "../logfwd-core" }
      crossbeam-channel = "0.5"
      glob = "0.3"
      memchr = "2"
      notify = "7"
      serde = { workspace = true }
      serde_json = "1"
      xxhash-rust = { version = "0.8", features = ["xxh32", "xxh64"] }
    2. Create crates/logfwd-input/src/lib.rs with pub mod tail; pub mod input; pub mod checkpoint;

    3. Move the three files, update use crate:: to use logfwd_core:: where they reference core types (like filter_hints)

    4. Remove pub mod tail;, pub mod input;, pub mod checkpoint; from crates/logfwd-core/src/lib.rs

    5. Delete the old files from logfwd-core

    6. Remove now-unused deps from logfwd-core's Cargo.toml: crossbeam-channel, glob, notify, serde_json, xxhash-rust (check each is truly unused first)

    7. Add logfwd-input = { path = "../logfwd-input" } to workspace members in root Cargo.toml

    8. Add logfwd-input as dependency to crates that import these modules (logfwd binary, logfwd-bench if applicable)

    9. Update ALL imports across the workspace: logfwd_core::tail → logfwd_input::tail, etc.

    10. cargo test and cargo clippy -- -D warnings must pass.

    Read dev-docs/DIRECTION.md for context.

  4. changed the title [-]Phase 1b: Create logfwd-input crate, move file tailer + IO[/-] [+]Create logfwd-input crate, move file tailer + IO[/+] on Mar 31, 2026
  5. strawgate commented on Mar 31, 2026

    @strawgate
    OwnerAuthor

    Superseded by logfwd-io crate created in PR #375. IO modules moved there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions