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

canu should use the perl it is run with #2215

Closed
EricDeveaud opened this issue Mar 18, 2023 · 0 comments
Closed

canu should use the perl it is run with #2215

EricDeveaud opened this issue Mar 18, 2023 · 0 comments
Assignees

Comments

@EricDeveaud
Copy link

Hello,

canu may be set to. use a specific perl via sheebang edition, or launched using a specific perl not in user path.

when run canu check for perl in user path via Execution.pm using which perl that may return incorrect result.
eg

rpm_maker:canu/2.2 > which perl
/usr/bin/perl
rpm_maker:canu/2.2 > /opt/gensoft/adm/bin/perl /opt/gensoft/exe/canu/2.2/bin/canu -p ecoli      -d ecoli-pacbio      genomeSize=4.8m      -pacbio ../../datas/canu/pacbio.fastq

but canu will found and use /usr/bin/perl

see

Found perl:
   /usr/bin/perl
   This is perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-linux-thread-multi

and will generate some perl scripts using this one.

won't it be more logical, as canu knows the perl interpreter it was run with using $^X see: https://perldoc.perl.org/perlvar#$EXECUTABLE_NAME

to modifiy Execution.pm to. use. this predefined variable, this way.

--- lib/perl5/canu/Execution.pm.orig	2023-03-18 10:28:23.392717937 +0000
+++ lib/perl5/canu/Execution.pm	2023-03-18 10:30:01.344031609 +0000
@@ -440,9 +440,9 @@
     $string .= "#  Report paths.\n";
     $string .= "\n";
     $string .= "echo \"\"\n";
-    $string .= "echo \"Found perl:\"\n";
-    $string .= "echo \"  \" `which perl`\n";
-    $string .= "echo \"  \" `perl --version | grep version`\n";
+    $string .= "echo \"using perl:\"\n";
+    $string .= "echo \"  \" $^X\n";
+    $string .= "echo \"  \" `$^X --version | grep version`\n";
     $string .= "echo \"\"\n";
     $string .= "echo \"Found java:\"\n";
     $string .= "echo \"  \" `which $javaPath`\n";
@@ -686,7 +686,7 @@
     print F "rm -f canu.out\n";
     print F "ln -s $scriptOut canu.out\n";
     print F "\n";
-    print F "/usr/bin/env perl \\\n";
+    print F "$^X \\\n";
     print F "\$bin/" . basename($0) . " " . getCommandLineOptions() . " canuIteration=" . getGlobal("canuIteration") . "\n";
     close(F);

regards

Eric

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

No branches or pull requests

2 participants