Adam
01/01/2026, 1:12 PMclang --version to make sure it's executable), which the base check task depends on. However, if my plugin is installed in multiple subprojects, then the verification tasks in each subprojects could effectively perform the same check, which is redundant and slower.
Each subproject could have a different kotlin-native-prebuilt distribution (e.g. one that's for macOS and another for Linux).
What are some good ways of 'deduplicating' these check tasks?Chris Lee
01/01/2026, 6:14 PMAdam
01/01/2026, 11:09 PMChris Lee
01/02/2026, 1:41 AMProvider<Object> seems solid.ysb33r
01/04/2026, 9:54 AMAdam
01/04/2026, 12:48 PMysb33r
01/05/2026, 10:08 AMPhilip W
01/05/2026, 10:11 AMAdam
01/05/2026, 1:10 PMWhy don't you put the necessary checks in the plugin that installs the toolchain. Then you just work on the principle in other projects that the installation is good?I want a way to manually run the checks (like verifying the file checksums, or checking if
clang --version returns the expected result). Running such checks automatically (e.g. on every build) is far too slow, and isn't necessary in almost all cases.Adam
01/05/2026, 1:14 PMDo you download the toolchain (I guess so)? I wonder if you can use a transformer action instead, it is scoped to the build and is cacheable across builds.The source archives are downloaded via Gradle (using a custom Ivy repo). I really really really want to avoid using transformers because they're overly sensitive to buildscript classpath changes. Any change would re-trigger the transform, which is slow and uses a lot of disk space. https://github.com/gradle/gradle/issues/30968
ysb33r
01/05/2026, 1:16 PMI want a way to manually run the checks (like verifying the file checksums, or checking ifThis implies that you should not hook verification into the lifecyclereturns the expected result). Running such checks automatically (e.g. on every build) is far too slow, and isn't necessary in almost all cases.clang --version
check which is something that is meant to be run as part of automation.
If you only want to verify this on the odd moment, then have a standalone (sanity check) task that can be run on-demand. You are still better off doing the initial checks in the toolchain plugin.Adam
01/05/2026, 1:30 PMcheck is up for debate). The question is how to prevent different subprojects re-running the same check.
So let's say I have 3 subprojects:
• foo-linux-lib (uses the linux toolchain)
• bar-linux-lib (again, uses the linux toolchain)
• bar-macos-lib (uses the macos toolchain)
If my toolchain plugin registers a 'verify toolchain' task in each project, then the tasks in foo-linux-lib and bar-linux-lib tasks are going to be duplicated. Even if the actual validation computation was de-duplicated (e.g. the validation was done once in a shared BuildService), the result is either going to be reported multiple times (which is weird imo), or one of the subproject tasks will have to skip (again, weird imo).
What I'm gravitating towards a toolchains settings plugin that registers a 'verify all toolchains' task in the root project. The setting plugin registers a BuildService that collects all requested toolchains (using gradle.afterProject {}), and the check task verifies all distinct toolchains.ysb33r
01/05/2026, 1:32 PMWhat I'm gravitating towards a toolchains settings plugin that registers a 'verify all toolchains' task in the root project.That is a better solution.