Repository navigation
fix(kt): resolve Gradle executables before wrapping them - #7632
Conversation
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
bench.sh now resolves GRADLE_CMD with `type -P` like the check and package runners, and every runner names the value it could not resolve instead of claiming gradle is missing from PATH. The fixture covers all three runners and the named-override error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 403bdd7
No actionable findings. All three runners resolve an executable before invoking it; the check wrapper uses that resolved command while retaining its environment filtering. The fixture covers the inherited function, explicit names and paths, missing executables, and failure propagation.
Verification limits: static GitHub source and test inspection only. I did not run Gradle, the fixture, or repository gates, and have not independently verified the reported checks.
(Written by review (OpenAI))
|
No actionable comments were generated in the recent review. WalkthroughThe check, package, and benchmark scripts now resolve the configured Gradle command to an executable path. They report an error and exit with status 1 when resolution fails. A new unittest suite checks executable selection, overrides, missing commands, and failure-status handling. The justfile test recipe now runs this suite. Merge Risk:
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Gradle resolution in the Kotlin runners:
check.sh,package.sh, andbench.shnow resolveGRADLE_CMD(defaultgradle) withtype -P, so an inheritedgradle()function can no longer be selected.bench.shalso resolves before invoking Gradle instead of running a baregradle. - Named failure messages: each runner errors with the value it could not resolve (e.g.
Gradle executable 'tools/missing-gradle' not found) rather than claiming Gradle is absent fromPATH. - Fixture:
sh/kt/gradle.test.pyruns the real scripts in an isolated tree with an exported Gradle function and covers defaults, explicit name/relative/absolute overrides, missing executables, failure propagation, andcheck.sh's credential-env filtering. Registered in the.github/justfiletooling gate.
I read the full diff, confirmed type -P behavior for bare names, relative/absolute paths, missing/non-executable files, and functions, ran python3 sh/kt/gradle.test.py (5 pass), and ran shellcheck on the three scripts. No other in-repo gradle call site shares this bug: the workflow steps have no inherited function, and test/smoke/smoke.sh's bare gradle has no same-name wrapper to recurse into.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

Problem
An exported
gradleshell function makescommand -v gradlereturngradleinstead of an executable path. Kotlin's check runner then calls its owngradle()wrapper recursively, and an explicitGRADLE_CMD=gradlerecursed the same way. The packaging and bench runners run the inherited function instead of the executable.This blocked the default FFI run in moq-dev/moq#7654, which needed a
GRADLE_CMDoverride to pass.Approach
All three Gradle runners (
sh/kt/check.sh,sh/kt/package.sh,sh/kt/bench.sh) resolveGRADLE_CMD(defaultgradle) with Bash's executable-onlytype -P. Overrides still accept executable names and relative or absolute paths. When no executable resolves, the error names the value that failed, such asGradle executable 'tools/missing-gradle' not found. It no longer says gradle is missing from PATH when the override was the problem.sh/kt/gradle.test.pyruns the real scripts in an isolated tree with an exported Gradle function. It covers defaults, overrides, missing executables and named overrides, failure propagation, and the check runner's credential-environment filtering. It is registered in the repository tooling gate (.github/justfile).Impact
Alternatives
type -Pnever returns a function, wherever the wrapper is defined, so the wrapper keeps its name.Validation
On head 403bdd755f, after merging
origin/main(no conflicts):python3 sh/kt/gradle.test.py: 5 tests pass in about 1 s. The fixture run againstorigin/main's runners fails 8 subcases.origin/main'ssh/kt/check.sh, run with an exportedgradle() { command gradle "$@"; }and noGRADLE_CMD, fails withgradle: maximum function nesting level exceeded. This head's script passes the same run, including real Gradle:moq-ffi:jvmTest :moq:jvmTestand the POM check.GRADLE_CMDoverride:just check HEADwith a comment-onlyrs/moq-ffiedit and the exported function, under onequest gateadmission withLOCAL_SUPERVISED=1. It passed kt, c, cpp, go, dart, py, rs, obs_compile, and the other selected modules; Swift skips on Linux. No nesting errors.just check origin/main: shell, gh (includingtest gh), kt, markdown, and the other selected modules pass.quest gatestrips exported functions from the environment on this host. A plainjust kt checktherefore never saw the function. The runs above export it inside the admitted command, like the run in moq-dev/moq#7654.Review
quest review --base origin/main --harness claude, Claude Code / claude-opus-5-5, medium effort. The code was authored by Codex, so Claude Code reviews it. Session47ca2f5e-7915-4858-bed0-72b7800c055e.sh/kt/bench.shstill ran a baregradle: fixed in 403bdd755f. The fixture covers it.GRADLE_CMDwas reported as "gradle not on PATH": fixed in 403bdd755f. The error names the value, andtest_missing_override_is_namedcovers it.gradle()wrapper instead of relying on resolution order: refuted.type -Pnever returns a function, so there is no ordering invariant. The misleading comment is corrected insh/kt/check.sh:30-31. The fixture also reproduces the package and override failures.The PR had no review threads or automated findings to address.
Follow-ups
None.
(Written by Claude Opus 5.5)