Skip to content

nextflow: 22.10.6 -> 24.08.0-edge + remove buildFHSEnv + compile from source + add tests - #339197

Merged
doronbehar merged 5 commits into
NixOS:masterfrom
rollf:nextflow-24.04.4
Oct 2, 2024
Merged

doronbehar merged 5 commits into
NixOS:masterfrom
rollf:nextflow-24.04.4

Conversation

@rollf

@rollf rollf commented Sep 3, 2024 •

Copy link
Copy Markdown
Contributor

There is no need to use buildFHSEnv (anymore) on Linux. I removed it here because a) it makes the code cleaner, b) improves access (e.g. the version will be shown on https://search.nixos.org/packages?query=nextflow) and c) allows to add & run tests.

Update 2024-09-06

This PR is a complete rewrite of the nextflow derivation:

  • Do not use buildFSHEnv anymore but rather patch the original source (so that /bin/bash is not referenced anymore)
  • The above is only possible when compiling from source (instead of downloading a release), this is done using gradle
  • Update nextflow version
  • Use the latest Java version
  • Add tests

This PR supersedes a previous one prepared by @edmundmiller. I have incorporated his openjdk change.

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg Bot added the 8.has: package (new) This PR adds a new package label Sep 3, 2024
@ofborg
ofborg Bot requested a review from Etjean September 3, 2024 08:33
@ofborg ofborg Bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Sep 3, 2024
Comment on lines 51 to 93

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we could get away with a nextflow run hello too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mh, I think this needs internet access, right? I tried to run this and this yields:

❯ nix build path:.#nextflow.tests.hello
error: builder for '/nix/store/k7ic1jfrcmyiaxckk5ziqgcjvic1ckaw-nextflow-run-hello.drv' failed with exit code 1;
       last 10 log lines:
       > sourcing setup hook '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh'
       > sourcing setup hook '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh'
       > sourcing setup hook '/nix/store/aazf105snicrlvyzzbdj85sx4179rpfp-set-source-date-epoch-to-latest.sh'
       > sourcing setup hook '/nix/store/gps9qrh99j7g02840wv5x78ykmz30byp-strip.sh'
       >
       >  N E X T F L O W   ~  version 24.04.4
       >
       > Pulling nextflow-io/hello ...
       > WARN: Cannot read project manifest -- Cause: api.github.com
       > Cannot find `nextflow-io/hello` -- Make sure exists a GitHub repository at this address `https://github.com/nextflow-io/hello`
       For full logs, run 'nix log /nix/store/k7ic1jfrcmyiaxckk5ziqgcjvic1ckaw-nextflow-run-hello.drv'.
-  passthru.tests.version = testers.testVersion {
-    package = nextflow;
-    command = "HOME=$TMPDIR nextflow -version";
+  passthru.tests = {
+    version = testers.testVersion {
+      package = nextflow;
+      command = "HOME=$TMPDIR nextflow -version";
+    };
+    hello = runCommand "nextflow-run-hello" {nativeBuildInputs = [nextflow];} ''
+      HOME=$TMPDIR
+      nextflow run hello
+      touch $out
+    '';
   };

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a hello test by simply downloading the necessary pipeline upfront.

@rollf

rollf commented Sep 5, 2024 •

Copy link
Copy Markdown
Contributor Author

Ah, and upon further testing, not using buildFSHEnv doesn't work :(

EDIT: It does now.

@ofborg
ofborg Bot requested a review from edmundmiller September 5, 2024 23:49
@ofborg ofborg Bot added the 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. label Sep 5, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not checked whether all the listed nativeBuildInputs are really necessary.

@SFrijters SFrijters Sep 13, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort of related: I've been cleaning up error: makeWrapper/makeShellWrapper must be in nativeBuildInputs in cross-compilation scenarios, and while makeWrapper is correctly placed in nativeBuildInputs here, using lib.makeBinPath on it causes the error to appear in builds of reverse dependencies (in this case nf-test). I think it would make sense to keep only makeWrapper inside the actual nativeBuildInputs attribute and move the rest (or at least the ones that are necessary) to be just passed directly to lib.makeBinPath. Currently still running a build without your PR, but with this change.
nf-test needs a similar fix itself as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(See this commit for an implementation of the suggested approach)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SFrijters I adapted the code as you suggested and sucessfully run nix build -L path:.#nextflow.tests.hello. I have updated this PR now.

@rollf rollf Sep 6, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unhappy with this but could not get nextflow to compile otherwise. I don't know whether this is an issue with mitm-cache (i.e. maybe it does not correctly provide the dependencies) or an issue with nextflow's gradle config (i.e. it does not correctly list [transitive?] deps).

I was able to compile nextflow without issues in a nix-shell env with just javac & make at hand. But using the mitm-cache approach (as necessary for a derivation which should build deterministically), some deps were simply not fetched. For example, when removing api "org.ow2.asm:asm-util:9.7" (from the patch), the compilation aborts with:

...
nextflow> > Task :plugins:nf-wave:processResources
nextflow> > Task :nf-commons:compileGroovy FAILED
nextflow> > Task :plugins:nf-azure:copyPluginLibs
nextflow> > Task :plugins:nf-amazon:copyPluginLibs
nextflow> > Task :plugins:nf-google:copyPluginLibs
nextflow> FAILURE: Build failed with an exception.
nextflow> * What went wrong:
nextflow> Execution failed for task ':nf-commons:compileGroovy'.
nextflow> > Could not resolve all files for configuration ':nf-commons:detachedConfiguration1'.
nextflow>    > Could not find org.ow2.asm:asm-util:9.7.
nextflow>      Searched in the following locations:
nextflow>        - https://repo.maven.apache.org/maven2/org/ow2/asm/asm-util/9.7/asm-util-9.7.pom
nextflow>        - https://repo.eclipse.org/content/groups/releases/org/ow2/asm/asm-util/9.7/asm-util-9.7.pom
nextflow>        - https://oss.sonatype.org/content/repositories/snapshots/org/ow2/asm/asm-util/9.7/asm-util-9.7.pom
nextflow>        - https://s3-eu-west-1.amazonaws.com/maven.seqera.io/releases/org/ow2/asm/asm-util/9.7/asm-util-9.7.pom
nextflow>        - https://s3-eu-west-1.amazonaws.com/maven.seqera.io/snapshots/org/ow2/asm/asm-util/9.7/asm-util-9.7.pom
nextflow>      Required by:
nextflow>          project :nf-commons > org.apache.groovy:groovy-console:4.0.22
nextflow> * Try:
nextflow> > Run with --stacktrace option to get the stack trace.
nextflow> > Run with --info or --debug option to get more log output.
nextflow> > Run with --scan to get full insights.
nextflow> > Get more help at https://help.gradle.org.
nextflow> Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
nextflow> You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
nextflow> For more on this, please refer to https://docs.gradle.org/8.8/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
nextflow> BUILD FAILED in 40s
nextflow> 19 actionable tasks: 19 executed

I tested with

nix build -L .#nextflow.mitmCache.updateScript && ./result && nix build -L  .#nextflow

The mitmCache.updateScript runs throught but building itself yields the above errors.

Here is the diff to reproduce the error:

diff --git a/pkgs/development/interpreters/nextflow/add-build-dependencies.patch b/pkgs/development/interpreters/nextflow/add-build-dependencies.patch
index ccc774245d8c..cfd4d3629c16 100644
--- a/pkgs/development/interpreters/nextflow/add-build-dependencies.patch
+++ b/pkgs/development/interpreters/nextflow/add-build-dependencies.patch
@@ -2,7 +2,7 @@ diff --git a/modules/nf-commons/build.gradle b/modules/nf-commons/build.gradle
 index 2a5c6ec70..a29305106 100644
 --- a/modules/nf-commons/build.gradle
 +++ b/modules/nf-commons/build.gradle
-@@ -26,6 +26,12 @@ sourceSets {
+@@ -26,6 +26,11 @@ sourceSets {

  dependencies {
      api "ch.qos.logback:logback-classic:1.4.14"
@@ -10,7 +10,6 @@ index 2a5c6ec70..a29305106 100644
 +    api "org.apache.groovy:groovy-datetime:4.0.22"
 +    api "org.apache.groovy:groovy-dateutil:4.0.22"
 +    api "org.apache.groovy:groovy-sql:4.0.22"
-+    api "org.ow2.asm:asm-util:9.7"
 +    api "org.abego.treelayout:org.abego.treelayout.core:1.0.3"
      api "org.apache.groovy:groovy:4.0.22"
      api "org.apache.groovy:groovy-nio:4.0.22"

I basically just copy & pasted the "missing" deps from the error messages and build the patch accordingly.

@rollf

rollf commented Sep 6, 2024

Copy link
Copy Markdown
Contributor Author

@edmundmiller @Etjean I went down the rabbit hole of compiling nextflow on my own. I feel that the result is promising. Please check out the current state. I haven't sqashed my work yet.

@rollf

rollf commented Sep 6, 2024

Copy link
Copy Markdown
Contributor Author

@chayleaf Would you be able to have a look into the gradle dependency problem that I have explained above? Maybe we could somehow improve the situation.

@rollf rollf changed the title nextflow: 22.10.6 -> 24.04.4 + remove buildFHSEnv + add test nextflow: 22.10.6 -> 24.08.0-edge + remove buildFHSEnv + compile from source + add tests Sep 6, 2024
@rollf
rollf marked this pull request as ready for review September 6, 2024 04:12

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
src = fetchurl {
src = fetchFromGitHub {
rev = "6e866ae81ff3bf8a9729e9dbaa9dd89afcb81a4b";
owner = "nextflow-io";
repo = "nextflow";

Make sure to regenerate the hash, just in case

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default update task simply downloads every dependency, but additional dependencies may be added during the build process (it's called detached configurations). You can either work around the issue by getting rid of the Gradle code that uses detached configurations, make the update script run use these configurations by running a full build.

For the former approach, you'd have to locate the code that uses detached configurations. For example, for an app using Launch4j you'd have to build a jar instead of a bash wrapper and wrap it manually.

For the latter approach, you can just do

Suggested change
patches = [ ./add-build-dependencies.patch ];
gradleUpdateTask = "pack";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for looking into this! Your suggestions (gradleUpdateTask) works fine. It is much better than a not-so-future-proof patch.

Comment on lines 83 to 84

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
src = fetchurl {
url = "https://github.com/nextflow-io/hello/archive/afff16a9b45c8e8a4f5a3743780ac13a541762f8.tar.gz";
src = fetchFromGitHub {
owner = "nextflow-io";
repo = "hello";
rev = "afff16a9b45c8e8a4f5a3743780ac13a541762f8";

Comment on lines 29 to 35

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which of these are actually needed? bash and openjdk most likely aren't

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right. I removed both. I check the others and found that wget as well as ata least one of the others (I commented out accordingly) are needed. Than I stopped investigating. I assume now that the dependencies haven't changed.

@rollf

rollf commented Sep 13, 2024

Copy link
Copy Markdown
Contributor Author

@nbraud @NickCao You two have previously merged nf-test-PRs. Do you mind looking into this one and maybe merge it? Thanks.

@rollf

rollf commented Sep 16, 2024

Copy link
Copy Markdown
Contributor Author

I realize that something is still wrong with the "fixed" shebang. While execution works fine when running on the host, using docker.enabled = true yields issues (bash not found). I'll have to investigate this :(

@rollf
rollf marked this pull request as draft September 16, 2024 13:56
Comment on lines 81 to 84

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@doronbehar

Copy link
Copy Markdown
Contributor

Looks good overall.

@doronbehar doronbehar mentioned this pull request Sep 16, 2024
3 of 13 tasks
@rollf

rollf commented Sep 17, 2024

Copy link
Copy Markdown
Contributor Author

@doronbehar Thank you for your review. I'll address you remarks.

@github-actions github-actions Bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Sep 20, 2024
@rollf

rollf commented Sep 20, 2024 •

Copy link
Copy Markdown
Contributor Author

@doronbehar I adressed your concerns. The versionCheckHook fails. I somehow need to provide the env var HOME or NXF_HOME (see docs, or here). This is not possible IMHO with the hook. I tested setting up preVersionHook but the env anyway looses all environment variables. nextflow does not have another way other than using an env var. I don't see a mean to use the hook right now. Let me know what you think.

EDIT:

❯ env --chdir=/ --argv0=nextflow --ignore-environment /nix/store/2dhvjd654ymb2n7fwm4lfw5jgnianpdd-nextflow-24.08.0-edge/bin/nextflow
mkdir: cannot create directory '/.nextflow': Permission denied
Exception in thread "main" java.lang.ExceptionInInitializerError
        at nextflow.cli.Launcher.init(Launcher.groovy:126)
        at nextflow.cli.Launcher.<init>(Launcher.groovy:87)
        at nextflow.cli.Launcher.main(Launcher.groovy:657)
Caused by: java.lang.IllegalStateException: Cannot create path '/.nextflow' -- check file system access permission
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at nextflow.Const.getHomeDir(Const.groovy:63)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at nextflow.Const.<clinit>(Const.groovy:47)
        ... 3 more

Groovy code

EDIT: for future reference:

# TODO: Set NXF_HOME=$TMPDIR or similar.
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;

@doronbehar doronbehar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, is this a draft because of the versionCheckHook failing?

Comment on lines 88 to 89

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a mean to use the hook right now. Let me know what you think.

Yes so it seems.. I wonder whether this is maybe case is not that extreme, and we should support adding arbitrary arguments to the env command. For now, I'll leave it as it is, and we can go with passthru.tests on this one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I also wondered whether this package justifies adapting versionCheckHook. This is beyond my exptertise.

I have added & used testers.testVersion again.

@rollf

rollf commented Sep 23, 2024

Copy link
Copy Markdown
Contributor Author

Looks good, is this a draft because of the versionCheckHook failing?

Yes. It it builds for me (locally) and I also integrated your remarks. Thanks again! The PR is ready from my point of view. I'll keep it as a draft for some time (this week?) since I'd like to test it more (using my local machine). I've had issues before (with docker, see above) that I only realized when actually using the package. I'd like to make sure it works at least for my use case.

Here is the last diff, btw.

@doronbehar doronbehar left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh and BTW, it'd be nice to split the commits a bit. I'd do it like this:

nextflow: build from source
nextflow: add a passthru.tests.version
tests/nextflow: init

Comment thread nixos/tests/nextflow.nix Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure you aware of that due to the draft state, but I'm just noting that it'd be nice to take a decision here.

@rollf

rollf commented Sep 24, 2024

Copy link
Copy Markdown
Contributor Author

Oh and BTW, it'd be nice to split the commits a bit. I'd do it like this:

Done. I also addressed your other remarks.

@doronbehar doronbehar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll be ready to merge this when you are :)

@rollf

rollf commented Sep 26, 2024

Copy link
Copy Markdown
Contributor Author

@doronbehar This is fine from my point of view now. I don't understand the merge conflict I'm currently seeing.
image

I'm converting this to "ready for review". I think it could be merged (assuming the merge conflict is a GitHub bug?).

@edmundmiller and @Etjean (the maintainers) haven't said anything though.

@rollf
rollf marked this pull request as ready for review September 26, 2024 07:03
`nextflow` is no build by compiling from source instead of using the
downloaded release file. This improves the overall accesibility
(`version` will be shown on https://search.nixos.org/packages?query=nextflow)
and allows to add & run tests more easily.
@doronbehar

Copy link
Copy Markdown
Contributor

@rollf the merge conflict is not a mistake. I was because someone did a change that changed stdenv.isLinux -> stdenv.hostPlatform.isLinux, and then Git wasn't sure whether to delete these now new lines or not. I wanted to check that locally, and while I was there I fixed the conflict and force pushed. Please remind me again tomorrow to merge this when CI is green.

@SFrijters

Copy link
Copy Markdown
Member

@doronbehar Ping as requested :)

@doronbehar doronbehar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to hold this further.. Found this issue:

Comment thread nixos/tests/nextflow.nix
bash = pkgs.dockerTools.pullImage {
imageName = "quay.io/nextflow/bash";
imageDigest = "sha256:bea0e244b7c5367b2b0de687e7d28f692013aa18970941c7dd184450125163ac";
sha256 = "161s9f24njjx87qrwq0c9nmnwvyc6iblcxka7hirw78lm7i9x4w5";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hash is different for aarch64-linux apparently (quoting from ofborg):

error: hash mismatch in fixed-output derivation '/nix/store/75i49g2lqizqy7wynln75imsw7dhznfx-docker-image-quay.io-nextflow-bash-latest.tar.drv':
         specified: sha256-hZOe4qkUHZ4jPGp2Rlc0zG9uq00MYJ7xQV1KS4RLOpg=
            got:    sha256-oUiM5XRHWbogXfjmSMDaKvG2ZQy0d4GziFWyLFWc0C4=

I wonder if we should simply do this:

Suggested change
sha256 = "161s9f24njjx87qrwq0c9nmnwvyc6iblcxka7hirw78lm7i9x4w5";
sha256 = {
x86_64-linux = "161s9f24njjx87qrwq0c9nmnwvyc6iblcxka7hirw78lm7i9x4w5";
aarch64-linux = "sha256-oUiM5XRHWbogXfjmSMDaKvG2ZQy0d4GziFWyLFWc0C4=";
}.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");

Or disable the test on platforms not x86_64-linux. I tend to the do the later, as it would be hard to fix further issues with aarch64-linux we might encounter, and I assume that both of us are losing patience :).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently openjdk doesn't build for me in cross, so I don't think we'll be getting around to running the tests (or the application itself) in cross any time soon anyway. I don't have a big stake in this but I would recommend indeed just disabling the tests for cross.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently openjdk doesn't build for me in cross, so I don't think we'll be getting around to running the tests (or the application itself) in cross any time soon anyway. I don't have a big stake in this but I would recommend indeed just disabling the tests for cross.

We are not talking about cross compilation from x86_64-linux to aarch64-linux, but rather native building of the NixOS test derivation on aarch64-linux. openjdk builds fine on aarch64-linux according to hydra-check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, wow. Why could the hash be different in the first place? I don't have an opinion here so I'd follow @doronbehar suggestions to only support x86_64-linux. I would disable the test within the nextflow-derivation itself (i.e. passthru.tests.default = if host platform ...), right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would disable the test within the nextflow-derivation itself (i.e. passthru.tests.default = if host platform ...), right?

That would make ofborg avoid building that derivation when it looks up nextflow.passthru.tests, but still your commit nixos/nextflow will make at least Hydra try to build that test on aarch64-linux. You can use the handleTestOn function that is used in all-tests.nix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a new commit using handleTestOn.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the hash is different because the data on the docker image differs among architectures/systems. Maybe one could have both hashes, depending on the $system. That might be something for the future.

The docker image hash seems to differ on different systems.
See NixOS#339197 (comment)
@doronbehar

Copy link
Copy Markdown
Contributor

I have some more bad news, the x86_64-darwin build of nextflow itself fails. I also verified it on a real Darwin machine:

> Task :packOne FAILED
Attempt to copy /private/tmp/nix-build-nextflow-24.08.0-edge.drv-0/source/modules/nextflow/build/libs/nextflow-24.08.0-edge-one.jar to /var/empty/.nextflow/framework/24.08.0-edge/nextflow-24.08.0-edge-one.jar using NIO Channels failed due to 'failed to create the parent directory for /var/empty/.nextflow/framework/24.08.0-edge/nextflow-24.08.0-edge-one.jar'.  Falling back to streams.
FAILURE: Build failed with an exception.
* Where:
Script '/private/tmp/nix-build-nextflow-24.08.0-edge.drv-0/source/packing.gradle' line: 97
* What went wrong:
Execution failed for task ':packOne'.
> Failed to copy /private/tmp/nix-build-nextflow-24.08.0-edge.drv-0/source/modules/nextflow/build/libs/nextflow-24.08.0-edge-one.jar to /var/empty/.nextflow/framework/24.08.0-edge/nextflow-24.08.0-edge-one.jar due to java.nio.file.NoSuchFileException /var/empty/.nextflow/framework/24.08.0-edge/nextflow-24.08.0-edge-one.jar

And on Hydra the nextflow package doesn't fail to build (that's because it is much easier to build an FHS environment). Meaning this will be apparent for Darwin users. I really want to help and merge this, but I have no idea what are the chances that this package is used by some Darwin users, that will be annoyed to find out a change has broken their package.

@rollf

rollf commented Oct 1, 2024

Copy link
Copy Markdown
Contributor Author

@doronbehar I checked this. I think the issues stems from here in combination with this copy operation. I wonder why this is not a problem on Linux. Maybe the gradle build is different. I just pushed a fix but forgot to compile it locally first. I am doing this right now. At least, I can check on Linux that it still works. Fingers crossed then for the x86_64-darwin build.

@doronbehar

Copy link
Copy Markdown
Contributor

Similar error:

> Task :plugins:nf-console:compileGroovy
> Task :plugins:nf-console:classes
> Task :plugins:nf-codecommit:compileGroovy
> Task :plugins:nf-codecommit:classes
> Task :plugins:nf-amazon:classes
> Task :plugins:nf-tower:compileGroovy
> Task :plugins:nf-tower:classes
> Task :plugins:nf-wave:compileGroovy
> Task :plugins:nf-wave:classes
> Task :plugins:nf-google:compileGroovy
> Task :plugins:nf-google:classes

> Task :plugins:nf-azure:compileGroovy
07:28:45.138 [/127.0.0.1:53237 to /127.0.0.1:53235 workers] DEBUG com.azure.core.implementation.ReflectionUtils -- Attempting to use java.lang.invoke package to handle reflection.
07:28:45.146 [/127.0.0.1:53237 to /127.0.0.1:53235 workers] DEBUG com.azure.core.implementation.ReflectionUtils -- Successfully used java.lang.invoke package to handle reflection.

> Task :plugins:nf-azure:classes
> Task :compile
> Task :nextflow:shadowJar

> Task :packDist
+ Nextflow package `ALL` copied to: /private/tmp/nix-build-nextflow-24.08.0-edge.drv-0/source/build/releases/nextflow-24.08.0-edge-dist


> Task :packOne FAILED
Attempt to copy /private/tmp/nix-build-nextflow-24.08.0-edge.drv-0/source/modules/nextflow/build/libs/nextflow-24.08.0-edge-one.jar to /var/empty/.nextflow/framework/24.08.0-edge/nextflow-24.08.0-edge-one.jar usi>

FAILURE: Build failed with an exception.

* Where:
Script '/private/tmp/nix-build-nextflow-24.08.0-edge.drv-0/source/packing.gradle' line: 97

* What went wrong:
Execution failed for task ':packOne'.
> Failed to copy /private/tmp/nix-build-nextflow-24.08.0-edge.drv-0/source/modules/nextflow/build/libs/nextflow-24.08.0-edge-one.jar to /var/empty/.nextflow/framework/24.08.0-edge/nextflow-24.08.0-edge-one.jar du>

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

@doronbehar

Copy link
Copy Markdown
Contributor

The above was taken from The community's Darwin builder

@rollf
rollf force-pushed the nextflow-24.04.4 branch from ea490db to f481bad Compare October 2, 2024 04:08
@rollf

rollf commented Oct 2, 2024

Copy link
Copy Markdown
Contributor Author

I update my fix commit. I guess setting HOME did not work so I changed the gradle args. Still builds locally. Let's see what the darwin builder is saying.

@doronbehar doronbehar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done 🎉 I tested it on the darwin build box and it worked :).

@doronbehar
doronbehar merged commit cb793d5 into NixOS:master Oct 2, 2024
@stianlagstad

Copy link
Copy Markdown
Contributor

Thank you all very much for the work on this! 💯 🙌

@rollf

rollf commented Oct 2, 2024

Copy link
Copy Markdown
Contributor Author

Cool! Thank you @doronbehar for your support. It did feel like a team effort 👍 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants