Fix regression: non-Clojure files (e.g. README.md) breaking compileClojure since 14.0.2#65
Merged
Merged
Conversation
Config-cache support (14.0.2) replaced the filtered SourceDirectorySet (set.clojure, restricted to **/*.clj, **/*.cljs, **/*.cljc) with a raw project.file(src/.../clojure) to avoid serializing the SourceSet object graph. SourceDirectoryTask.getSource() then turned that directory into an unfiltered FileTree, so any non-Clojure file sitting in the source directory (e.g. a README.md) got passed to the Clojure compiler and broke the build. Restore the extension filter in SourceDirectoryTask.getSource() so only Clojure files are treated as compile/test/run/doc source, while keeping srcDirs as plain File objects for classpath purposes and configuration-cache compatibility.
rpalcolea
force-pushed
the
compilation-enhancements
branch
from
July 23, 2026 02:11
e26c42c to
cc9ca97
Compare
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.
Problem
Upgrading from 14.0.1 → 14.0.2 causes clojureCompile (and clojureTest/clojureRun/clojureDoc)
to fail on projects that have non-Clojure files (like a README.md) sitting inside their
src/<sourceSet>/clojuredirectory. This surfaced as a compilation error after a consumerenabled configuration cache, though the plugin change itself was believed to be a no-op.
Root cause
14.0.2's "Support configuration cache" change (e590239) replaced
set.clojure— aSourceDirectorySetfiltered to**/*.clj,**/*.cljs,**/*.cljcinDefaultClojureSourceSet— with a plainproject.file("src/${set.name}/clojure"), to avoidserializing the SourceSet object graph into task state.
That raw
Filecarries no filter.SourceDirectoryTask.getSource()converts it straight intoan unfiltered
FileTree(objectFactory.fileCollection().from(srcDirs).asFileTree), so everyfile under the source directory — including non-Clojure files — is now treated as compile
input.
Fix
Restore the
**/*.clj,**/*.cljs,**/*.cljcfilter, applied centrally inSourceDirectoryTask.getSource()via.matching { include ... }.srcDirsitself stays asplain
Filedirectories (still needed unfiltered for the Clojure classpath inClojureCompile/ClojureRun/ClojureTest/ClojureDoc), keeping the fix fully
configuration-cache-compatible.