broadinstitute / cromwell

Scientific workflow engine designed for simplicity & scalability. Trivially transition between one off use cases to massive scale production environments
http://cromwell.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1k stars 359 forks source link

Is it possible to use /usr/bin/env bash instead of /bin/bash? #3201

Open scalavision opened 6 years ago

scalavision commented 6 years ago

Or maybe provide a flag to switch the default?

I get this error when running the hello world example from docs on nixos:

cromwell.core.CromwellFatalException: java.io.IOException: Cannot run program "/bin/bash": error=2, No such file or directory

Is it just to change this line?

https://github.com/broadinstitute/cromwell/blob/1b1a56372659b9cb7a168bb1fa2a2296103e1256/supportedBackends/sfs/src/main/scala/cromwell/backend/sfs/BackgroundAsyncJobExecutionActor.scala#L22

I could possibly just make my own version building from source then ..

It is due to the way nixos is built. A similar case is referenced here :

https://github.com/RcppCore/RcppArmadillo/issues/15

cjllanwarne commented 6 years ago

To answer your second question, if you're planning to build from source you'll want to find where the script is being invoked, and the internals of the script that call the user script (ie there's probably more than one instance of the string /bin/bash in the codebase).

I believe we might have bash-specific syntax in the scripts (at least at some point we did) but I laud your bravery and willingness to try it out!

tbenst commented 4 years ago

I just ran into this as well--cromwell does not work on OSes without /bin/bash. /usr/bin/env bash is more portable and IMHO the better option. The following fails to execute for me:

workflow myWorkflow {
    call myTask
}

task myTask {
    command {
        echo "hello world"
    }
    output {
        String out = read_string(stdout())
    }
}

Unfortunately this precludes me from using Cromwell.

elais commented 3 years ago

Bumping this issue because it’s also affecting me. Is it possible to sed whatever scripts are using /bin/bash to use #!/usr/bin/env bash instead?

scalavision commented 3 years ago

When I looked at it back then, it didn't seem to be impossible to make this change. Since I decided on using scala directly via Lihaoyi's os-lib, I never did the extra effort unfortunately.

Malix-Labs commented 4 months ago

I didn't need it.

I just thought you could just have submitted a pull request instead of waited for 6 years

So I did that for you; See #7469