Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

p6doc does not work on OSX (Rakudo * 2014.09) #3623

Open p6rt opened 9 years ago

p6rt commented 9 years ago

Migrated from rt.perl.org#123497 (status was 'open')

Searchable as RT123497$

p6rt commented 9 years ago

From @szabgab

This is a fresh compillation using MoarVM

$ p6doc

/Users/gabor/rakudo-star-2014.09/install/bin/p6doc​: line 4​: my​: command not found

/Users/gabor/rakudo-star-2014.09/install/bin/p6doc​: line 5​: has​: command not found

/Users/gabor/rakudo-star-2014.09/install/bin/p6doc​: line 6​: syntax error near unexpected token `('

/Users/gabor/rakudo-star-2014.09/install/bin/p6doc​: line 6​: ` multi method gist(X​::P6doc​:D​:) {'

p6rt commented 9 years ago

From @szabgab

Same in Rakudo Star 2014.12 and 2014.12.1

p6rt commented 9 years ago

From @szabgab

When running as

perl6 /Users/gabor/rakudo-star-2014.12.1/install/bin/p6doc

or as

perl6-m /Users/gabor/rakudo-star-2014.12.1/install/bin/p6doc then it works.

p6rt commented 9 years ago

From @szabgab

The same happens with panda. If I try to run directly I get

/Users/gabor/rakudo-star-2014.12.1/install/bin/panda​: line 2​: use​: command not found

/Users/gabor/rakudo-star-2014.12.1/install/bin/panda​: line 3​: use​: command not found

/Users/gabor/rakudo-star-2014.12.1/install/bin/panda​: line 4​: use​: command not found

/Users/gabor/rakudo-star-2014.12.1/install/bin/panda​: line 5​: use​: command not found

/Users/gabor/rakudo-star-2014.12.1/install/bin/panda​: line 9​: syntax error near unexpected token `('

/Users/gabor/rakudo-star-2014.12.1/install/bin/panda​: line 9​: ` @​*ARGS = %*ENV\<PANDA_DEFAULT_OPTS> ~ (@​*ARGS ?? ' ' ~ @​*ARGS !! '');'

but if I run

perl6 /Users/gabor/rakudo-star-2014.12.1/install/bin/panda

then it works.

Is there something broken in my environment?

p6rt commented 9 years ago

From @szabgab

If I put

#!/usr/bin/env perl6

as the sh-bang of either of those script, they start to work.

Gabor

p6rt commented 9 years ago

From @FROGGS

what was in there before?

Am 10.01.2015 um 12​:45 schrieb Gabor Szabo​:

If I put

#!/usr/bin/env perl6

as the sh-bang of either of those script, they start to work.

Gabor

p6rt commented 9 years ago

The RT System itself - Status changed from 'new' to 'open'

p6rt commented 9 years ago

From @szabgab

/Users/gabor/rakudo-star-2014.12.1/install/bin/perl6-m

On Sat, Jan 10, 2015 at 1​:49 PM, Tobias Leich via RT \< perl6-bugs-followup@​perl.org> wrote​:

what was in there before?

Am 10.01.2015 um 12​:45 schrieb Gabor Szabo​:

If I put

#!/usr/bin/env perl6

as the sh-bang of either of those script, they start to work.

p6rt commented 9 years ago

From @szabgab

Or more specifically

#!/Users/gabor/rakudo-star-2014.12.1/install/bin/perl6-m

On Sat, Jan 10, 2015 at 1​:57 PM, Gabor Szabo \gabor@&#8203;szabgab\.com wrote​:

/Users/gabor/rakudo-star-2014.12.1/install/bin/perl6-m

On Sat, Jan 10, 2015 at 1​:49 PM, Tobias Leich via RT \< perl6-bugs-followup@​perl.org> wrote​:

what was in there before?

Am 10.01.2015 um 12​:45 schrieb Gabor Szabo​:

If I put

#!/usr/bin/env perl6

as the sh-bang of either of those script, they start to work.

p6rt commented 9 years ago

From @moritz

On 10.01.2015 12​:45, Gabor Szabo wrote​:

If I put

#!/usr/bin/env perl6

as the sh-bang of either of those script, they start to work.

That's quite dangerous. Precompiled modules (on which scripts often depend) only work with the rakudo that compiled them. If a different one is in $PATH before that, the scripts will start to fail with weird errors.

Does #!/usr/bin/env /full/path/to/perl6-m work?

Cheers, Moritz

p6rt commented 9 years ago

From @szabgab

On Sat, Jan 10, 2015 at 2​:27 PM, Moritz Lenz via RT \< perl6-bugs-followup@​perl.org> wrote​:

On 10.01.2015 12​:45, Gabor Szabo wrote​:

If I put

#!/usr/bin/env perl6

as the sh-bang of either of those script, they start to work.

That's quite dangerous. Precompiled modules (on which scripts often depend) only work with the rakudo that compiled them. If a different one is in $PATH before that, the scripts will start to fail with weird errors.

Well, I am not suggesting it should be set that way, I don't know how it 'should' be. I was just reporting what worked and what did not work for me.

Does #!/usr/bin/env /full/path/to/perl6-m work?

yes, I just tried putting this in p6doc​:

#!/usr/bin/env /Users/gabor/rakudo-star-2014.12.1/install/bin/perl6-m and then I could run p6doc on the command line.

Gabor

p6rt commented 9 years ago

From @moritz

Hi Gabor,

On Thu Dec 25 11​:42​:56 2014, gabor@​szabgab.com wrote​:

This is a fresh compillation using MoarVM

$ p6doc

/Users/gabor/rakudo-star-2014.09/install/bin/p6doc​: line 4​: my​: command not found

Can you please try http://rakudo.org/downloads/star/rakudo-star-2014.12.2.tar.gz and see if it fixes your issue?

Cheers, Moritz

p6rt commented 8 years ago

From eam@frap.net

On Tue Feb 03 02​:36​:35 2015, moritz wrote​:

$ p6doc

/Users/gabor/rakudo-star-2014.09/install/bin/p6doc​: line 4​: my​: command not found

Can you please try http://rakudo.org/downloads/star/rakudo-star- 2014.12.2.tar.gz and see if it fixes your issue?

I just stumbled across this today.

It looks like this issue has been partially worked-around by adding #!/usr/bin/env to the shebang line for p6doc. The original problem is caused by /usr/local/bin/perl6 being a shell script. OSX does not allow a shebang script as the interpreter for another shebang script. On my system this is​:

$ cat /usr/local/bin/perl6 #!/bin/sh exec /usr/local/Cellar/rakudo-star/2016.01/bin/moar --execname="$0" --libpath="/usr/local/Cellar/rakudo-star/2016.01/share/nqp/lib" --libpath="/usr/local/Cellar/rakudo-star/2016.01/share/perl6/lib" --libpath="/usr/local/Cellar/rakudo-star/2016.01/share/perl6/runtime" /usr/local/Cellar/rakudo-star/2016.01/share/perl6/runtime/perl6.moarvm "$@​"

A proper fix could be to replace /usr/local/bin/perl6 with a native binary executable which does the same work as the above shell script.