Page MenuHomePhabricator

Provide "bin/files integrity" for debugging, maintaining and backfilling integrity hashes
ClosedPublic

Authored by epriestley on Apr 6 2017, 2:01 PM.
Tags
None
Referenced Files
F19540081: D17629.diff
Wed, Jan 21, 10:05 PM
F19523994: D17629.diff
Sat, Jan 17, 9:17 PM
F19523988: D17629.diff
Sat, Jan 17, 9:15 PM
F19274773: D17629.id42400.diff
Dec 23 2025, 12:22 AM
F19211408: D17629.id42400.diff
Dec 17 2025, 2:05 AM
F18988486: D17629.diff
Nov 18 2025, 4:19 AM
F18854897: D17629.id42414.diff
Nov 1 2025, 12:48 AM
F18846644: D17629.diff
Oct 29 2025, 8:16 PM
Subscribers
None

Details

Summary

Ref T12470. Provides an "integrity" utility which runs in these modes:

  • Verify: check that hashes match.
  • Compute: backfill missing hashes.
  • Strip: remove hashes. Useful for upgrading across a hash change.
  • Corrupt: intentionally corrupt hashes. Useful for debugging.
  • Overwrite: force hash recomputation.

Users normally shouldn't need to run any of this stuff, but this provides a reasonable toolkit for managing integrity hashes.

I'll recommend existing installs use bin/files integrity --compute all in the upgrade guidance to backfill hashes for existing files.

Test Plan
  • Ran the script in many modes against various files, saw expected operation, including:
  • Verified a file, corrupted it, saw it fail.
  • Verified a file, stripped it, saw it have no hash.
  • Stripped a file, computed it, got a clean verify.
  • Stripped a file, overwrote it, got a clean verify.
  • Corrupted a file, overwrote it, got a clean verify.
  • Overwrote a file, overwrote again, got a no-op.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable