Skip to content

chore(git): untrack bindings/python/target build artifacts - #26

Merged
h4x0r merged 1 commit into
mainfrom
fix/untrack-build-artifacts
Aug 5, 2026
Merged

chore(git): untrack bindings/python/target build artifacts#26
h4x0r merged 1 commit into
mainfrom
fix/untrack-build-artifacts

Conversation

@h4x0r

@h4x0r h4x0r commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

What this is

Index hygiene only. 781 files removed from the git index, zero files removed from disk, no source change.

The diff will render as ~781 deletions. Nothing was deleted — git rm -r --cached drops index entries and leaves the working tree untouched. The only content change in this PR is 4 lines in .gitignore.

The defect

781 cargo build artifacts under bindings/python/target/ were tracked in git: .fingerprint/ entries, dep-lib-*, invoked.timestamp, *.json metadata.

The root .gitignore had /target/ — a leading slash anchors the pattern to the repo root, so it never covered bindings/python/target/. (bindings/python is a nested cargo package with its own Cargo.toml, outside the workspace members list, so it gets its own target/.) The fix makes the pattern unanchored so it matches a target/ at any package root.

Why it matters beyond bloat

Tracking these made an ordinary maintenance operation destructive: a routine cargo sweep across the fleet deleted them, because every reasonable tool assumes everything under target/ is regenerable. They were restored with git restore, but the next person running any target/-cleaning tool hits the same trap.

Published crate payload

Not affected. bindings/python has its own Cargo.toml, so cargo omits the whole directory from the package — cargo package --list -p forensicnomicon returns 191 files with 0 under bindings/. Consumers of forensicnomicon 1.10.0 were not downloading build fingerprints.

But that protection was incidental, and worth naming as a latent risk. The [package] exclude key lists archive/, scripts/, tests/, fuzz/ — it does not list bindings/. The 781 files stayed out of the payload purely because cargo omits a subdirectory that contains its own Cargo.toml. Delete or rename bindings/python/Cargo.toml, or fold bindings/python into the workspace members, and build fingerprints would have started shipping to crates.io with no warning at all. Untracking them removes the dependence on that side effect.

Nothing depended on the tracked state

  • grep -rn 'bindings/python/target' .github scripts — no matches.
  • cargo build --workspace — clean.
  • cargo test --workspace — 3633 passed, 4 ignored, 26 suites.

Verification

$ git ls-files | grep -cE '(^|/)target/'
0

$ git status --porcelain
(empty — clean tree)

$ find bindings/python/target -type f | wc -l
781

Note for reviewers with other open PRs

Branched from origin/main. The diff is .gitignore plus index removals under bindings/python/target/, so it should not collide with the source changes in #24 or #25.

🤖 Generated with Claude Code

781 cargo build artifacts under `bindings/python/target/` were tracked in git:
`.fingerprint/` entries, `dep-lib-*`, `invoked.timestamp`, `*.json` metadata.

Tracking them made an ordinary maintenance operation destructive — a routine
`cargo sweep` across the fleet deleted them, because every reasonable tool
assumes everything under `target/` is regenerable.

The root `.gitignore` had `/target/`, which is anchored to the repo root and so
never covered `bindings/python/target/` (`bindings/python` is a nested cargo
package with its own `Cargo.toml`, outside the workspace members). Making the
pattern unanchored covers a `target/` at any package root.

No file was deleted from disk: `git rm -r --cached` removes index entries only.
No source change. `cargo build --workspace` and `cargo test --workspace`
(3633 passed) confirm nothing depended on the tracked state.

The artifacts were not in the published crate payload — `bindings/python` has
its own `Cargo.toml`, so cargo omits the directory from `cargo package`
(verified: 0 `target/` entries in `cargo package --list`).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@h4x0r
h4x0r marked this pull request as ready for review August 5, 2026 20:27
@h4x0r
h4x0r merged commit b01ff49 into main Aug 5, 2026
12 checks passed
@h4x0r
h4x0r deleted the fix/untrack-build-artifacts branch August 9, 2026 15:28
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