From 417878d41de421f6defd2c2ebfa0d3e026bf55d7 Mon Sep 17 00:00:00 2001 From: grahamc <76716+grahamc@users.noreply.github.com> Date: Thu, 27 Mar 2025 15:57:44 +0000 Subject: [PATCH] Update `detsys-ts` for: `Merge pull request #81 from DeterminateSystems/dont-capture-some-crashes` (`8d9725c4856301321cd2508f5b8725cfb99366e2`) --- dist/index.js | 31 +++++++++++++++++++++++-------- pnpm-lock.yaml | 6 +++--- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/dist/index.js b/dist/index.js index 73c97b3..6ee91d2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -91829,7 +91829,7 @@ const external_node_dns_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequ var cache = __nccwpck_require__(7389); ;// CONCATENATED MODULE: external "node:child_process" const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process"); -;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@38df301720b69972f084538dd44c181269f264b0_hrkui372z63w5lu7fvybdhrsby/node_modules/detsys-ts/dist/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@8d9725c4856301321cd2508f5b8725cfb99366e2_fdev4auzlvbywtzbbq2infymuu/node_modules/detsys-ts/dist/index.js var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name in all) @@ -92057,16 +92057,24 @@ function stringifyError(e) { var START_SLOP_SECONDS = 5; -async function collectBacktraces(prefixes, startTimestampMs) { +async function collectBacktraces(prefixes, programNameDenyList, startTimestampMs) { if (isMacOS) { - return await collectBacktracesMacOS(prefixes, startTimestampMs); + return await collectBacktracesMacOS( + prefixes, + programNameDenyList, + startTimestampMs + ); } if (isLinux) { - return await collectBacktracesSystemd(prefixes, startTimestampMs); + return await collectBacktracesSystemd( + prefixes, + programNameDenyList, + startTimestampMs + ); } return /* @__PURE__ */ new Map(); } -async function collectBacktracesMacOS(prefixes, startTimestampMs) { +async function collectBacktracesMacOS(prefixes, programNameDenyList, startTimestampMs) { const backtraces = /* @__PURE__ */ new Map(); try { const { stdout: logJson } = await exec.getExecOutput( @@ -92108,6 +92116,10 @@ async function collectBacktracesMacOS(prefixes, startTimestampMs) { for (const [source, dir] of dirs) { const fileNames = (await (0,promises_namespaceObject.readdir)(dir)).filter((fileName) => { return prefixes.some((prefix) => fileName.startsWith(prefix)); + }).filter((fileName) => { + return !programNameDenyList.some( + (programName) => fileName.startsWith(`${programName}_${(/* @__PURE__ */ new Date()).getFullYear()}`) + ); }).filter((fileName) => { return !fileName.endsWith(".diag"); }); @@ -92132,7 +92144,7 @@ async function collectBacktracesMacOS(prefixes, startTimestampMs) { } return backtraces; } -async function collectBacktracesSystemd(prefixes, startTimestampMs) { +async function collectBacktracesSystemd(prefixes, programNameDenyList, startTimestampMs) { const sinceSeconds = Math.ceil((Date.now() - startTimestampMs) / 1e3) + START_SLOP_SECONDS; const backtraces = /* @__PURE__ */ new Map(); const coredumps = []; @@ -92154,7 +92166,7 @@ async function collectBacktracesSystemd(prefixes, startTimestampMs) { if (typeof sussyObject.exe == "string" && typeof sussyObject.pid == "number") { const execParts = sussyObject.exe.split("/"); const binaryName = execParts[execParts.length - 1]; - if (prefixes.some((prefix) => binaryName.startsWith(prefix))) { + if (prefixes.some((prefix) => binaryName.startsWith(prefix)) && !programNameDenyList.includes(binaryName)) { coredumps.push({ exe: sussyObject.exe, pid: sussyObject.pid @@ -92722,6 +92734,7 @@ var STATE_KEY_CROSS_PHASE_ID = "detsys_cross_phase_id"; var STATE_BACKTRACE_START_TIMESTAMP = "detsys_backtrace_start_timestamp"; var DIAGNOSTIC_ENDPOINT_TIMEOUT_MS = 1e4; var CHECK_IN_ENDPOINT_TIMEOUT_MS = 1e3; +var PROGRAM_NAME_CRASH_DENY_LIST = ["nix-expr-tests"]; var DetSysAction = class { determineExecutionPhase() { const currentPhase = core.getState(STATE_KEY_EXECUTION_PHASE); @@ -93269,6 +93282,7 @@ var DetSysAction = class { } const backtraces = await collectBacktraces( this.actionOptions.binaryNamePrefixes, + this.actionOptions.binaryNamesDenyList, parseInt(core.getState(STATE_BACKTRACE_START_TIMESTAMP)) ); core.debug(`Backtraces identified: ${backtraces.size}`); @@ -93413,7 +93427,8 @@ function makeOptionsConfident(actionOptions) { "nix", "determinate-nixd", actionOptions.name - ] + ], + binaryNamesDenyList: actionOptions.binaryNamePrefixes ?? PROGRAM_NAME_CRASH_DENY_LIST }; core.debug("idslib options:"); core.debug(JSON.stringify(finalOpts, void 0, 2)); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cdb49fd..567a7f7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,7 @@ dependencies: version: 6.0.0 detsys-ts: specifier: github:DeterminateSystems/detsys-ts - version: github.com/DeterminateSystems/detsys-ts/38df301720b69972f084538dd44c181269f264b0 + version: github.com/DeterminateSystems/detsys-ts/8d9725c4856301321cd2508f5b8725cfb99366e2 got: specifier: ^14.4.6 version: 14.4.6 @@ -4253,8 +4253,8 @@ packages: engines: {node: '>=10'} dev: true - github.com/DeterminateSystems/detsys-ts/38df301720b69972f084538dd44c181269f264b0: - resolution: {tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/38df301720b69972f084538dd44c181269f264b0} + github.com/DeterminateSystems/detsys-ts/8d9725c4856301321cd2508f5b8725cfb99366e2: + resolution: {tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/8d9725c4856301321cd2508f5b8725cfb99366e2} name: detsys-ts version: 1.0.0 dependencies: