nextflow-io / nf-prov

Apache License 2.0
23 stars 11 forks source link

gradlew assemble not working for local development #25

Closed stevekm closed 3 months ago

stevekm commented 5 months ago

as per the README, I ran the step

./gradlew assemble

but I get the error

FAILURE: Build failed with an exception.

* Where:
Settings file '/Users/.../nf-prov-dev/nextflow/settings.gradle' line: 21

* What went wrong:
An exception occurred applying plugin request [id: 'org.gradle.toolchains.foojay-resolver-convention', version: '0.7.0']
> Failed to apply plugin class 'org.gradle.toolchains.foojay.FoojayToolchainsPlugin'.
   > FoojayToolchainsPlugin needs Gradle version 7.6 or higher

It seems that the current version of nf-prov has this

distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip

which seems to be incompatible with the latest version of the nextflow repo

I tried changing it to this

distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip

but then I get this error

FAILURE: Build failed with an exception.

* What went wrong:
Could not open settings generic class cache for settings file '/Users/.../nf-prov-dev/nf-prov/settings.gradle' (/Users/.../.gradle/caches/7.6.2/scripts/6sr36fd7svoelv27sw2cwpzp5).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 64

Not sure what I need to do to make it work, seems like there are potentially multiple version mis-matches for Gradle / Java / etc. between the nextflow and nf-prov repos?

I am running with this version of Java (installed / managed with conda)

$ java --version
openjdk 20.0.2 2023-07-18
OpenJDK Runtime Environment Zulu20.32+11-CA (build 20.0.2+9)
OpenJDK 64-Bit Server VM Zulu20.32+11-CA (build 20.0.2+9, mixed mode, sharing)
stefanches7 commented 5 months ago

I have the same issue

bentsherman commented 5 months ago

The build scripts probably just need to be updated, in the meantime I would build against an earlier version of Nextflow

stefanches7 commented 5 months ago

Changing gradle version in distributionUrl to 7.6 in gradle/wrapper/gradle-wrapper.properties has done it for me

bentsherman commented 5 months ago

For now I updated the README to use Nextflow 23.10 when building locally. I will update it on the next stable release.

To be honest, I usually don't build this way anymore because it is brittle for other reasons. For me it is easier to simply make install and run Nextflow as usual. Doesn't require you to clone the Nextflow repo

stevekm commented 5 months ago

which version of Java and Gradle are you using?

bentsherman commented 5 months ago

Java 17, Gradle version is defined in the Nextflow and nf-prov repos

stefanches7 commented 5 months ago

And how do you run a workflow from development? Executing launch.sh gives following: image

If I use my nextflow CLI, it tells wrroc format is not accepted.

Perhaps it is a separate issue, though.

stevekm commented 5 months ago

@stefanches7 I am now using the methods outlined here https://github.com/stevekm/nf-niceutils/blob/main/NOTES.md in particular I am using the method included in the Gradle project there to move the plugin files to the location at $HOME/.nextflow/plugins, this is working better for me now. Not sure if the same method is scripted up the same way here? In that repo its the task ./gradlew unzipPlugin which I believe is coming from this file https://github.com/stevekm/nf-niceutils/blob/main/buildSrc/src/main/groovy/nextflow/plugins/UnzipPluginTask.groovy

maybe we could get the same added to this repo? Seems like this kind of method is a little more robust as alluded to by @bentsherman

stevekm commented 5 months ago

I think in this repo the same steps are wrapped up here

https://github.com/nextflow-io/nf-prov/blob/master/Makefile#L46-L50

stevekm commented 3 months ago

this is fixed by the updates in #31

this method also works;

# install local Nextflow
# wget -qO- https://get.nextflow.io | bash

./gradlew assemble

NXF_PLUGINS_DEV=$PWD/plugins ./nextflow run tests/test.nf