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

non-Perl 6 scripts in the module bin directory do not install in a runnable form #6447

Open
p6rt opened this issue Aug 16, 2017 · 1 comment
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 16, 2017

Migrated from rt.perl.org#131911 (status was 'new')

Searchable as RT131911$

@p6rt
Copy link
Author

p6rt commented Aug 16, 2017

From @molecules

(This may be easier to read here​: ugexe/zef#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!

@p6rt p6rt added the Bug 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