diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ccfe1823..40ecb1e2 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -12,38 +12,28 @@ permissions: read-all jobs: hygiene: name: Hygiene - runs-on: ubuntu-latest - steps: - name: Checkout tree uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Set-up Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: check-latest: true node-version-file: .nvmrc - - run: corepack enable - - run: yarn install --immutable - - if: always() run: yarn lint - - if: always() run: yarn typecheck - - name: Ensure dist directory is up-to-date if: always() run: yarn build && git diff --exit-code --ignore-cr-at-eol test: name: Test - needs: hygiene - strategy: fail-fast: false matrix: @@ -63,17 +53,30 @@ jobs: - os: ubuntu-24.04 ocaml-compiler: "5.3" allow-prerelease-opam: true - runs-on: ${{ matrix.os }} - steps: - name: Checkout tree uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Set-up OCaml ${{ matrix.ocaml-compiler }} uses: ./ with: ocaml-compiler: ${{ matrix.ocaml-compiler }} allow-prerelease-opam: ${{ matrix.allow-prerelease-opam }} + - run: opam install ssl + test-container: + name: Test on a container in a GitHub runner + needs: hygiene + runs-on: ubuntu-latest + container: + image: archlinux:latest + steps: + - name: Checkout tree + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Install dependencies + run: pacman -Sy --noconfirm make gcc patch tar ca-certificates git rsync curl sudo bash nano coreutils xz ncurses diffutils unzip bubblewrap + - name: Set-up OCaml + uses: ./ + with: + ocaml-compiler: "5.3" - run: opam install ssl diff --git a/dist/index.cjs b/dist/index.cjs index 3689a953..d035ac8f 100644 --- a/dist/index.cjs +++ b/dist/index.cjs @@ -185,7 +185,7 @@ var require_file_command = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; var crypto2 = __importStar2(require("crypto")); - var fs4 = __importStar2(require("fs")); + var fs5 = __importStar2(require("fs")); var os3 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { @@ -193,10 +193,10 @@ var require_file_command = __commonJS({ if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs4.existsSync(filePath)) { + if (!fs5.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs4.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os3.EOL}`, { + fs5.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os3.EOL}`, { encoding: "utf8" }); } @@ -7250,7 +7250,7 @@ var require_client = __commonJS({ ); resume(client); } - var constants2 = require_constants3(); + var constants3 = require_constants3(); var createRedirectInterceptor = require_redirectInterceptor(); var EMPTY_BUF = Buffer.alloc(0); async function lazyllhttp() { @@ -7317,7 +7317,7 @@ var require_client = __commonJS({ constructor(client, socket, { exports: exports3 }) { assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); this.llhttp = exports3; - this.ptr = this.llhttp.llhttp_alloc(constants2.TYPE.RESPONSE); + this.ptr = this.llhttp.llhttp_alloc(constants3.TYPE.RESPONSE); this.client = client; this.socket = socket; this.timeout = null; @@ -7409,19 +7409,19 @@ var require_client = __commonJS({ currentBufferRef = null; } const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; - if (ret === constants2.ERROR.PAUSED_UPGRADE) { + if (ret === constants3.ERROR.PAUSED_UPGRADE) { this.onUpgrade(data2.slice(offset)); - } else if (ret === constants2.ERROR.PAUSED) { + } else if (ret === constants3.ERROR.PAUSED) { this.paused = true; socket.unshift(data2.slice(offset)); - } else if (ret !== constants2.ERROR.OK) { + } else if (ret !== constants3.ERROR.OK) { const ptr = llhttp.llhttp_get_error_reason(this.ptr); let message = ""; if (ptr) { const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; } - throw new HTTPParserError(message, constants2.ERROR[ret], data2.slice(offset)); + throw new HTTPParserError(message, constants3.ERROR[ret], data2.slice(offset)); } } catch (err) { util.destroy(socket, err); @@ -7591,7 +7591,7 @@ var require_client = __commonJS({ socket[kBlocking] = false; resume(client); } - return pause ? constants2.ERROR.PAUSED : 0; + return pause ? constants3.ERROR.PAUSED : 0; } onBody(buf) { const { client, socket, statusCode, maxResponseSize } = this; @@ -7613,7 +7613,7 @@ var require_client = __commonJS({ } this.bytesRead += buf.length; if (request.onData(buf) === false) { - return constants2.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } } onMessageComplete() { @@ -7648,13 +7648,13 @@ var require_client = __commonJS({ if (socket[kWriting]) { assert.strictEqual(client[kRunning], 0); util.destroy(socket, new InformationalError("reset")); - return constants2.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } else if (!shouldKeepAlive) { util.destroy(socket, new InformationalError("reset")); - return constants2.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } else if (socket[kReset] && client[kRunning] === 0) { util.destroy(socket, new InformationalError("reset")); - return constants2.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } else if (client[kPipelining] === 1) { setImmediate(resume, client); } else { @@ -18148,7 +18148,7 @@ var require_summary = __commonJS({ exports2.summary = exports2.markdownSummary = exports2.SUMMARY_DOCS_URL = exports2.SUMMARY_ENV_VAR = void 0; var os_1 = require("os"); var fs_1 = require("fs"); - var { access: access2, appendFile, writeFile: writeFile3 } = fs_1.promises; + var { access: access3, appendFile, writeFile: writeFile3 } = fs_1.promises; exports2.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; exports2.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary"; var Summary = class { @@ -18171,7 +18171,7 @@ var require_summary = __commonJS({ throw new Error(`Unable to find environment variable for $${exports2.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); } try { - yield access2(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + yield access3(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); } catch (_a4) { throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } @@ -18513,12 +18513,12 @@ var require_io_util = __commonJS({ var _a4; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getCmdPath = exports2.tryGetExecutablePath = exports2.isRooted = exports2.isDirectory = exports2.exists = exports2.READONLY = exports2.UV_FS_O_EXLOCK = exports2.IS_WINDOWS = exports2.unlink = exports2.symlink = exports2.stat = exports2.rmdir = exports2.rm = exports2.rename = exports2.readlink = exports2.readdir = exports2.open = exports2.mkdir = exports2.lstat = exports2.copyFile = exports2.chmod = void 0; - var fs4 = __importStar2(require("fs")); + var fs5 = __importStar2(require("fs")); var path6 = __importStar2(require("path")); - _a4 = fs4.promises, exports2.chmod = _a4.chmod, exports2.copyFile = _a4.copyFile, exports2.lstat = _a4.lstat, exports2.mkdir = _a4.mkdir, exports2.open = _a4.open, exports2.readdir = _a4.readdir, exports2.readlink = _a4.readlink, exports2.rename = _a4.rename, exports2.rm = _a4.rm, exports2.rmdir = _a4.rmdir, exports2.stat = _a4.stat, exports2.symlink = _a4.symlink, exports2.unlink = _a4.unlink; + _a4 = fs5.promises, exports2.chmod = _a4.chmod, exports2.copyFile = _a4.copyFile, exports2.lstat = _a4.lstat, exports2.mkdir = _a4.mkdir, exports2.open = _a4.open, exports2.readdir = _a4.readdir, exports2.readlink = _a4.readlink, exports2.rename = _a4.rename, exports2.rm = _a4.rm, exports2.rmdir = _a4.rmdir, exports2.stat = _a4.stat, exports2.symlink = _a4.symlink, exports2.unlink = _a4.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs4.constants.O_RDONLY; + exports2.READONLY = fs5.constants.O_RDONLY; function exists(fsPath) { return __awaiter2(this, void 0, void 0, function* () { try { @@ -21321,7 +21321,7 @@ var require_internal_globber = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; var core8 = __importStar2(require_core()); - var fs4 = __importStar2(require("fs")); + var fs5 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); var path6 = __importStar2(require("path")); var patternHelper = __importStar2(require_internal_pattern_helper()); @@ -21373,7 +21373,7 @@ var require_internal_globber = __commonJS({ for (const searchPath of patternHelper.getSearchPaths(patterns)) { core8.debug(`Search path '${searchPath}'`); try { - yield __await2(fs4.promises.lstat(searchPath)); + yield __await2(fs5.promises.lstat(searchPath)); } catch (err) { if (err.code === "ENOENT") { continue; @@ -21404,7 +21404,7 @@ var require_internal_globber = __commonJS({ continue; } const childLevel = item.level + 1; - const childItems = (yield __await2(fs4.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path6.join(item.path, x), childLevel)); + const childItems = (yield __await2(fs5.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path6.join(item.path, x), childLevel)); stack.push(...childItems.reverse()); } else if (match & internal_match_kind_1.MatchKind.File) { yield yield __await2(item.path); @@ -21439,7 +21439,7 @@ var require_internal_globber = __commonJS({ let stats; if (options.followSymbolicLinks) { try { - stats = yield fs4.promises.stat(item.path); + stats = yield fs5.promises.stat(item.path); } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { @@ -21451,10 +21451,10 @@ var require_internal_globber = __commonJS({ throw err; } } else { - stats = yield fs4.promises.lstat(item.path); + stats = yield fs5.promises.lstat(item.path); } if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs4.promises.realpath(item.path); + const realPath = yield fs5.promises.realpath(item.path); while (traversalChain.length >= item.level) { traversalChain.pop(); } @@ -22788,7 +22788,7 @@ var require_cacheUtils = __commonJS({ var glob2 = __importStar2(require_glob()); var io2 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); - var fs4 = __importStar2(require("fs")); + var fs5 = __importStar2(require("fs")); var path6 = __importStar2(require("path")); var semver4 = __importStar2(require_semver()); var util = __importStar2(require("util")); @@ -22818,7 +22818,7 @@ var require_cacheUtils = __commonJS({ } exports2.createTempDirectory = createTempDirectory; function getArchiveFileSizeInBytes(filePath) { - return fs4.statSync(filePath).size; + return fs5.statSync(filePath).size; } exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; function resolvePaths(patterns) { @@ -22858,7 +22858,7 @@ var require_cacheUtils = __commonJS({ exports2.resolvePaths = resolvePaths; function unlinkFile(filePath) { return __awaiter2(this, void 0, void 0, function* () { - return util.promisify(fs4.unlink)(filePath); + return util.promisify(fs5.unlink)(filePath); }); } exports2.unlinkFile = unlinkFile; @@ -22903,7 +22903,7 @@ var require_cacheUtils = __commonJS({ exports2.getCacheFileName = getCacheFileName; function getGnuTarPathOnWindows() { return __awaiter2(this, void 0, void 0, function* () { - if (fs4.existsSync(constants_1.GnuTarPathOnWindows)) { + if (fs5.existsSync(constants_1.GnuTarPathOnWindows)) { return constants_1.GnuTarPathOnWindows; } const versionOutput = yield getVersion("tar"); @@ -34456,7 +34456,7 @@ var require_dist4 = __commonJS({ var stream2 = require("stream"); var coreLro = require_commonjs11(); var events = require("events"); - var fs4 = require("fs"); + var fs5 = require("fs"); var util = require("util"); var buffer = require("buffer"); function _interopNamespaceDefault(e) { @@ -34479,7 +34479,7 @@ var require_dist4 = __commonJS({ } var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs4); + var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs5); var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); var logger = logger$1.createClientLogger("storage-blob"); var BaseRequestPolicy = class { @@ -45164,7 +45164,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var access2 = { + var access3 = { parameterPath: ["options", "access"], mapper: { serializedName: "x-ms-blob-public-access", @@ -46972,7 +46972,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; requestId, accept1, metadata, - access2, + access3, defaultEncryptionScope, preventEncryptionScopeOverride ], @@ -47119,7 +47119,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; accept, version, requestId, - access2, + access3, leaseId, ifModifiedSince, ifUnmodifiedSince @@ -56012,7 +56012,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param containerAcl - Array of elements each having a unique Id and details of the access policy. * @param options - Options to Container Set Access Policy operation. */ - async setAccessPolicy(access3, containerAcl2, options = {}) { + async setAccessPolicy(access4, containerAcl2, options = {}) { options.conditions = options.conditions || {}; return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { const acl = []; @@ -56028,7 +56028,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } return assertResponse(await this.containerContext.setAccessPolicy({ abortSignal: options.abortSignal, - access: access3, + access: access4, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, @@ -58537,7 +58537,7 @@ var require_downloadUtils = __commonJS({ var http_client_1 = require_lib(); var storage_blob_1 = require_dist4(); var buffer = __importStar2(require("buffer")); - var fs4 = __importStar2(require("fs")); + var fs5 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); var utils = __importStar2(require_cacheUtils()); @@ -58648,7 +58648,7 @@ var require_downloadUtils = __commonJS({ exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { return __awaiter2(this, void 0, void 0, function* () { - const writeStream = fs4.createWriteStream(archivePath); + const writeStream = fs5.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.get(archiveLocation); @@ -58674,7 +58674,7 @@ var require_downloadUtils = __commonJS({ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { var _a4; return __awaiter2(this, void 0, void 0, function* () { - const archiveDescriptor = yield fs4.promises.open(archivePath, "w"); + const archiveDescriptor = yield fs5.promises.open(archivePath, "w"); const httpClient = new http_client_1.HttpClient("actions/cache", void 0, { socketTimeout: options.timeoutInMs, keepAlive: true @@ -58791,7 +58791,7 @@ var require_downloadUtils = __commonJS({ } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); const downloadProgress = new DownloadProgress(contentLength); - const fd = fs4.openSync(archivePath, "w"); + const fd = fs5.openSync(archivePath, "w"); try { downloadProgress.startDisplayTimer(); const controller = new abort_controller_1.AbortController(); @@ -58809,12 +58809,12 @@ var require_downloadUtils = __commonJS({ controller.abort(); throw new Error("Aborting cache download as the download time exceeded the timeout."); } else if (Buffer.isBuffer(result2)) { - fs4.writeFileSync(fd, result2); + fs5.writeFileSync(fd, result2); } } } finally { downloadProgress.stopDisplayTimer(); - fs4.closeSync(fd); + fs5.closeSync(fd); } } }); @@ -59112,7 +59112,7 @@ var require_cacheHttpClient = __commonJS({ var core8 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); - var fs4 = __importStar2(require("fs")); + var fs5 = __importStar2(require("fs")); var url_1 = require("url"); var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); @@ -59250,7 +59250,7 @@ Other caches with similar key:`); return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs4.openSync(archivePath, "r"); + const fd = fs5.openSync(archivePath, "r"); const uploadOptions = (0, options_1.getUploadOptions)(options); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); @@ -59264,7 +59264,7 @@ Other caches with similar key:`); const start = offset; const end2 = offset + chunkSize - 1; offset += maxChunkSize; - yield uploadChunk(httpClient, resourceUrl, () => fs4.createReadStream(archivePath, { + yield uploadChunk(httpClient, resourceUrl, () => fs5.createReadStream(archivePath, { fd, start, end: end2, @@ -59275,7 +59275,7 @@ Other caches with similar key:`); } }))); } finally { - fs4.closeSync(fd); + fs5.closeSync(fd); } return; }); @@ -69780,7 +69780,7 @@ var require_util10 = __commonJS({ "../../node_modules/systeminformation/lib/util.js"(exports2) { "use strict"; var os3 = require("os"); - var fs4 = require("fs"); + var fs5 = require("fs"); var path6 = require("path"); var spawn = require("child_process").spawn; var exec7 = require("child_process").exec; @@ -70077,7 +70077,7 @@ var require_util10 = __commonJS({ _powerShell = "powershell.exe"; if (_windows) { const defaultPath = `${WINDIR}\\system32\\WindowsPowerShell\\v1.0\\powershell.exe`; - if (fs4.existsSync(defaultPath)) { + if (fs5.existsSync(defaultPath)) { _powerShell = defaultPath; } } @@ -70085,7 +70085,7 @@ var require_util10 = __commonJS({ function getWmic() { if (os3.type() === "Windows_NT" && !wmicPath) { wmicPath = WINDIR + "\\system32\\wbem\\wmic.exe"; - if (!fs4.existsSync(wmicPath)) { + if (!fs5.existsSync(wmicPath)) { try { const wmicPathArray = execSync("WHERE WMIC", execOptsWin).toString().split("\r\n"); if (wmicPathArray && wmicPathArray.length) { @@ -70370,7 +70370,7 @@ var require_util10 = __commonJS({ cpuinfo = _rpi_cpuinfo; } else if (cpuinfo === void 0) { try { - cpuinfo = fs4.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split("\n"); + cpuinfo = fs5.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split("\n"); _rpi_cpuinfo = cpuinfo; } catch (e) { return false; @@ -70383,7 +70383,7 @@ var require_util10 = __commonJS({ function isRaspbian() { let osrelease = []; try { - osrelease = fs4.readFileSync("/etc/os-release", { encoding: "utf8" }).toString().split("\n"); + osrelease = fs5.readFileSync("/etc/os-release", { encoding: "utf8" }).toString().split("\n"); } catch (e) { return false; } @@ -70401,9 +70401,9 @@ var require_util10 = __commonJS({ }); } function darwinXcodeExists() { - const cmdLineToolsExists = fs4.existsSync("/Library/Developer/CommandLineTools/usr/bin/"); - const xcodeAppExists = fs4.existsSync("/Applications/Xcode.app/Contents/Developer/Tools"); - const xcodeExists = fs4.existsSync("/Library/Developer/Xcode/"); + const cmdLineToolsExists = fs5.existsSync("/Library/Developer/CommandLineTools/usr/bin/"); + const xcodeAppExists = fs5.existsSync("/Applications/Xcode.app/Contents/Developer/Tools"); + const xcodeExists = fs5.existsSync("/Library/Developer/Xcode/"); return cmdLineToolsExists || xcodeExists || xcodeAppExists; } function nanoSeconds() { @@ -70521,8 +70521,8 @@ var require_util10 = __commonJS({ return ("00000000" + parseInt(hex, 16).toString(2)).substr(-8); } function getFilesInPath(source) { - const lstatSync = fs4.lstatSync; - const readdirSync = fs4.readdirSync; + const lstatSync = fs5.lstatSync; + const readdirSync = fs5.readdirSync; const join5 = path6.join; function isDirectory(source2) { return lstatSync(source2).isDirectory(); @@ -70553,7 +70553,7 @@ var require_util10 = __commonJS({ return []; } } - if (fs4.existsSync(source)) { + if (fs5.existsSync(source)) { return getFilesRecursively(source); } else { return []; @@ -70769,7 +70769,7 @@ var require_util10 = __commonJS({ cpuinfo = _rpi_cpuinfo; } else { try { - cpuinfo = fs4.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split("\n"); + cpuinfo = fs5.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split("\n"); _rpi_cpuinfo = cpuinfo; } catch (e) { return false; @@ -72324,7 +72324,7 @@ var require_osinfo = __commonJS({ "../../node_modules/systeminformation/lib/osinfo.js"(exports2) { "use strict"; var os3 = require("os"); - var fs4 = require("fs"); + var fs5 = require("fs"); var util = require_util10(); var exec7 = require("child_process").exec; var execSync = require("child_process").execSync; @@ -72651,7 +72651,7 @@ var require_osinfo = __commonJS({ function isUefiLinux() { return new Promise((resolve) => { process.nextTick(() => { - fs4.stat("/sys/firmware/efi", function(err) { + fs5.stat("/sys/firmware/efi", function(err) { if (!err) { return resolve(true); } else { @@ -72891,7 +72891,7 @@ var require_osinfo = __commonJS({ } if ({}.hasOwnProperty.call(appsObj.versions, "git")) { if (_darwin) { - const gitHomebrewExists = fs4.existsSync("/usr/local/Cellar/git") || fs4.existsSync("/opt/homebrew/bin/git"); + const gitHomebrewExists = fs5.existsSync("/usr/local/Cellar/git") || fs5.existsSync("/opt/homebrew/bin/git"); if (util.darwinXcodeExists() || gitHomebrewExists) { exec7("git --version", function(error2, stdout) { if (!error2) { @@ -73086,8 +73086,8 @@ var require_osinfo = __commonJS({ const stdout = execSync("sw_vers"); const lines = stdout.toString().split("\n"); const osVersion = util.getValue(lines, "ProductVersion", ":"); - const gitHomebrewExists1 = fs4.existsSync("/usr/local/Cellar/python"); - const gitHomebrewExists2 = fs4.existsSync("/opt/homebrew/bin/python"); + const gitHomebrewExists1 = fs5.existsSync("/usr/local/Cellar/python"); + const gitHomebrewExists2 = fs5.existsSync("/opt/homebrew/bin/python"); if (util.darwinXcodeExists() && util.semverCompare("12.0.1", osVersion) < 0 || gitHomebrewExists1 || gitHomebrewExists2) { const cmd2 = gitHomebrewExists1 ? "/usr/local/Cellar/python -V 2>&1" : gitHomebrewExists2 ? "/opt/homebrew/bin/python -V 2>&1" : "python -V 2>&1"; exec7(cmd2, function(error2, stdout2) { @@ -73115,7 +73115,7 @@ var require_osinfo = __commonJS({ } if ({}.hasOwnProperty.call(appsObj.versions, "python3")) { if (_darwin) { - const gitHomebrewExists = fs4.existsSync("/usr/local/Cellar/python3") || fs4.existsSync("/opt/homebrew/bin/python3"); + const gitHomebrewExists = fs5.existsSync("/usr/local/Cellar/python3") || fs5.existsSync("/opt/homebrew/bin/python3"); if (util.darwinXcodeExists() || gitHomebrewExists) { exec7("python3 -V 2>&1", function(error2, stdout) { if (!error2) { @@ -73139,7 +73139,7 @@ var require_osinfo = __commonJS({ } if ({}.hasOwnProperty.call(appsObj.versions, "pip")) { if (_darwin) { - const gitHomebrewExists = fs4.existsSync("/usr/local/Cellar/pip") || fs4.existsSync("/opt/homebrew/bin/pip"); + const gitHomebrewExists = fs5.existsSync("/usr/local/Cellar/pip") || fs5.existsSync("/opt/homebrew/bin/pip"); if (util.darwinXcodeExists() || gitHomebrewExists) { exec7("pip -V 2>&1", function(error2, stdout) { if (!error2) { @@ -73165,7 +73165,7 @@ var require_osinfo = __commonJS({ } if ({}.hasOwnProperty.call(appsObj.versions, "pip3")) { if (_darwin) { - const gitHomebrewExists = fs4.existsSync("/usr/local/Cellar/pip3") || fs4.existsSync("/opt/homebrew/bin/pip3"); + const gitHomebrewExists = fs5.existsSync("/usr/local/Cellar/pip3") || fs5.existsSync("/opt/homebrew/bin/pip3"); if (util.darwinXcodeExists() || gitHomebrewExists) { exec7("pip3 -V 2>&1", function(error2, stdout) { if (!error2) { @@ -73466,7 +73466,7 @@ echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`; result2.os = util.getValue(lines, "os").toLowerCase(); result2.hardware = util.getValue(lines, "hardware").toLowerCase(); if (!result2.hardware) { - const lines2 = fs4.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split("\n"); + const lines2 = fs5.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split("\n"); const serial = util.getValue(lines2, "serial"); result2.hardware = serial || ""; } @@ -73522,7 +73522,7 @@ echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`; var require_system = __commonJS({ "../../node_modules/systeminformation/lib/system.js"(exports2) { "use strict"; - var fs4 = require("fs"); + var fs5 = require("fs"); var os3 = require("os"); var util = require_util10(); var { uuid } = require_osinfo(); @@ -73677,7 +73677,7 @@ var require_system = __commonJS({ util.noop(); } } - if (fs4.existsSync("/.dockerenv") || fs4.existsSync("/.dockerinit")) { + if (fs5.existsSync("/.dockerenv") || fs5.existsSync("/.dockerinit")) { result2.model = "Docker Container"; } try { @@ -73705,7 +73705,7 @@ var require_system = __commonJS({ util.noop(); } if (result2.manufacturer === "" && result2.model === "Computer" && result2.version === "") { - fs4.readFile("/proc/cpuinfo", function(error3, stdout2) { + fs5.readFile("/proc/cpuinfo", function(error3, stdout2) { if (!error3) { let lines2 = stdout2.toString().split("\n"); result2.model = util.getValue(lines2, "hardware", ":", true).toUpperCase(); @@ -74309,7 +74309,7 @@ var require_cpu = __commonJS({ var os3 = require("os"); var exec7 = require("child_process").exec; var execSync = require("child_process").execSync; - var fs4 = require("fs"); + var fs5 = require("fs"); var util = require_util10(); var _platform = process.platform; var _linux = _platform === "linux" || _platform === "android"; @@ -75091,7 +75091,7 @@ var require_cpu = __commonJS({ result2.socket = "SOC"; } if (util.getValue(lines, "architecture") === "riscv64") { - const linesRiscV = fs4.readFileSync("/proc/cpuinfo").toString().split("\n"); + const linesRiscV = fs5.readFileSync("/proc/cpuinfo").toString().split("\n"); const uarch = util.getValue(linesRiscV, "uarch") || ""; if (uarch.indexOf(",") > -1) { const split = uarch.split(","); @@ -75482,9 +75482,9 @@ var require_cpu = __commonJS({ return; } } - fs4.stat("/sys/class/thermal/thermal_zone0/temp", function(err) { + fs5.stat("/sys/class/thermal/thermal_zone0/temp", function(err) { if (err === null) { - fs4.readFile("/sys/class/thermal/thermal_zone0/temp", function(error4, stdout3) { + fs5.readFile("/sys/class/thermal/thermal_zone0/temp", function(error4, stdout3) { if (!error4) { let lines2 = stdout3.toString().split("\n"); if (lines2.length > 0) { @@ -75692,7 +75692,7 @@ var require_cpu = __commonJS({ }); } if (!result2) { - fs4.readFile("/proc/cpuinfo", function(error3, stdout2) { + fs5.readFile("/proc/cpuinfo", function(error3, stdout2) { if (!error3) { let lines = stdout2.toString().split("\n"); result2 = util.getValue(lines, "features", ":", true).toLowerCase(); @@ -76196,7 +76196,7 @@ var require_memory = __commonJS({ var exec7 = require("child_process").exec; var execSync = require("child_process").execSync; var util = require_util10(); - var fs4 = require("fs"); + var fs5 = require("fs"); var _platform = process.platform; var _linux = _platform === "linux" || _platform === "android"; var _darwin = _platform === "darwin"; @@ -76258,7 +76258,7 @@ var require_memory = __commonJS({ }; if (_linux) { try { - fs4.readFile("/proc/meminfo", function(error2, stdout) { + fs5.readFile("/proc/meminfo", function(error2, stdout) { if (!error2) { const lines = stdout.toString().split("\n"); result2.total = parseInt(util.getValue(lines, "memtotal"), 10); @@ -76678,7 +76678,7 @@ var require_battery = __commonJS({ "../../node_modules/systeminformation/lib/battery.js"(exports2, module2) { "use strict"; var exec7 = require("child_process").exec; - var fs4 = require("fs"); + var fs5 = require("fs"); var util = require_util10(); var _platform = process.platform; var _linux = _platform === "linux" || _platform === "android"; @@ -76731,24 +76731,24 @@ var require_battery = __commonJS({ }; if (_linux) { let battery_path = ""; - if (fs4.existsSync("/sys/class/power_supply/BAT1/uevent")) { + if (fs5.existsSync("/sys/class/power_supply/BAT1/uevent")) { battery_path = "/sys/class/power_supply/BAT1/"; - } else if (fs4.existsSync("/sys/class/power_supply/BAT0/uevent")) { + } else if (fs5.existsSync("/sys/class/power_supply/BAT0/uevent")) { battery_path = "/sys/class/power_supply/BAT0/"; } let acConnected = false; let acPath = ""; - if (fs4.existsSync("/sys/class/power_supply/AC/online")) { + if (fs5.existsSync("/sys/class/power_supply/AC/online")) { acPath = "/sys/class/power_supply/AC/online"; - } else if (fs4.existsSync("/sys/class/power_supply/AC0/online")) { + } else if (fs5.existsSync("/sys/class/power_supply/AC0/online")) { acPath = "/sys/class/power_supply/AC0/online"; } if (acPath) { - const file = fs4.readFileSync(acPath); + const file = fs5.readFileSync(acPath); acConnected = file.toString().trim() === "1"; } if (battery_path) { - fs4.readFile(battery_path + "uevent", function(error2, stdout) { + fs5.readFile(battery_path + "uevent", function(error2, stdout) { if (!error2) { let lines = stdout.toString().split("\n"); result2.isCharging = util.getValue(lines, "POWER_SUPPLY_STATUS", "=").toLowerCase() === "charging"; @@ -76973,7 +76973,7 @@ var require_battery = __commonJS({ var require_graphics = __commonJS({ "../../node_modules/systeminformation/lib/graphics.js"(exports2) { "use strict"; - var fs4 = require("fs"); + var fs5 = require("fs"); var exec7 = require("child_process").exec; var execSync = require("child_process").execSync; var util = require_util10(); @@ -77337,12 +77337,12 @@ var require_graphics = __commonJS({ if (_windows) { try { const basePath = util.WINDIR + "\\System32\\DriverStore\\FileRepository"; - const candidateDirs = fs4.readdirSync(basePath).filter((dir) => { - return fs4.readdirSync([basePath, dir].join("/")).includes("nvidia-smi.exe"); + const candidateDirs = fs5.readdirSync(basePath).filter((dir) => { + return fs5.readdirSync([basePath, dir].join("/")).includes("nvidia-smi.exe"); }); const targetDir = candidateDirs.reduce((prevDir, currentDir) => { - const previousNvidiaSmi = fs4.statSync([basePath, prevDir, "nvidia-smi.exe"].join("/")); - const currentNvidiaSmi = fs4.statSync([basePath, currentDir, "nvidia-smi.exe"].join("/")); + const previousNvidiaSmi = fs5.statSync([basePath, prevDir, "nvidia-smi.exe"].join("/")); + const currentNvidiaSmi = fs5.statSync([basePath, currentDir, "nvidia-smi.exe"].join("/")); return previousNvidiaSmi.ctimeMs > currentNvidiaSmi.ctimeMs ? prevDir : currentDir; }); if (targetDir) { @@ -78044,7 +78044,7 @@ var require_filesystem = __commonJS({ "../../node_modules/systeminformation/lib/filesystem.js"(exports2) { "use strict"; var util = require_util10(); - var fs4 = require("fs"); + var fs5 = require("fs"); var exec7 = require("child_process").exec; var execSync = require("child_process").execSync; var execPromiseSave = util.promisifySave(require("child_process").exec); @@ -78065,11 +78065,11 @@ var require_filesystem = __commonJS({ } let macOsDisks = []; let osMounts = []; - function getmacOsFsType(fs5) { - if (!fs5.startsWith("/")) { + function getmacOsFsType(fs6) { + if (!fs6.startsWith("/")) { return "NFS"; } - const parts = fs5.split("/"); + const parts = fs6.split("/"); const fsShort = parts[parts.length - 1]; const macOsDisksSingle = macOsDisks.filter((item) => item.indexOf(fsShort) >= 0); if (macOsDisksSingle.length === 1 && macOsDisksSingle[0].indexOf("APFS") >= 0) { @@ -78077,11 +78077,11 @@ var require_filesystem = __commonJS({ } return "HFS"; } - function isLinuxTmpFs(fs5) { + function isLinuxTmpFs(fs6) { const linuxTmpFileSystems = ["rootfs", "unionfs", "squashfs", "cramfs", "initrd", "initramfs", "devtmpfs", "tmpfs", "udev", "devfs", "specfs", "type", "appimaged"]; let result2 = false; linuxTmpFileSystems.forEach((linuxFs) => { - if (fs5.toLowerCase().indexOf(linuxFs) >= 0) { + if (fs6.toLowerCase().indexOf(linuxFs) >= 0) { result2 = true; } }); @@ -78109,18 +78109,18 @@ var require_filesystem = __commonJS({ if (line !== "") { line = line.replace(/ +/g, " ").split(" "); if (line && (line[0].startsWith("/") || line[6] && line[6] === "/" || line[0].indexOf("/") > 0 || line[0].indexOf(":") === 1 || !_darwin && !isLinuxTmpFs(line[1]))) { - const fs5 = line[0]; + const fs6 = line[0]; const fsType = _linux || _freebsd || _openbsd || _netbsd ? line[1] : getmacOsFsType(line[0]); const size = parseInt(_linux || _freebsd || _openbsd || _netbsd ? line[2] : line[1]) * 1024; const used = parseInt(_linux || _freebsd || _openbsd || _netbsd ? line[3] : line[2]) * 1024; const available = parseInt(_linux || _freebsd || _openbsd || _netbsd ? line[4] : line[3]) * 1024; const use = parseFloat((100 * (used / (used + available))).toFixed(2)); - let rw = osMounts && Object.keys(osMounts).length > 0 ? osMounts[fs5] || false : null; + let rw = osMounts && Object.keys(osMounts).length > 0 ? osMounts[fs6] || false : null; line.splice(0, _linux || _freebsd || _openbsd || _netbsd ? 6 : 5); const mount = line.join(" "); - if (!data2.find((el) => el.fs === fs5 && el.type === fsType)) { + if (!data2.find((el) => el.fs === fs6 && el.type === fsType)) { data2.push({ - fs: fs5, + fs: fs6, type: fsType, size, used, @@ -78282,7 +78282,7 @@ var require_filesystem = __commonJS({ }); } if (_linux) { - fs4.readFile("/proc/sys/fs/file-nr", function(error2, stdout) { + fs5.readFile("/proc/sys/fs/file-nr", function(error2, stdout) { if (!error2) { let lines = stdout.toString().split("\n"); if (lines[0]) { @@ -78301,7 +78301,7 @@ var require_filesystem = __commonJS({ } resolve(result2); } else { - fs4.readFile("/proc/sys/fs/file-max", function(error3, stdout2) { + fs5.readFile("/proc/sys/fs/file-max", function(error3, stdout2) { if (!error3) { let lines = stdout2.toString().split("\n"); if (lines[0]) { @@ -79555,7 +79555,7 @@ var require_network = __commonJS({ var os3 = require("os"); var exec7 = require("child_process").exec; var execSync = require("child_process").execSync; - var fs4 = require("fs"); + var fs5 = require("fs"); var util = require_util10(); var _platform = process.platform; var _linux = _platform === "linux" || _platform === "android"; @@ -80734,7 +80734,7 @@ var require_network = __commonJS({ let cmd, lines, stats; if (!_network[ifaceSanitized] || _network[ifaceSanitized] && !_network[ifaceSanitized].ms || _network[ifaceSanitized] && _network[ifaceSanitized].ms && Date.now() - _network[ifaceSanitized].ms >= 500) { if (_linux) { - if (fs4.existsSync("/sys/class/net/" + ifaceSanitized)) { + if (fs5.existsSync("/sys/class/net/" + ifaceSanitized)) { cmd = "cat /sys/class/net/" + ifaceSanitized + "/operstate; cat /sys/class/net/" + ifaceSanitized + "/statistics/rx_bytes; cat /sys/class/net/" + ifaceSanitized + "/statistics/tx_bytes; cat /sys/class/net/" + ifaceSanitized + "/statistics/rx_dropped; cat /sys/class/net/" + ifaceSanitized + "/statistics/rx_errors; cat /sys/class/net/" + ifaceSanitized + "/statistics/tx_dropped; cat /sys/class/net/" + ifaceSanitized + "/statistics/tx_errors; "; exec7(cmd, function(error2, stdout) { if (!error2) { @@ -82036,7 +82036,7 @@ var require_processes = __commonJS({ "../../node_modules/systeminformation/lib/processes.js"(exports2) { "use strict"; var os3 = require("os"); - var fs4 = require("fs"); + var fs5 = require("fs"); var path6 = require("path"); var exec7 = require("child_process").exec; var execSync = require("child_process").execSync; @@ -82605,7 +82605,7 @@ var require_processes = __commonJS({ } if (firstPos === 1e4 && tmpCommand.indexOf(" ") > -1) { const parts = tmpCommand.split(" "); - if (fs4.existsSync(path6.join(cmdPath, parts[0]))) { + if (fs5.existsSync(path6.join(cmdPath, parts[0]))) { command = parts.shift(); params = (parts.join(" ") + " " + tmpParams).trim(); } else { @@ -86724,7 +86724,7 @@ var require_bluetooth = __commonJS({ var path6 = require("path"); var util = require_util10(); var bluetoothVendors = require_bluetoothVendors(); - var fs4 = require("fs"); + var fs5 = require("fs"); var _platform = process.platform; var _linux = _platform === "linux" || _platform === "android"; var _darwin = _platform === "darwin"; @@ -86849,7 +86849,7 @@ var require_bluetooth = __commonJS({ const macAddr1 = pathParts.length >= 6 ? pathParts[pathParts.length - 2] : null; const macAddr2 = pathParts.length >= 7 ? pathParts[pathParts.length - 3] : null; if (filename === "info") { - const infoFile = fs4.readFileSync(element, { encoding: "utf8" }).split("\n"); + const infoFile = fs5.readFileSync(element, { encoding: "utf8" }).split("\n"); result2.push(parseLinuxBluetoothInfo(infoFile, macAddr1, macAddr2)); } }); @@ -94192,14 +94192,14 @@ var require_parser = __commonJS({ case "scalar": case "single-quoted-scalar": case "double-quoted-scalar": { - const fs4 = this.flowScalar(this.type); + const fs5 = this.flowScalar(this.type); if (atNextItem || it.value) { - map2.items.push({ start, key: fs4, sep: [] }); + map2.items.push({ start, key: fs5, sep: [] }); this.onKeyLine = true; } else if (it.sep) { - this.stack.push(fs4); + this.stack.push(fs5); } else { - Object.assign(it, { key: fs4, sep: [] }); + Object.assign(it, { key: fs5, sep: [] }); this.onKeyLine = true; } return; @@ -94327,13 +94327,13 @@ var require_parser = __commonJS({ case "scalar": case "single-quoted-scalar": case "double-quoted-scalar": { - const fs4 = this.flowScalar(this.type); + const fs5 = this.flowScalar(this.type); if (!it || it.value) - fc.items.push({ start: [], key: fs4, sep: [] }); + fc.items.push({ start: [], key: fs5, sep: [] }); else if (it.sep) - this.stack.push(fs4); + this.stack.push(fs5); else - Object.assign(it, { key: fs4, sep: [] }); + Object.assign(it, { key: fs5, sep: [] }); return; } case "flow-map-end": @@ -95861,7 +95861,7 @@ var require_manifest = __commonJS({ var core_1 = require_core(); var os3 = require("os"); var cp2 = require("child_process"); - var fs4 = require("fs"); + var fs5 = require("fs"); function _findMatch(versionSpec, stable, candidates, archFilter) { return __awaiter2(this, void 0, void 0, function* () { const platFilter = os3.platform(); @@ -95925,10 +95925,10 @@ var require_manifest = __commonJS({ const lsbReleaseFile = "/etc/lsb-release"; const osReleaseFile = "/etc/os-release"; let contents2 = ""; - if (fs4.existsSync(lsbReleaseFile)) { - contents2 = fs4.readFileSync(lsbReleaseFile).toString(); - } else if (fs4.existsSync(osReleaseFile)) { - contents2 = fs4.readFileSync(osReleaseFile).toString(); + if (fs5.existsSync(lsbReleaseFile)) { + contents2 = fs5.readFileSync(lsbReleaseFile).toString(); + } else if (fs5.existsSync(osReleaseFile)) { + contents2 = fs5.readFileSync(osReleaseFile).toString(); } return contents2; } @@ -96105,7 +96105,7 @@ var require_tool_cache = __commonJS({ var core8 = __importStar2(require_core()); var io2 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); - var fs4 = __importStar2(require("fs")); + var fs5 = __importStar2(require("fs")); var mm = __importStar2(require_manifest()); var os3 = __importStar2(require("os")); var path6 = __importStar2(require("path")); @@ -96152,7 +96152,7 @@ var require_tool_cache = __commonJS({ exports2.downloadTool = downloadTool3; function downloadToolAttempt(url, dest, auth, headers) { return __awaiter2(this, void 0, void 0, function* () { - if (fs4.existsSync(dest)) { + if (fs5.existsSync(dest)) { throw new Error(`Destination file path ${dest} already exists`); } const http = new httpm.HttpClient(userAgent, [], { @@ -96176,7 +96176,7 @@ var require_tool_cache = __commonJS({ const readStream = responseMessageFactory(); let succeeded = false; try { - yield pipeline(readStream, fs4.createWriteStream(dest)); + yield pipeline(readStream, fs5.createWriteStream(dest)); core8.debug("download complete"); succeeded = true; return dest; @@ -96388,11 +96388,11 @@ var require_tool_cache = __commonJS({ arch2 = arch2 || os3.arch(); core8.debug(`Caching tool ${tool} ${version} ${arch2}`); core8.debug(`source dir: ${sourceDir}`); - if (!fs4.statSync(sourceDir).isDirectory()) { + if (!fs5.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } const destPath = yield _createToolPath(tool, version, arch2); - for (const itemName of fs4.readdirSync(sourceDir)) { + for (const itemName of fs5.readdirSync(sourceDir)) { const s = path6.join(sourceDir, itemName); yield io2.cp(s, destPath, { recursive: true }); } @@ -96407,7 +96407,7 @@ var require_tool_cache = __commonJS({ arch2 = arch2 || os3.arch(); core8.debug(`Caching tool ${tool} ${version} ${arch2}`); core8.debug(`source file: ${sourceFile}`); - if (!fs4.statSync(sourceFile).isFile()) { + if (!fs5.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch2); @@ -96437,7 +96437,7 @@ var require_tool_cache = __commonJS({ versionSpec = semver4.clean(versionSpec) || ""; const cachePath = path6.join(_getCacheDirectory(), toolName, versionSpec, arch2); core8.debug(`checking cache: ${cachePath}`); - if (fs4.existsSync(cachePath) && fs4.existsSync(`${cachePath}.complete`)) { + if (fs5.existsSync(cachePath) && fs5.existsSync(`${cachePath}.complete`)) { core8.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); toolPath = cachePath; } else { @@ -96451,12 +96451,12 @@ var require_tool_cache = __commonJS({ const versions = []; arch2 = arch2 || os3.arch(); const toolPath = path6.join(_getCacheDirectory(), toolName); - if (fs4.existsSync(toolPath)) { - const children2 = fs4.readdirSync(toolPath); + if (fs5.existsSync(toolPath)) { + const children2 = fs5.readdirSync(toolPath); for (const child of children2) { if (isExplicitVersion(child)) { const fullPath = path6.join(toolPath, child, arch2 || ""); - if (fs4.existsSync(fullPath) && fs4.existsSync(`${fullPath}.complete`)) { + if (fs5.existsSync(fullPath) && fs5.existsSync(`${fullPath}.complete`)) { versions.push(child); } } @@ -96530,7 +96530,7 @@ var require_tool_cache = __commonJS({ function _completeToolPath(tool, version, arch2) { const folderPath = path6.join(_getCacheDirectory(), tool, semver4.clean(version) || version, arch2 || ""); const markerPath = `${folderPath}.complete`; - fs4.writeFileSync(markerPath, ""); + fs5.writeFileSync(markerPath, ""); core8.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { @@ -99723,7 +99723,7 @@ var require_semver4 = __commonJS({ "../../node_modules/semver/index.js"(exports2, module2) { "use strict"; var internalRe = require_re(); - var constants2 = require_constants10(); + var constants3 = require_constants10(); var SemVer = require_semver3(); var identifiers = require_identifiers(); var parse10 = require_parse2(); @@ -99805,8 +99805,8 @@ var require_semver4 = __commonJS({ re: internalRe.re, src: internalRe.src, tokens: internalRe.t, - SEMVER_SPEC_VERSION: constants2.SEMVER_SPEC_VERSION, - RELEASE_TYPES: constants2.RELEASE_TYPES, + SEMVER_SPEC_VERSION: constants3.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants3.RELEASE_TYPES, compareIdentifiers: identifiers.compareIdentifiers, rcompareIdentifiers: identifiers.rcompareIdentifiers }; @@ -110142,7 +110142,7 @@ var require_client_h1 = __commonJS({ kHTTPContext, kClosed } = require_symbols6(); - var constants2 = require_constants12(); + var constants3 = require_constants12(); var EMPTY_BUF = Buffer.alloc(0); var FastBuffer = Buffer[Symbol.species]; var removeAllListeners = util.removeAllListeners; @@ -110260,7 +110260,7 @@ var require_client_h1 = __commonJS({ */ constructor(client, socket, { exports: exports3 }) { this.llhttp = exports3; - this.ptr = this.llhttp.llhttp_alloc(constants2.TYPE.RESPONSE); + this.ptr = this.llhttp.llhttp_alloc(constants3.TYPE.RESPONSE); this.client = client; this.socket = socket; this.timeout = null; @@ -110357,11 +110357,11 @@ var require_client_h1 = __commonJS({ currentParser = null; currentBufferRef = null; } - if (ret !== constants2.ERROR.OK) { + if (ret !== constants3.ERROR.OK) { const data2 = chunk.subarray(llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr); - if (ret === constants2.ERROR.PAUSED_UPGRADE) { + if (ret === constants3.ERROR.PAUSED_UPGRADE) { this.onUpgrade(data2); - } else if (ret === constants2.ERROR.PAUSED) { + } else if (ret === constants3.ERROR.PAUSED) { this.paused = true; socket.unshift(data2); } else { @@ -110371,7 +110371,7 @@ var require_client_h1 = __commonJS({ const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; } - throw new HTTPParserError(message, constants2.ERROR[ret], data2); + throw new HTTPParserError(message, constants3.ERROR[ret], data2); } } } catch (err) { @@ -110578,7 +110578,7 @@ var require_client_h1 = __commonJS({ socket[kBlocking] = false; client[kResume](); } - return pause ? constants2.ERROR.PAUSED : 0; + return pause ? constants3.ERROR.PAUSED : 0; } /** * @param {Buffer} buf @@ -110604,7 +110604,7 @@ var require_client_h1 = __commonJS({ } this.bytesRead += buf.length; if (request.onData(buf) === false) { - return constants2.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } return 0; } @@ -110643,13 +110643,13 @@ var require_client_h1 = __commonJS({ if (socket[kWriting]) { assert(client[kRunning] === 0); util.destroy(socket, new InformationalError("reset")); - return constants2.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } else if (!shouldKeepAlive) { util.destroy(socket, new InformationalError("reset")); - return constants2.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } else if (socket[kReset] && client[kRunning] === 0) { util.destroy(socket, new InformationalError("reset")); - return constants2.ERROR.PAUSED; + return constants3.ERROR.PAUSED; } else if (client[kPipelining] == null || client[kPipelining] === 1) { setImmediate(() => client[kResume]()); } else { @@ -126033,7 +126033,7 @@ var require_internal_globber2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; var core8 = __importStar2(require_core()); - var fs4 = __importStar2(require("fs")); + var fs5 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper2()); var path6 = __importStar2(require("path")); var patternHelper = __importStar2(require_internal_pattern_helper2()); @@ -126087,7 +126087,7 @@ var require_internal_globber2 = __commonJS({ for (const searchPath of patternHelper.getSearchPaths(patterns)) { core8.debug(`Search path '${searchPath}'`); try { - yield __await2(fs4.promises.lstat(searchPath)); + yield __await2(fs5.promises.lstat(searchPath)); } catch (err) { if (err.code === "ENOENT") { continue; @@ -126121,7 +126121,7 @@ var require_internal_globber2 = __commonJS({ continue; } const childLevel = item.level + 1; - const childItems = (yield __await2(fs4.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path6.join(item.path, x), childLevel)); + const childItems = (yield __await2(fs5.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path6.join(item.path, x), childLevel)); stack.push(...childItems.reverse()); } else if (match & internal_match_kind_1.MatchKind.File) { yield yield __await2(item.path); @@ -126156,7 +126156,7 @@ var require_internal_globber2 = __commonJS({ let stats; if (options.followSymbolicLinks) { try { - stats = yield fs4.promises.stat(item.path); + stats = yield fs5.promises.stat(item.path); } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { @@ -126168,10 +126168,10 @@ var require_internal_globber2 = __commonJS({ throw err; } } else { - stats = yield fs4.promises.lstat(item.path); + stats = yield fs5.promises.lstat(item.path); } if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs4.promises.realpath(item.path); + const realPath = yield fs5.promises.realpath(item.path); while (traversalChain.length >= item.level) { traversalChain.pop(); } @@ -126270,7 +126270,7 @@ var require_internal_hash_files = __commonJS({ exports2.hashFiles = void 0; var crypto2 = __importStar2(require("crypto")); var core8 = __importStar2(require_core()); - var fs4 = __importStar2(require("fs")); + var fs5 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); var path6 = __importStar2(require("path")); @@ -126293,13 +126293,13 @@ var require_internal_hash_files = __commonJS({ writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); continue; } - if (fs4.statSync(file).isDirectory()) { + if (fs5.statSync(file).isDirectory()) { writeDelegate(`Skip directory '${file}'.`); continue; } const hash = crypto2.createHash("sha256"); const pipeline = util.promisify(stream2.pipeline); - yield pipeline(fs4.createReadStream(file), hash); + yield pipeline(fs5.createReadStream(file), hash); result2.write(hash.digest()); count++; if (!hasMatch) { @@ -126389,7 +126389,7 @@ var process4 = __toESM(require("node:process"), 1); var core7 = __toESM(require_core(), 1); // src/installer.ts -var fs3 = __toESM(require("node:fs/promises"), 1); +var fs4 = __toESM(require("node:fs/promises"), 1); var os2 = __toESM(require("node:os"), 1); var process3 = __toESM(require("node:process"), 1); var core6 = __toESM(require_core(), 1); @@ -126637,6 +126637,7 @@ retry.VERSION = VERSION; var semver = __toESM(require_semver4(), 1); // src/unix.ts +var fs = __toESM(require("node:fs/promises"), 1); var import_exec = __toESM(require_exec(), 1); async function checkAptInstallability(packageName) { const output = await (0, import_exec.getExecOutput)("sudo", [ @@ -126664,8 +126665,18 @@ async function retrieveInstallableOptionalDependencies(optionalDependencies) { } } } +async function skipPackageManagement() { + let isContainerRunner = false; + try { + await fs.access("/.dockerenv", fs.constants.R_OK); + isContainerRunner = true; + } catch { + isContainerRunner = false; + } + return RUNNER_ENVIRONMENT === "self-hosted" || isContainerRunner; +} async function installUnixSystemPackages() { - if (RUNNER_ENVIRONMENT === "self-hosted") { + if (await skipPackageManagement()) { return; } switch (PLATFORM) { @@ -126694,7 +126705,7 @@ async function installUnixSystemPackages() { } } async function updateUnixPackageIndexFiles() { - if (RUNNER_ENVIRONMENT === "self-hosted") { + if (await skipPackageManagement()) { return; } switch (PLATFORM) { @@ -126936,7 +126947,7 @@ var resolvedCompiler = (async () => { })(); // src/windows.ts -var fs2 = __toESM(require("node:fs/promises"), 1); +var fs3 = __toESM(require("node:fs/promises"), 1); var path4 = __toESM(require("node:path"), 1); var core3 = __toESM(require_core(), 1); var import_exec3 = __toESM(require_exec(), 1); @@ -140981,15 +140992,15 @@ async function fixFstab() { await core3.group("Fixing Cygwin fstab configuration", async () => { try { const fstabPath = path4.join(CYGWIN_ROOT, "etc", "fstab"); - await fs2.access(fstabPath, fs2.constants.W_OK); - const contents2 = await fs2.readFile(fstabPath, { encoding: "utf8" }); + await fs3.access(fstabPath, fs3.constants.W_OK); + const contents2 = await fs3.readFile(fstabPath, { encoding: "utf8" }); core3.info(contents2); const patchedContents = contents2.replace( /(?<=\s)binary(?=,posix)/, "noacl,binary" ); core3.info(patchedContents); - await fs2.writeFile(fstabPath, patchedContents, { encoding: "utf8" }); + await fs3.writeFile(fstabPath, patchedContents, { encoding: "utf8" }); } catch (error2) { if (error2 instanceof Error) { core3.warning(error2); @@ -141248,7 +141259,7 @@ async function installer() { if (!cygwinCacheHit) { await saveCygwinCache(); } - await fs3.writeFile(CYGWIN_BASH_ENV, "set -o igncr"); + await fs4.writeFile(CYGWIN_BASH_ENV, "set -o igncr"); core6.exportVariable("BASH_ENV", CYGWIN_BASH_ENV); await fixFstab(); core6.addPath(CYGWIN_ROOT_BIN); diff --git a/packages/setup-ocaml/src/unix.ts b/packages/setup-ocaml/src/unix.ts index d5fd44f0..36819be9 100644 --- a/packages/setup-ocaml/src/unix.ts +++ b/packages/setup-ocaml/src/unix.ts @@ -1,3 +1,4 @@ +import * as fs from "node:fs/promises"; import { exec, getExecOutput } from "@actions/exec"; import { PLATFORM, RUNNER_ENVIRONMENT } from "./constants.js"; @@ -31,8 +32,21 @@ async function retrieveInstallableOptionalDependencies( } } +async function skipPackageManagement() { + // Skip package management if running in a self-hosted environment or in a + // github-hosted Docker container. + let isContainerRunner = false; + try { + await fs.access("/.dockerenv", fs.constants.R_OK); + isContainerRunner = true; + } catch { + isContainerRunner = false; + } + return RUNNER_ENVIRONMENT === "self-hosted" || isContainerRunner; +} + export async function installUnixSystemPackages() { - if (RUNNER_ENVIRONMENT === "self-hosted") { + if (await skipPackageManagement()) { return; } switch (PLATFORM) { @@ -63,7 +77,7 @@ export async function installUnixSystemPackages() { } export async function updateUnixPackageIndexFiles() { - if (RUNNER_ENVIRONMENT === "self-hosted") { + if (await skipPackageManagement()) { return; } switch (PLATFORM) {