Fix Gradle metadata repository service scoping#942
Open
jormundur00 wants to merge 1 commit into
Open
Conversation
18bbe05 to
863bdeb
Compare
863bdeb to
16564c4
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.
Fixes #415
What changed
This PR fixes multi-module Gradle builds where different subprojects configure different reachability metadata repositories.
Before this change, Native Build Tools could reuse repository settings from the first subproject that initialized the shared metadata service. That meant later subprojects could silently use the wrong metadata repository.
After this change, each subproject uses its own configured metadata repository.
Why
Multi-project builds can now safely use different metadata repositories per subproject without cross-project leakage.
Example
Before:
In some builds,
app2could still end up using the repository configuration fromapp1.After:
app1usesmetadata-repo-aandapp2usesmetadata-repo-b, matching each subproject's own configuration.Implementation summary
Validation
Run from the issue worktree with
JAVA_HOMEandGRAALVM_HOMEset to the installed GraalVM 17 runtime:./gradlew :native-gradle-plugin:functionalTest --tests "org.graalvm.buildtools.gradle.NativeConfigRepoFunctionalTest.subprojects can use different metadata repositories"passed../gradlew :native-gradle-plugin:test :native-gradle-plugin:inspectionspassed../gradlew :native-gradle-plugin:configCacheFunctionalTest --tests "org.graalvm.buildtools.gradle.NativeConfigRepoFunctionalTest.subprojects can use different metadata repositories"passed.grund fmt . --marker --checkpassed.FS-gradle-resources-and-metadata.3citations.