Skip to content

Upgrade to Groovy 5#6220

Draft
bentsherman wants to merge 1 commit intomasterfrom
groovy5
Draft

Upgrade to Groovy 5#6220
bentsherman wants to merge 1 commit intomasterfrom
groovy5

Conversation

@bentsherman
Copy link
Member

Initial attempt to upgrade to Groovy 5.

Benefits:

  • new collection functions like zip (can be added to Nextflow standard library)
  • pattern matching for instanceof (can be added to Nextflow language)
  • use _ for placeholder variables (can be added to Nextflow language)

Changes:

  • Had to remove generic type arguments from instanceof checks as the Groovy parser doesn't allow it anymore

  • Had to add @Slf4j to some inner classes to make log work in that class. not sure if this is a bug or just a breaking change

Current issues:

  • Groovy complained about a few implementers of CacheFunnel, even though I didn't see anything wrong. Converting CacheFunnel to Java fixed the issue for one but not the other

  • Multiple issues with the type checker that I'm pretty sure are just Groovy bugs, particularly CmdLog and DumpOp

  • The type checker does not recognize target in TaskConfig as a Map, seems like a bug. I wonder if it's an edge case since target is defined in super class as private and a Delegate

Overall it looks like Groovy 5 beta still has a few compiler bugs to sort out. But I'm excited to get it working so that I can bring the new pattern matching features into the Nextflow language.

@bentsherman bentsherman requested a review from a team as a code owner June 25, 2025 19:33
@netlify
Copy link

netlify bot commented Jun 25, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 5f0a0c6
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/685c4ef8f0e52800088d8c64

@bentsherman bentsherman marked this pull request as draft June 25, 2025 19:33
@pditommaso
Copy link
Member

Worth following this discussion, it looks like there are not negligile perf issue with Groovy 5 and invoke dynamic apache/grails-core#15293

@bentsherman
Copy link
Member Author

Interesting, it looks similar to the issues they had with Groovy 4.

It looks like one commenter avoided the perf issues by using @CompileStatic and converting code to Java. Since most of the Nextflow codebase is already statically compiled, I suspect we won't be affected as much. But we'll have to run a benchmark to know for sure

@netlify
Copy link

netlify bot commented Jan 6, 2026

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 2fd3f57
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/69a12cd4c033f4000804e7d6

@bentsherman bentsherman force-pushed the groovy5 branch 2 times, most recently from 5ef5502 to d74933b Compare February 27, 2026 04:54
@bentsherman bentsherman marked this pull request as ready for review February 27, 2026 04:54
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@bentsherman
Copy link
Member Author

Found sensible workarounds to all of the compile errors

Now the problem is failing tests

There seems to be an issue with Path semantics:

  • assert path always fails and you have to do assert path != null instead
  • lots of failures seem to be paths not being resolved correctly (e.g. tmp test dir vs launch dir)

I know that we modified Path behavior with some Groovy magic, so likely something is broken with that

@pditommaso pditommaso force-pushed the master branch 2 times, most recently from d9fa5cd to d752bc2 Compare February 28, 2026 13:10
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.

2 participants