zyrk 0.6.0 → 0.6.2
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/VERSION +1 -1
- package/dist/store/realize.d.ts.map +1 -1
- package/dist/store/realize.js +13 -15
- package/package.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
v0.6.
|
|
1
|
+
v0.6.2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realize.d.ts","sourceRoot":"","sources":["../../src/store/realize.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"realize.d.ts","sourceRoot":"","sources":["../../src/store/realize.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAGL,KAAK,QAAQ,EAEd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAOpC;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,aAAa,GAAG;IAC1B,sEAAsE;IACtE,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,mEAAmE;IACnE,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE;IAC1C,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qFAAqF;IACrF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,OAAO,CAAC,aAAa,CAAC,CAwGzB;AA2KD,2FAA2F;AAC3F,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,QAAQ,GACd,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA2ErB;AAED,iGAAiG;AACjG,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAQT"}
|
package/dist/store/realize.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { chmod, link as fsLink, lstat, readdir, rename, symlink as fsSymlink, } from "node:fs/promises";
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import { ZyrkError } from "../errors.js";
|
|
4
|
-
import { fsyncDir,
|
|
4
|
+
import { fsyncDir, mkdirp, pathExists, rmrfNoFollow } from "../util/fsx.js";
|
|
5
5
|
import { contextIdFor, graphHash, } from "./graph.js";
|
|
6
6
|
import { Store } from "./layout.js";
|
|
7
7
|
import { openStoreDb } from "./db.js";
|
|
@@ -78,15 +78,13 @@ export async function realizeGraph(options) {
|
|
|
78
78
|
if (!published) {
|
|
79
79
|
// A concurrent publisher won the race; their tree is verified
|
|
80
80
|
// before it is trusted, exactly like any other reuse.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
});
|
|
89
|
-
}
|
|
81
|
+
await verifyRealization({
|
|
82
|
+
store,
|
|
83
|
+
graph,
|
|
84
|
+
rootKey: node.key,
|
|
85
|
+
contextId,
|
|
86
|
+
realizationDirs: directoryByKey,
|
|
87
|
+
});
|
|
90
88
|
result.reused.push(contextId);
|
|
91
89
|
continue;
|
|
92
90
|
}
|
|
@@ -218,11 +216,11 @@ async function publishRealization(contextDir, stagingContext) {
|
|
|
218
216
|
await rename(stagingContext, contextDir);
|
|
219
217
|
}
|
|
220
218
|
catch (error) {
|
|
221
|
-
if ((
|
|
222
|
-
|
|
223
|
-
//
|
|
224
|
-
//
|
|
225
|
-
//
|
|
219
|
+
if (await pathExists(contextDir).catch(() => false)) {
|
|
220
|
+
// Filesystems can report different rename errors when a concurrent
|
|
221
|
+
// publisher installs a read-only destination. Existence only selects
|
|
222
|
+
// the race path: the caller must fully verify this tree before reuse,
|
|
223
|
+
// even when the optional payload-verification measurement is disabled.
|
|
226
224
|
await rmrfNoFollow(stagingContext);
|
|
227
225
|
await fsyncDir(path.dirname(contextDir));
|
|
228
226
|
return false;
|