Fix incremental build fingerprint invalidation
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

This commit is contained in:
mes123456
2026-09-07 18:56:30 +08:00
parent ca2695b92f
commit 39b188c574
2 changed files with 7 additions and 4 deletions

View File

@@ -32,12 +32,15 @@ export function inputFiles() {
export function fingerprint() { export function fingerprint() {
const hash = crypto.createHash("sha256"); const hash = crypto.createHash("sha256");
for (const file of inputFiles()) { for (const file of inputFiles()) {
const stat = fs.statSync(file); // Read nanosecond metadata as bigint. Without the explicit option
// `mtimeNs` is undefined in Node, so same-sized edits can reuse stale
// bundles indefinitely.
const stat = fs.statSync(file, { bigint: true });
hash.update(path.relative(root, file)); hash.update(path.relative(root, file));
hash.update("\0"); hash.update("\0");
hash.update(String(stat.size)); hash.update(stat.size.toString());
hash.update("\0"); hash.update("\0");
hash.update(String(stat.mtimeNs)); hash.update(stat.mtimeNs.toString());
hash.update("\n"); hash.update("\n");
} }
return hash.digest("hex"); return hash.digest("hex");

View File

@@ -28,7 +28,7 @@ button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-
.topbar-actions button:disabled { color: #606060; background: transparent; cursor: default; } .topbar-actions button:disabled { color: #606060; background: transparent; cursor: default; }
.workspace-tabs { flex: 1 1 auto; align-self: stretch; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; } .workspace-tabs { flex: 1 1 auto; align-self: stretch; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.workspace-tabs::-webkit-scrollbar, .topbar::-webkit-scrollbar, .workspace-toolbar::-webkit-scrollbar { display: none; } .workspace-tabs::-webkit-scrollbar, .topbar::-webkit-scrollbar, .workspace-toolbar::-webkit-scrollbar { display: none; }
.workspace-tab { flex: none; min-width: auto; padding-inline: 9px; border: 0; border-radius: 0; font-size: 10px; } .workspace-tab { flex: none; min-width: auto; padding-inline: 6px; border: 0; border-radius: 0; font-size: 10px; }
.workspace-tab.active { color: #fff; background: #303030; box-shadow: inset 0 -2px #4c94c8; } .workspace-tab.active { color: #fff; background: #303030; box-shadow: inset 0 -2px #4c94c8; }
.workspace-add { flex: none; width: 24px; padding: 0; font-size: 16px; } .workspace-add { flex: none; width: 24px; padding: 0; font-size: 16px; }
.topbar-actions { flex: none; margin-left: auto; } .topbar-actions { flex: none; margin-left: auto; }