[Rt-commit] rt branch, 4.4/fix-perl-path-for-mac-in-test, created. rt-4.4.2-133-gf9628efeb

? sunnavy sunnavy at bestpractical.com
Fri Apr 13 15:35:21 EDT 2018


The branch, 4.4/fix-perl-path-for-mac-in-test has been created
        at  f9628efeb87d0bfdbc5e2f75eabb738997495d69 (commit)

- Log -----------------------------------------------------------------
commit f9628efeb87d0bfdbc5e2f75eabb738997495d69
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Apr 14 02:57:42 2018 +0800

    Use $Config{perlpath} in shebang to make sure path info exists
    
    $^X is "perl" instead of "/usr/bin/perl" on Mac OS(mine is 11.13.4) if
    you run perl without path info like "perl -Ilib t/api/safe-run-child-util.t".
    
    In that case, the "#!perl" shebang confused system, and the exec died
    with error of "No such file or directory".

diff --git a/t/api/safe-run-child-util.t b/t/api/safe-run-child-util.t
index 43b5c91db..c0d572822 100644
--- a/t/api/safe-run-child-util.t
+++ b/t/api/safe-run-child-util.t
@@ -109,10 +109,11 @@ is_handle_ok();
 
 # fork+exec
 {
+    use Config;
     my $script = RT::Test->temp_directory .'/true.pl';
     open my $fh, '>', $script;
     print $fh <<END;
-#!$^X
+#!$Config{perlpath}
 
 open my \$fh, '>', '$script.res';
 print \$fh "child";

-----------------------------------------------------------------------


More information about the rt-commit mailing list