Skip to content

build: rename the crate to diffs-rs and ship the patched dependencies as forks - #3

Merged
backnotprop merged 1 commit into
mainfrom
chore/publish-prep
Oct 27, 2026
Merged

backnotprop merged 1 commit into
mainfrom
chore/publish-prep

Conversation

@backnotprop

Copy link
Copy Markdown
Contributor

Renames the crate to diffs-rs and replaces the [patch.crates-io] overrides with forked crates that can be published. Everything keeps publish = false.

Forks

The patched dependencies now live in crates/ as workspace members:

Crate Upstream base Changes
diffs-fancy-regex 0.1.0 fancy-regex 0.16.2 The existing patches (search scratch, engine sharing, required-byte metadata, owner census)
diffs-syntect 0.1.0 syntect 5.3.0 The existing patches; depends on diffs-fancy-regex renamed to fancy-regex
diffs-two-face 0.1.0 two-face 0.5.2+bat-0.26.1 Depends on diffs-syntect renamed to syntect. acknowledgement::url() names the upstream tag instead of building it from the package version
  • Each fork keeps its upstream library name (fancy_regex, syntect, two_face), upstream license file and copyright notice. Its README states the upstream version, revision and archive checksum, the changes, and that it exists only for diffs-rs. PATCHES.md (formerly NATIVE_DIFF_PATCH.md) keeps the detailed notes, and [package.metadata.diffs-rs.upstream] records the base.
  • The fork versions start at 0.1.0 instead of mirroring upstream. A mirrored 0.16.2 would leave no room for our own fixes without colliding with upstream's next version, and crates.io ignores build metadata when it compares versions.
  • Packaging cleanup in the forks: the normalized Cargo.toml is replaced by the upstream Cargo.toml.orig; upstream benches, criterion, syntect's public_api test (it installs nightly and its snapshot no longer matches), upstream CI files and the standalone lockfile are dropped. Upstream lints are allowed in the fork manifests, because cargo clippy -- -D warnings now reaches workspace members.
  • diffs-rs depends on each fork with package =, path and version, so no source changes were needed. The lockfile only adds the forks' test dev-dependencies. No existing package version changed.

Rename

  • Package diffs-rs, library diffs_rs, executable diffs (clap name set too, so --version prints diffs 0.1.0). All native_diff:: paths, CARGO_BIN_EXE_*, the save temp-file prefix (.diffs-save-), and the error prefix are updated. The README, EMBEDDING.md, specs, NOTICE.md, RELEASE_READINESS.md, CURRENT_STATE.md, tools, and CI are updated too.
  • Deliberately unchanged: the viewer title bar (native-diff / …) and the NATIVE_DIFF_* environment variables. Preserved-executable grid comparisons and the measurement tools depend on them.

Checks

  • cargo fmt --check; clippy -D warnings for default, --all-features, and --lib --no-default-features.

  • cargo test --release --locked -- --test-threads=1: 255 passed, 10 ignored (same as main). Embedded host contract: 6 passed.

  • Fork suites: diffs-fancy-regex all pass; diffs-two-face all pass; diffs-syntect passes except the upstream can_parse_common_themes, which needs the unrestored testdata/spacegray submodule (already documented as not restored).

  • cargo package --workspace --locked in a scratch copy with publish allowed: all four packages verified against each other.

    • diffs-fancy-regex: 23 files, 72 KiB
    • diffs-syntect: 40 files, 794 KiB
    • diffs-two-face: 21 files, 3.4 MiB
    • diffs-rs: 98 files, 213 KiB

    No tests, fixtures, evidence, testdata, or crates/ files are included in diffs-rs.

  • tools/parse_baseline.py, 3 runs each, main vs this branch: identical summaries and no time or peak-RSS regression (linux v6-v7 median 7.11 s / 379 MiB vs 7.15 s / 384 MiB). inspect --canonical output is byte-identical on the repository fixtures and node-59805.

… as forks

The crate is now diffs-rs (library diffs_rs) with a `diffs` executable.
The patched syntect and fancy-regex move from vendor/ to crates/ as the
workspace members diffs-syntect and diffs-fancy-regex, joined by
diffs-two-face, a two-face fork built against diffs-syntect so its types
match. diffs-rs depends on them through `package =` renames, so the
[patch.crates-io] section is gone and every crate can be published.

Each fork keeps its upstream library name, license and copyright notice,
records its upstream base in its description, README and package
metadata, and starts at version 0.1.0. All packages keep publish = false;
RELEASE_READINESS.md gives the publish order.

The viewer title bar and the NATIVE_DIFF_* environment variables keep the
old name, so preserved-executable comparisons and measurement tools still
match.
@backnotprop
backnotprop merged commit 50d3fb5 into main Oct 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant