Guard staged prefix stripping
This commit is contained in:
@@ -4694,10 +4694,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
function stripInterpIniContextStagingPrefix(name, wasmPath) {
|
||||
const prefix = `/work/browser-interp/${name}/`;
|
||||
if (!wasmPath.startsWith(prefix)) {
|
||||
throw new Error(`browser_interp_${name}_staging_prefix: path drift ${wasmPath}`);
|
||||
}
|
||||
return wasmPath.slice(prefix.length);
|
||||
}
|
||||
|
||||
function assertInterpIniContextNgcStaging(name, files, plan) {
|
||||
const stagedNgcFiles = plan.files
|
||||
.filter((file) => file.sourceRel.endsWith(".ngc"))
|
||||
.map((file) => file.wasmPath.replace(`/work/browser-interp/${name}/`, ""))
|
||||
.map((file) => stripInterpIniContextStagingPrefix(name, file.wasmPath))
|
||||
.sort();
|
||||
if (stagedNgcFiles.join(",") !== files.join(",")) {
|
||||
throw new Error(`browser_interp_${name}_staging_manifest: list drift`);
|
||||
|
||||
Reference in New Issue
Block a user