Skip to content

Depend on halfphi instead of keeping a second copy of it #3

Open

Description

@isenbek

crates/halfphi/ here and https://github.com/tinymachines/halfphi hold the
same five files, and nothing keeps them in sync.

They drifted within minutes of the split, on whitespace: the standalone repo runs
cargo fmt --check in CI, this repo has never been fmt'd, and default rustfmt
reflows the one-line struct literals used throughout this codebase. That is
patched over with a shared rustfmt.toml, and tests/chips.rs searches two
candidate paths for the die submodule so one file can be correct in both
layouts. Both are stopgaps.

The five files are byte-identical today. Verify with:

for f in src/lib.rs src/netlist.rs src/engine.rs src/source.rs tests/chips.rs; do
  diff -q "crates/halfphi/$f" "../halfphi/$f"
done

The fix

Replace halfphi = { path = "../halfphi" } with a git dependency (pinned to a
tag or rev) or a crates.io version once published, and delete crates/halfphi/
from this workspace.

Why now

It is cheapest before the APIs diverge. Once someone fixes a parser bug in one
copy and not the other, the two stop being the same library and every claim made
about one stops applying to the other — which is exactly the class of quiet
difference this project exists to remove.

Acceptance

  • One copy of the source, in one repository.
  • cargo test --workspace still passes, including the golden differential.
  • All six derived artifacts (layout.bin, blueprint/blocks/schematic/decode/ timing.json) remain byte-identical.

See also tinymachines/halfphi#4.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions