@rightkit/release 0.6.70 → 0.6.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/rightkit-gate.mjs +11 -2
- package/package.json +1 -1
- package/rightkit-versions.json +1 -1
package/bin/rightkit-gate.mjs
CHANGED
|
@@ -2905,10 +2905,17 @@ export async function stageSidecarsOnce({ o, ds, root, git = null, configs, appD
|
|
|
2905
2905
|
const keyOf = (parts) => (parts ? createHash("sha256").update(JSON.stringify(parts)).digest("hex") : null);
|
|
2906
2906
|
const keyNow = (dirs) => keyOf(partsNow(dirs));
|
|
2907
2907
|
const nowParts = prior?.schema === 2 ? partsNow(prior.dirs) : null;
|
|
2908
|
+
// The snapshot sync removes ignored outputs (app/src-tauri/binaries/) when the commit changes (acceptance case 3 on 0.6.70). When the sources are those of
|
|
2909
|
+
// the last staging, its kept copy is put back, as the web build's dist cache is; stage-sidecar --if-stale then checks the files and builds nothing.
|
|
2910
|
+
const keptDir = stateFile.replace(/\.json$/, ".files");
|
|
2911
|
+
if (prior?.schema === 2 && nowParts && keyOf(nowParts) === prior.key && Array.isArray(prior.kept) && typeof prior.receipt === "string" && !fs.existsSync(path.join(ds.path, prior.receipt))) {
|
|
2912
|
+
try { for (const rel of prior.kept) { const from = path.join(keptDir, ...rel.split("/")); const to = path.join(ds.path, ...rel.split("/")); fs.mkdirSync(path.dirname(to), { recursive: true }); fs.copyFileSync(from, to); const st = fs.statSync(from); fs.utimesSync(to, st.atime, st.mtime); } }
|
|
2913
|
+
catch (e) { o.out(tag + " [" + stage + "] stage-sidecar " + config + ": the kept staging could not be put back (" + e.message + ")"); }
|
|
2914
|
+
}
|
|
2908
2915
|
const receiptNow = prior?.schema === 2 && typeof prior.receipt === "string" ? stagedFilesDigest(path.join(ds.path, prior.receipt)) : null;
|
|
2909
2916
|
const unchanged = Boolean(prior?.schema === 2 && nowParts && keyOf(nowParts) === prior.key && receiptNow === prior.receiptSha256);
|
|
2910
2917
|
// Why it stages again, in one line, so a missed reuse can be traced from the run's own output.
|
|
2911
|
-
if (!unchanged) o.out(tag + " [" + stage + "] stage-sidecar " + config + " builds: " + (prior?.schema !== 2 ? "no earlier staging is recorded" : !nowParts ? "its sources cannot be read from the commit" : keyOf(nowParts) !== prior.key ? "changed since the last staging: " + (Object.keys(nowParts).filter((k) => nowParts[k] !== prior.parts?.[k]).join(", ") || "unknown part") : "the staged receipt is not the one recorded"));
|
|
2918
|
+
if (!unchanged) o.out(tag + " [" + stage + "] stage-sidecar " + config + " builds: " + (prior?.schema !== 2 ? "no earlier staging is recorded" : !nowParts ? "its sources cannot be read from the commit" : keyOf(nowParts) !== prior.key ? "changed since the last staging: " + (Object.keys(nowParts).filter((k) => nowParts[k] !== prior.parts?.[k]).join(", ") || "unknown part") : "the staged receipt is not the one recorded (recorded " + String(prior.receiptSha256).slice(0, 12) + ", now " + (receiptNow === null ? (fs.existsSync(path.join(ds.path, prior.receipt)) ? "unreadable" : "absent") + " at " + path.join(ds.path, prior.receipt) : String(receiptNow).slice(0, 12)) + ")"));
|
|
2912
2919
|
let r;
|
|
2913
2920
|
try {
|
|
2914
2921
|
o.out(`${tag} [${stage}] right-release stage-sidecar --config ${path.join(ds.path, config)}${target ? ` --target ${target}` : ""}${unchanged ? " --if-stale (its sources are those of the last staging: the staged files are checked, nothing is built)" : ""} (from the snapshot ${ds.path})`);
|
|
@@ -2938,7 +2945,9 @@ export async function stageSidecarsOnce({ o, ds, root, git = null, configs, appD
|
|
|
2938
2945
|
// The sources this staging was built from, for the next run (NN07). Not recordable (a sidecar not built by Cargo, a package not found): the state is removed.
|
|
2939
2946
|
try {
|
|
2940
2947
|
const dirs = git ? sidecarSourceDirs({ git, commit, result }) : null; const k = dirs ? keyNow(dirs) : null; const sha = receiptAbs ? stagedFilesDigest(path.join(ds.path, receiptAbs)) : null;
|
|
2941
|
-
|
|
2948
|
+
let kept = null;
|
|
2949
|
+
if (k && sha) { try { const files = [receiptAbs, ...(Array.isArray(result?.files) ? result.files.map((x) => (typeof x?.path === "string" ? underApp(x.path) : null)).filter(Boolean) : [])]; fs.rmSync(keptDir, { recursive: true, force: true }); for (const rel of files) { const from = path.join(ds.path, ...rel.split("/")); const to = path.join(keptDir, ...rel.split("/")); fs.mkdirSync(path.dirname(to), { recursive: true }); fs.copyFileSync(from, to); const st = fs.statSync(from); fs.utimesSync(to, st.atime, st.mtime); } kept = files; } catch (e) { kept = null; o.out(tag + " [" + stage + "] stage-sidecar " + config + ": the staging was not kept (" + e.message + "); the next run builds again"); } }
|
|
2950
|
+
if (k && sha) { fs.mkdirSync(path.dirname(stateFile), { recursive: true }); const tmp = `${stateFile}.${process.pid}.tmp`; fs.writeFileSync(tmp, `${JSON.stringify({ schema: 2, key: k, parts: partsNow(dirs), dirs, receipt: receiptAbs, receiptSha256: sha, ...(kept ? { kept } : {}) })}\n`); fs.renameSync(tmp, stateFile); }
|
|
2942
2951
|
else fs.rmSync(stateFile, { force: true });
|
|
2943
2952
|
} catch (e) { o.out(`${tag} [${stage}] stage-sidecar ${config}: the staging state was not recorded (${e.message}); the next run stages again`); }
|
|
2944
2953
|
}
|
package/package.json
CHANGED
package/rightkit-versions.json
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@rightkit/qa": "0.7.0",
|
|
50
50
|
"@rightkit/qa-chrome": "0.1.12",
|
|
51
51
|
"@rightkit/react-shell": "0.7.7",
|
|
52
|
-
"@rightkit/release": "0.6.
|
|
52
|
+
"@rightkit/release": "0.6.71",
|
|
53
53
|
"@rightkit/send-ui": "0.1.0",
|
|
54
54
|
"@rightkit/settings-ui": "0.7.5",
|
|
55
55
|
"@rightkit/social-ui": "0.2.1",
|