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

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

Open
p6rt opened this issue Dec 25, 2014 · 13 comments
Open

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

p6rt opened this issue Dec 25, 2014 · 13 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 25, 2014

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

Searchable as RT123497$

@p6rt
Copy link
Author

p6rt commented Dec 25, 2014

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
Copy link
Author

p6rt commented Dec 27, 2014

From @szabgab

Same in Rakudo Star 2014.12 and 2014.12.1

@p6rt
Copy link
Author

p6rt commented Dec 27, 2014

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
Copy link
Author

p6rt commented Dec 29, 2014

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
Copy link
Author

p6rt commented Jan 10, 2015

From @szabgab

If I put

#!/usr/bin/env perl6

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

Gabor

@p6rt
Copy link
Author

p6rt commented Jan 10, 2015

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
Copy link
Author

p6rt commented Jan 10, 2015

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

@p6rt
Copy link
Author

p6rt commented Jan 10, 2015

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
Copy link
Author

p6rt commented Jan 10, 2015

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@​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
Copy link
Author

p6rt commented Jan 10, 2015

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
Copy link
Author

p6rt commented Jan 10, 2015

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
Copy link
Author

p6rt commented Feb 3, 2015

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
Copy link
Author

p6rt commented Apr 2, 2016

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.

@p6rt p6rt added the star label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant