Skip to content

Module cache directory propagation into PklProject and settings evaluation - #1900

Merged
bioball merged 1 commit into
apple:mainfrom
netvl:module-cache-propagation
Oct 7, 2026
Merged

bioball merged 1 commit into
apple:mainfrom
netvl:module-cache-propagation

Conversation

@netvl

@netvl netvl commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Currently the module cache directory in CLI commands (and thus in Gradle tasks, since they use CLI commands under the hood) is only used for the "primary" task. For example, for an eval command, the module cache directory will be used for the evaluation of the target module.

However, most commands also work with projects, and for projects the PklProject file must be evaluated. This is done via Project.loadFromPath, which internally builds an evaluator with the default module cache path. Therefore, all evaluations of project manifests always use default cache path instead of whatever is configured through the CLI option/Gradle task property. This, in turn, may result in unexpected behavior: in general, the user would expect that if they specify the cache directory, it will be used for all evaluations (e.g. when they pre-populate the cache and expect evaluations to work offline).

The same is true for settings evaluation, although for settings it is significantly less important since settings scripts can't have remote dependencies.

This PR propagates cache path into the project evaluator (as well as the settings evaluator, for consistency). This will result in the user-specified cache directory being used for PklProject evaluations as well.

@HT154 HT154 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@netvl
netvl force-pushed the module-cache-propagation branch from f47682f to 5dd8ca4 Compare October 7, 2026 20:29
@bioball
bioball merged commit 66fb5c1 into apple:main Oct 7, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants