Skip to content

fix: make SpawnExecutor/Handler compile under @CompileStatic (#3) - #4

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/compilestatic-ext
Jun 2, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/compilestatic-ext

Conversation

@scttfrdmn

Copy link
Copy Markdown
Collaborator

Closes #3.

After the Gradle 7+ build fix (#2), compileGroovy surfaced three static-compilation errors that blocked gradle jar. All are API-conformance / static-typing issues:

  1. SpawnTaskHandler — task.config.ext?.instanceType (and region/ttl/spot) fail @CompileStatic type checking because TaskConfig.ext is an untyped map. Fixed by casting ext to Map once and using subscript access.
  2. SpawnExecutor.createTaskHandler was protected — weaker access than the public method it overrides ("cannot override ... attempting to assign weaker access privileges"). Made it public.
  3. SpawnExecutor didn't implement the abstract createTaskMonitor() from nextflow.executor.Executor. Added a TaskPollingMonitor.

Verification

With #2's build fix applied, gradle jar now builds nf-spawn-0.1.0.jar cleanly (Gradle 9.5.1, JDK 17).

Note: depends on #2 (the build.gradle fix) — this branch is off main, so its own CI won't compile until #2 merges. Merge #2 first.

Together #2 + #3 unblock the nf-spawn build in the aws-microbiome-demo AMI bake.

Three static-compilation errors blocked `gradle jar` (after the #1 build fix):

- SpawnTaskHandler: `task.config.ext?.instanceType` etc. — TaskConfig.ext is an
  untyped map, so dotted property access fails @CompileStatic type checking.
  Access via a `Map` cast + subscript instead.
- SpawnExecutor.createTaskHandler was `protected`, weaker than the public method
  it overrides — make it public.
- SpawnExecutor was missing the abstract `createTaskMonitor()` from Executor —
  implement it with a TaskPollingMonitor.

Verified `gradle jar` builds nf-spawn-0.1.0.jar cleanly (with #1's build fix,
Gradle 9.5.1 / JDK 17). Closes #3.
@scttfrdmn
scttfrdmn merged commit ee14576 into main Jun 2, 2026
@scttfrdmn
scttfrdmn deleted the fix/compilestatic-ext branch June 2, 2026 00:09
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.

@CompileStatic type-checking fails on task.config.ext property access

1 participant