Fix exception thrown from BaseDirFileResolver when Tooling API receives a relative project directory#37762
Merged
eskatos merged 1 commit intoMay 6, 2026
Conversation
ecd6dbd to
e7d987c
Compare
Member
|
@bot-gradle test this |
This comment has been minimized.
This comment has been minimized.
Collaborator
|
The following builds have passed: |
Member
|
Thank you for your proposed contribution! This PR has a valid DCO and tests. The relevant team for this area will confirm the implementation choices. Given that #32894 was included in 9.5.0, should we consider this for a potential 9.5.1? Does it make a patch release necessary on its own? |
Member
|
We agree this mandates a 9.5.1. @joshfriend Can you please put this PR on top of the |
…ives a relative project directory PR gradle#32894 introduced a regression where `DaemonClientToolchainServices` passes `getRootDirectory()` directly to `BaseDirFileResolver`, which requires an absolute path. When the Tooling API is invoked with a relative project directory (e.g. `File(".")`), this throws: IllegalArgumentException: base dir '.' is not an absolute file. This affects any Tooling API consumer that connects with a relative or default project directory, such as block/artifact-swap which defaults `--dir` to `Path(".")`: https://github.com/block/artifact-swap/blob/v0.1.12/cli/src/main/kotlin/xyz/block/artifactswap/cli/options/CommonOptions.kt#L14-L18 Signed-off-by: Josh Friend <jfriend@block.xyz>
e7d987c to
c0e5e4a
Compare
Contributor
Author
done |
eskatos
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #32894 introduced a regression where
DaemonClientToolchainServicespassesgetRootDirectory()directly toBaseDirFileResolver, which requires an absolute path. When the Tooling API is invoked with a relative project directory (e.g.File(".")), this throws:Context
This affects any Tooling API consumer that connects with a relative or default project directory, such as block/artifact-swap which defaults
--dirtoPath(".")here.Contributor Checklist
<subproject>/src/integTest) to verify changes from a user perspective.<subproject>/src/test) to verify logic../gradlew sanityCheck../gradlew <changed-subproject>:quickTest.Reviewing cheatsheet
Before merging the PR, comments starting with