Skip to content

Commit a26f3d3

Browse files
committed
fix(onnx): give SOURCE_COMMIT a use, instead of a lint suppression
Lint caught it and was right: `SOURCE_COMMIT` existed only to be read out of this file by a `sed` in the workflow, which makes it dead as far as this module is concerned and fragile as a design — nothing in the file explains why it cannot be deleted. It now prints when the fetched artifact is one we built (`spec.baseUrl` set): built here from microsoft/onnxruntime@df2ba1cf… which is the line somebody wants when the binary no longer carries Microsoft's name and they are trying to work out what it came from. The upstream path is unchanged and prints nothing extra, because for an upstream artifact the URL already says. Exercised, not assumed: `node scripts/fetch-onnxruntime.mjs --force` downloads, verifies and vendors as before, exit 0, and the new line stays quiet because the upstream entry has no `baseUrl`.
1 parent 06937ca commit a26f3d3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎scripts/fetch-onnxruntime.mjs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,13 @@ async function main() {
325325
if (targetPlatform !== "win32") fs.chmodSync(dest, 0o755);
326326

327327
console.log(` ${banner}`);
328+
// Où que viennent les octets, dire de quelle source ils sortent. Pour un artefact
329+
// amont c'est le tag ; pour un que nous avons construit (`baseUrl`), c'est le commit
330+
// que le workflow a compilé, et c'est la seule chose qui rend le binaire traçable
331+
// une fois qu'il ne porte plus le nom de Microsoft.
332+
if (spec.baseUrl) {
333+
console.log(` built here from microsoft/onnxruntime@${SOURCE_COMMIT}`);
334+
}
328335
console.log(`\nVendored -> ${dest}`);
329336
} finally {
330337
fs.rmSync(tmp, { recursive: true, force: true });

0 commit comments

Comments
 (0)