Skip to content

Commit 68c3c66

Browse files
committed
🚸 platform-independent temporary dir
Signed-off-by: burgholzer <burgholzer@me.com>
1 parent 9521608 commit 68c3c66

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

‎dist/index.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34930,6 +34930,9 @@ var external_node_path_default = /*#__PURE__*/__nccwpck_require__.n(external_nod
3493034930
;// CONCATENATED MODULE: external "node:fs"
3493134931
const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs");
3493234932
var external_node_fs_default = /*#__PURE__*/__nccwpck_require__.n(external_node_fs_namespaceObject);
34933+
;// CONCATENATED MODULE: external "node:os"
34934+
const external_node_os_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os");
34935+
var external_node_os_default = /*#__PURE__*/__nccwpck_require__.n(external_node_os_namespaceObject);
3493334936
;// CONCATENATED MODULE: external "node:child_process"
3493434937
const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process");
3493534938
;// CONCATENATED MODULE: ./src/index.ts
@@ -34958,6 +34961,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
3495834961

3495934962

3496034963

34964+
3496134965
/**
3496234966
* Setup MLIR toolchain
3496334967
* @returns {Promise<void>}
@@ -35007,7 +35011,7 @@ async function run() {
3500735011
core.debug(`==> Downloading LLVM asset: ${asset.url}`);
3500835012
const file = await tool_cache.downloadTool(asset.url);
3500935013
core.debug("==> Decompressing and extracting LLVM distribution");
35010-
const extractDir = external_node_path_default().join((external_node_process_default()).env.RUNNER_TEMP || "/tmp", `mlir-extract-${Date.now()}`);
35014+
const extractDir = external_node_path_default().join((external_node_process_default()).env.RUNNER_TEMP || external_node_os_default().tmpdir(), `mlir-extract-${Date.now()}`);
3501135015
await io.mkdirP(extractDir);
3501235016
// Extract the archive to a specific directory
3501335017
const extractedDir = external_node_path_default().join(extractDir, "extracted");

‎dist/index.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/index.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import getDownloadLink, { getZstdLink } from "./get-download-link.js";
2323
import path from "node:path";
2424
import process from "node:process";
2525
import fs from "node:fs";
26+
import os from "node:os";
2627
import { spawn } from "node:child_process";
2728

2829
/**
@@ -97,7 +98,7 @@ export async function run(): Promise<void> {
9798

9899
core.debug("==> Decompressing and extracting LLVM distribution");
99100
const extractDir = path.join(
100-
process.env.RUNNER_TEMP || "/tmp",
101+
process.env.RUNNER_TEMP || os.tmpdir(),
101102
`mlir-extract-${Date.now()}`,
102103
);
103104
await io.mkdirP(extractDir);

0 commit comments

Comments
 (0)