@vzn/vx-reapi 0.0.629 → 0.0.631
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/package.json +2 -2
- package/src/executor.ts +9 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx-reapi",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.631",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Bazel Remote Execution API plugin for vx — remote cache (ActionCache + CAS) against NativeLink, BuildBuddy, Buildbarn or bazel-remote.",
|
|
6
6
|
"keywords": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@vzn/vx": "^0.0.
|
|
42
|
+
"@vzn/vx": "^0.0.631"
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
45
45
|
"type": "git",
|
package/src/executor.ts
CHANGED
|
@@ -1379,7 +1379,6 @@ export async function materialiseOutputs(
|
|
|
1379
1379
|
warn: (m: string) => void,
|
|
1380
1380
|
created?: string[],
|
|
1381
1381
|
): Promise<void> {
|
|
1382
|
-
const files = result.output_files ?? []
|
|
1383
1382
|
// A glob with a wildcard FIRST segment has no REAPI spelling, so it is sent
|
|
1384
1383
|
// as '' — whole-working-directory capture — and the worker returns inputs
|
|
1385
1384
|
// and undeclared siblings alongside the real outputs. There is no way to
|
|
@@ -1419,9 +1418,16 @@ export async function materialiseOutputs(
|
|
|
1419
1418
|
const rel = toPosix(path.relative(req.workspaceRoot, abs))
|
|
1420
1419
|
return declared.includes(rel) || matchers.some((m) => m.match(rel))
|
|
1421
1420
|
}
|
|
1421
|
+
const fence = new Fence(req.workspaceRoot)
|
|
1422
|
+
// A file or link no declared glob names is neither fetched nor written:
|
|
1423
|
+
// the workspace root was the only fence, so a result (or a record planted
|
|
1424
|
+
// in the action cache) could write `.git/hooks/post-checkout` 0755 or
|
|
1425
|
+
// another project's sources. Core's remote ingest refuses the same.
|
|
1426
|
+
const files = (result.output_files ?? []).filter((f) =>
|
|
1427
|
+
isDeclared(fence.lexical(req.cwd, f.path)),
|
|
1428
|
+
)
|
|
1422
1429
|
// Batch the small ones into one round trip; anything larger goes over
|
|
1423
1430
|
// ByteStream, which is also the only path that can be compressed.
|
|
1424
|
-
const fence = new Fence(req.workspaceRoot)
|
|
1425
1431
|
const small = files.filter((f) => f.digest.size_bytes > 0 && f.digest.size_bytes <= 1024 * 1024)
|
|
1426
1432
|
const batched = await client.batchReadBlobs(small.map((f) => f.digest))
|
|
1427
1433
|
|
|
@@ -1459,6 +1465,7 @@ export async function materialiseOutputs(
|
|
|
1459
1465
|
// it as a copy would silently change what the next task sees.
|
|
1460
1466
|
for (const sl of result.output_symlinks ?? []) {
|
|
1461
1467
|
const abs = fence.lexical(req.cwd, sl.path)
|
|
1468
|
+
if (!isDeclared(abs)) continue
|
|
1462
1469
|
await fence.dir(path.dirname(abs))
|
|
1463
1470
|
await makeDir(path.dirname(abs), created)
|
|
1464
1471
|
await fence.symlink(sl.target, abs, created)
|