Skip Menu |
Report information
Id: 131911
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: molecules <bottomsc [at] missouri.edu>
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Wed, 16 Aug 2017 18:16:41 +0000
To: "rakudobug [...] perl.org" <rakudobug [...] perl.org>
From: "Bottoms, Christopher A" <BottomsC [...] missouri.edu>
Subject: [BUG] non-Perl 6 scripts in the module bin directory do not install in a runnable form
Download (untitled) / with headers
text/plain 2.3k

(This may be easier to read here: https://github.com/ugexe/zef/issues/200. The only reason it is closed there is because it is a Rakudo bug, not a zef bug)

## Context

In the module directory is a `META6.json` file and a subdirectory called `bin`. In the `bin` is a Perl 5 file called `bin/test.pl`.

`zef install .` runs without error in the top directory. But when trying to run `test.pl`, I get an error. Come to find out, a Perl 6 wrapper script had been installed for `test.pl` and that is what is giving me the error. If I run `bin/test.pl` directly, it works fine.

## Expected Behavior

I expected that running `test.pl` from any directory would be the same as running it from the source directory.

## Actual Behavior

When trying to run `test.pl`, I get the following error:

    ===SORRY!===
    Could not find Perl5 at line 2 in:
        /home/username/.perl6
        /path/to/perl6/rakudo-star-2017.07/install/share/perl6/site
        /path/to/perl6/rakudo-star-2017.07/install/share/perl6/vendor
        /path/to/perl6/rakudo-star-2017.07/install/share/perl6
        CompUnit::Repository::AbsolutePath<64730416>
        CompUnit::Repository::NQP<43359856>
        CompUnit::Repository::Perl5<43359896>

## Steps to Reproduce

Create the following files:

**`META6.json`**

    {
    "perl"         : "6.c",
    "name"         : "TESTING1234",
    "license"      : "Artistic-2.0",
    "version"      : "0.0.2",
    "auth"         : "github:author",
    "authors"      : ["First Last"],
    "description"  : "TESTING module creation",
    "provides"     : {
                     },
    "depends"      : [ ],
    "test-depends" : [ "Test", "Test::META"  ]
    }

**`bin/test.pl`**

    #!/bin/env perl
    use v5.10;
    use strict;
    use warnings;
   
    say 'Hello world!';

Install it and run `test.pl`.

```
zef install .
test.pl     # error
bin/test.pl # works fine
```

The "installed" `test.pl` script is
`/path/to/perl6/rakudo-star-2017.07/install/share/perl6/site/bin/test.pl`:
    #!/usr/bin/env perl6
    sub MAIN(:$name is copy, :$auth, :$ver, *@, *%) {
        CompUnit::RepositoryRegistry.run-script("test.pl", :dist-name<TESTING1234>, :$name, :$auth, :$ver);
    }


## Your Environment
* perl6 -v
```
This is Rakudo version 2017.07 built on MoarVM version 2017.07
implementing Perl 6.c.
```

Thank you for all of your hard work!



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org