Skip to content

fix(spin-common,spin-java-module): enforce cross-project compile ordering from module graph#86

Merged
deer merged 1 commit into
mainfrom
parallel_fix
May 25, 2026
Merged

fix(spin-common,spin-java-module): enforce cross-project compile ordering from module graph#86
deer merged 1 commit into
mainfrom
parallel_fix

Conversation

@deer
Copy link
Copy Markdown
Collaborator

@deer deer commented May 25, 2026

Invocable.dependencies() hardcoded getProject() on every @From reference, so the task graph contained no cross-project edges at all. The parallel scheduler could — and did — run A.DetectCompilationResolution before B.Compile finished, caching a module path that omitted B entirely. PR #63 turned a pre-existing race condition into a guaranteed failure: before it, the non-existent sibling output path was always added to candidates and javac would silently skip it; after it, Optional.empty() from resolveFallbackOutput dropped the sibling completely.

  • Adds Plugin.projectDependencies(forTaskClass) — a new extension point in spin-api that lets plugins declare cross-project task dependencies. Default implementation returns an empty stream so existing plugins are unaffected.
  • Overrides DefaultInvocable.dependencies() in spin-common to concatenate intra-project @From dependencies with plugin.projectDependencies(taskClass), feeding cross-project references into the existing scheduler machinery with no changes to DefaultProgram.
  • Implements projectDependencies in AbstractJavaPlugin: when the task being scheduled is an AbstractDetectResolution subclass (main or test), reads the plugin's module descriptor, finds workspace siblings that own any of the required module names, and returns those siblings' Compile task references as ordering constraints.

@deer deer merged commit 3d9eda6 into main May 25, 2026
1 check passed
@deer deer deleted the parallel_fix branch May 25, 2026 12:52
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.

1 participant