Question: Can't Change Working Directory in Tool Dependency Installation
1
gravatar for bgrande
4.1 years ago by
bgrande • 40
Canada
bgrande • 40 wrote:

I'm trying to automate the installation of a tool's dependency with a tool dependency definition repository. After moving the contents of a downloaded archive to the installation directory (i.e. $INSTALL_DIR), I simply want to change to that target directory away from the initial temporary working directory. However, I can't seem to change directory, either with a change_directory action or a cd shell_command action. Running pwd before and after attempting to change directory confirms this (installation log). I even made sure that $INSTALL_DIR is different from my initial working directory. 

tool shed tool galaxy • 1.4k views
ADD COMMENT • link • modified 4.1 years ago • written 4.1 years ago by bgrande • 40
1
gravatar for bgrande
4.1 years ago by
bgrande • 40
Canada
bgrande • 40 wrote:

I obtained a workaround for this issue from the galaxy-dev mailing list (see link). You can run a series of shell commands within the same shell_command action, i.e. separated by semi-colons ( ; ), in which you change directory in one of the commands. For instance, cd $INSTALL_DIR; perl INSTALL.pl.

ADD COMMENT • link written 4.1 years ago by bgrande • 40
0
gravatar for Bjoern Gruening
4.1 years ago by
Bjoern Gruening ♦ 5.1k
Germany
Bjoern Gruening ♦ 5.1k wrote:

Hi,

not sure if I can help you, but using cd as shell_command is expected to fail. You need to use cd together with an additional command. The cd of one shell_command is not persistent. change_working_directory should work, if not it is a bug. Which Galaxy version are you using?

You are trying to install a perl library right? Have you seen this kind of functionality? Maybe this solves your issue.

https://github.com/galaxyproject/tools-iuc/blob/master/test_repositories/setup_perl_environment/tool_dependencies.xml

Ciao,

Bjoern

ADD COMMENT • link written 4.1 years ago by Bjoern Gruening ♦ 5.1k

I also posted this question to the galaxy-dev mailing list (see here) and got the suggestion to string commands together in a shell_command action (see my answer to this post). Obviously, my first attempt was with the change_directory action. It's only when this didn't work that I tried the cd command. I don't know where to find the Galaxy version number, but I cloned the repository within the past week. All I can find is that it's revision 78c9a97be4b6+. 

Also, for the sake of being exhaustive, I tried using "change_working_directory" as the action type (as opposed to "change_directory", which I took from the wiki), but that produced another error (presumably due to a parsing error). So, this could be a bug, because neither "change_directory" nor "change_working_directory" changed the working directory permanently (based on running pwd right after). 

By the way, this is for installing Ensembl VEP, not a Perl module. However, I will take note of the setup_perl_environment action type for other tools. It will come in handy. Thanks!

ADD REPLY • link written 4.1 years ago by bgrande • 40

Hi,

this is really strange and maybe a bug. You can see the change_directory tag here in action:

https://toolshed.g2.bx.psu.edu/view/iuc/package_perl_5_18

And according to the usual unit tests that are running daily in the Tool Shed it is working.

Ciao,

Bjoern

 

ADD REPLY • link written 4.1 years ago by Bjoern Gruening ♦ 5.1k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 175 users visited in the last hour