Skip to content

Commit 75f4bfe

Browse files
committed
fix(manifest): a crashed JVM build always fails, ignoring ignoreUnresolved
ignoreUnresolved (and --ignore-unresolved) means 'the build ran but some dependencies could not be resolved; tolerate those'. It must not swallow the build process itself failing (missing JDK/build tool, unparseable project, OOM, plugin crash). Scope it to the blocking-resolution-failure branch only; a crashed build now fails regardless.
1 parent 6ef766e commit 75f4bfe

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
88

99
### Changed
1010
- Quieter `socket manifest gradle`, `sbt`, and `maven`: the build tool's output is now hidden behind a progress spinner and shown only if the build fails. Pass `--verbose` to stream it live.
11-
- `--auto-manifest` now fails fast: if a Gradle, sbt, or Maven build can't be resolved, the run stops instead of continuing with an incomplete SBOM. Opt into tolerating install errors to keep going.
11+
- `--auto-manifest` now fails fast: if a Gradle, sbt, or Maven build fails, the run stops instead of continuing with an incomplete SBOM.
1212

1313
## [1.1.132](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.132) - 2026-06-30
1414

src/commands/manifest/run-manifest-facts.mts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ function tailBuildOutput(stdout: string, stderr: string): string {
2626

2727
// Runs the bundled build-tool resolution script for a JVM project and writes
2828
// `.socket.facts.json`. `withFiles` (reachability only) additionally folds
29-
// resolved artifact paths into `sidecarAcc`. A blocking resolution failure — or
30-
// a build that crashes without emitting any facts — sets a non-zero exit code
31-
// and returns (matching the `--pom` generator) unless `ignoreUnresolved`.
29+
// resolved artifact paths into `sidecarAcc`. A blocking resolution failure sets
30+
// a non-zero exit code and returns (matching the `--pom` generator) unless
31+
// `ignoreUnresolved`; a crashed build — a process failure, not an unresolved
32+
// dependency — always fails.
3233
export async function runManifestFacts({
3334
bin,
3435
buildOpts,
@@ -152,13 +153,14 @@ export async function runManifestFacts({
152153
logger.groupEnd()
153154
}
154155
}
155-
const message = `The ${ecosystem} build failed (exit code ${code}) before producing any Socket facts.`
156-
if (ignoreUnresolved) {
157-
logger.warn(message)
158-
return
159-
}
156+
// A crashed build is a process failure (missing JDK/build tool, unparseable
157+
// project, OOM, plugin error), not an unresolved dependency, so it fails
158+
// regardless of `ignoreUnresolved` — that flag only tolerates dependencies a
159+
// successful run couldn't resolve.
160160
process.exitCode = 1
161-
logger.fail(message)
161+
logger.fail(
162+
`The ${ecosystem} build failed (exit code ${code}) before producing any Socket facts.`,
163+
)
162164
return
163165
}
164166

0 commit comments

Comments
 (0)