-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bash not found when running nextflow project in NixOs #188221
Comments
your nf script is wrong. this works: // main.nf
nextflow.enable.dsl=2
process sayHello {
output:
stdout
"""
echo hello
"""
}
workflow {
sayHello | view
}
we could rewrite syscalls from
to our version of bash |
I went ahead and build a FHS User environment using this flake: {
inputs = {};
outputs = {self, nixpkgs, ...}:
let
system = "x86_64-linux";
pkgs = import nixpkgs{inherit system;};
in
{
devShells.${system}.default = with pkgs; (pkgs.buildFHSUserEnv {
name = "nextflow";
targetPkgs = pkgs: [pkgs.openjdk];
}).env;
};
} run |
Thanks for the tip. Is there any way to run nextflow on NixOs outside a shell though ? |
You could actually package the nextflow executable in a FHS environment and specify the |
I'll probably get around to making a pull request to nixpkgs at some point, but in the meantime here is a flake that you can use. |
It probably makes more sense to do some kind of substitution, but |
Just cross-posting this nextflow-io/nextflow#1598 (comment) I've had zero issues after doing that for anyone who just wants it to run. |
Well, looks like I've done this work for nothing. It was already packaged!: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/interpreters/nextflow/default.nix @apraga you should close this issue. |
@IllustratedMan-code Unless I'm mistaken, the current version does package bash as coreutils inside the $PATH but nextflow really wants @emiller88 Your solution worked for me but I wanted to discuss a more flexible solution if possible. |
@apraga you're right, I am able to reproduce the issue with the version in nixpkgs. |
I'll try to clean up my derivation and submit to nixpkgs. |
refactor) (Updates nexflow and adds a FHSUserEnv to fix NixOS#188221)
@apraga, just letting you know I made a pull request with the buildFHSUserEnv solution. |
@IllustratedMan-code Thanks for your work ! I no longer have access to a NixOs environment for the moment, but it may help other people :) |
Describe the bug
Nextflow expects /bin/bash to exists when running projects. This is fixed by
ln -s /run/current-system/sw/bin/bash /bin/bash
as mentionned in nextflow-io/nextflow#1598.Should it be part of the nix package ?
Steps To Reproduce
Steps to reproduce the behavior:
main.nf
nextflow run main.f
Expected behavior
A normal execution.
Screenshots
Additional context
Error message
Notify maintainers
@Etjean
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: