[WIP] Include existing output directories on the compiler classpath - #1127
Open
goutamadwant wants to merge 2 commits into
Open
goutamadwant wants to merge 2 commits into
goutamadwant wants to merge 2 commits into
Conversation
Expose earlier compiler output during main and test compilation and add mixed-language and forked regression coverage. Related to apache#1036. This is an incomplete comparison for review. Broader validation demonstrates stale Java bytecode can satisfy references after sources or declarations are removed. Output ownership and cleanup must be addressed before this change can be merged. The full integration suite is not passing.
| if (location.isPresent()) { // Cannot use `Optional.ifPresent(…)` because of checked IOException. | ||
| var value = location.get(); | ||
| if (value == StandardLocation.CLASS_PATH) { | ||
| if (isPartialBuild && !hasModuleDeclaration) { |
Contributor
There was a problem hiding this comment.
I don't think that you should delete this block, unless you find it to be wrong. In my understanding, the only change which is needed is the removal of the isPartialBuild flag.
| if (!paths.contains(outputDirectory)) { | ||
| paths.add(outputDirectory); | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Do not add this block if the suggestion to not remove the block below is applied.
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
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.
Related to #1036.
Draft for design review. A known correctness regression blocks merging this change.
The current compiler plugin omits the output directory from the classpath during full compilation. This prevents Java sources from resolving classes written earlier by Kotlin, in both main and test compilation.
This draft adds the output directory to the nonmodular classpath and covers main/test compilation with embedded and forked javac. The four native regressions fail on unchanged production code, and the reporter's mixed Kotlin/Java project passes with the initial implementation.
Broader validation exposed stale Java bytecode reuse: after removing a source or a secondary class declaration, a full rebuild can incorrectly succeed by resolving the old class file from the output directory. The existing source-to-output cache cannot identify every javac-produced class. Reliable output ownership and cleanup are needed before enabling this behavior generally.
The annotation-processor fixture also needed to disable processing while compiling its own provider, whose service descriptor is copied before its class exists. This is restricted to the provider module; the consuming module still exercises annotation processing. Compiler 3.15 reproduces the same provider self-discovery failure.
Validation evidence:
clean verifypassed 20 tests on Java 17 and Java 21.Proposed next step: agree on compiler-output ownership tracking, including partial/full builds, failed compilations, cache migration, multiple executions and multi-release outputs, while preserving classes generated by earlier compilers.
mvn verifyvalidation after resolving the blocker.mvn -Prun-its verifypasses.