Skip to content
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

Trinity: need to remove @ from paths in perl script #14466

Closed
bernt-matthias opened this issue Apr 13, 2019 · 11 comments
Closed

Trinity: need to remove @ from paths in perl script #14466

bernt-matthias opened this issue Apr 13, 2019 · 11 comments

Comments

@bernt-matthias
Copy link
Contributor

@bernt-matthias bernt-matthias commented Apr 13, 2019

Happens within Galaxy which uses the @ character in the environment names.

Error is:

Possible unintended interpolation of @2 in string at /gpfs1/data/galaxy_server/galaxy-dev/database/dependencies/_conda/envs/__trinity@2.8.4/bin/Trinity line 46.

Had the same problem in the stacks2 wrapper. For variables setting path to binaries that are on the PATH anyway the solution is to set them to an empty string.

For the others (like paths to jar files), a fix might involve using some pwd magic.

@epruesse
Copy link
Member

@epruesse epruesse commented Apr 23, 2019

Is this a Bioconda issue (packaging) or an upstream problem at Trinity (software)?

ping @bgruening - if this is galaxy specific, maybe you know who could help.

Loading

@bernt-matthias
Copy link
Contributor Author

@bernt-matthias bernt-matthias commented Apr 24, 2019

Kind of both: The cause of the problem is that galaxy uses an @ character in the environment names (__name@version).

If perl packages/programs use hard coded paths (e.g. via an install script that uses BIN_DIR as parameter) for dependencies, then the perl interpreter has problems in this case since the @ should be quoted.

One solution is to remove the hard coded paths (which I did for stacks) since the binaries are on the PATH anyway. Alternatively the @ could be quoted. Don't know if conda could do this in general for BIN_DIR (or all its path).

Loading

@epruesse
Copy link
Member

@epruesse epruesse commented Apr 24, 2019

So basically, you are saying that Trinity's perl code breaks if Trinity is installed into a directory that has an @ in it? That sounds like something that needs to be fixed in Trinity. Galaxy is doing something unusual, but nothing wrong. Neither is Conda when it rewrites the paths. How does the proper Perl Quoting look like? It might be something to add to conda - rewrite the strings with correct quoting if it's a perl file.

Loading

@bernt-matthias
Copy link
Contributor Author

@bernt-matthias bernt-matthias commented Apr 25, 2019

I'm no perl expert, but \@ should do the trick.

Loading

@epruesse
Copy link
Member

@epruesse epruesse commented Apr 25, 2019

@msarahan Can you pitch in with suggestions here?

From bin/Trinity:

#!/usr/bin/env perl
[...]
my $TRIMMOMATIC = "/opt/anaconda1anaconda2anaconda3/share/trimmomatic/trimmomatic.jar";

So installing into an env with $ or @ in it breaks the script during path rewriting.

Do you have code handling this for bash? Is there a chance to add code to conda to escape the @ for perl files?

Loading

@msarahan
Copy link

@msarahan msarahan commented Apr 25, 2019

no, I don't think we have anything for that currently. A PR to add it would be welcome.

Loading

@epruesse
Copy link
Member

@epruesse epruesse commented Apr 25, 2019

Quick pointer where it would have to go? (term that can be grepped suffices)

Loading

@epruesse
Copy link
Member

@epruesse epruesse commented Apr 25, 2019

@bernt-matthias For the time being, can you come up with a patch for Trinity? Using ' instead of " should suffice for the variables in question. A PR against conda would fix this for good, but take quite a while until it has arrived at everyone's desks.

Loading

@epruesse
Copy link
Member

@epruesse epruesse commented Apr 25, 2019

(Or use q[text] or q{text} or q(text) instead. Perl has a veritable arsenal of ways to write a string constant)

Loading

@epruesse
Copy link
Member

@epruesse epruesse commented Apr 25, 2019

I've created an issue for now (conda/conda#8601), adding to the nearly 1k open ones over there.

Loading

@bernt-matthias
Copy link
Contributor Author

@bernt-matthias bernt-matthias commented Apr 26, 2019

done #14741

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants