Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When I run a perl raku command line program a lib directory appears in the current working directory - how do I prevent this?

When I run a perl raku command-line program a lib directory (and precomp files) appear in the current working directory - how can I prevent/avoid this?

like image 997
user2145475 Avatar asked Mar 26 '19 06:03

user2145475


2 Answers

Why would you want to do that? They are, effectively, precompilation files that will later on be used when you run it again. You can prevent from adding them to the repository by adding .precomp to your .gitignore file, but they are useful files that are inherent to running Perl 6. As indicated in this answer, that might be due to . being included in your PERL6LIB variable. You can delete it from there to prevent that from happening in the current directory. It can still happen somewhere else, though.

like image 162
jjmerelo Avatar answered Sep 25 '22 01:09

jjmerelo


Rakudo Perl 6 uses a chain of repositories for loading modules. If you load a module and it isn't in the top repository it will look in the next one, and so on.

It will also precompile modules for faster loading the second time they are used.

Typically if you install a module it will be used once in such a way that its precomp file will be placed in the repository where it is installed.
If it's not in there when you go to use it a new one will be created.
Since it doesn't necessarily know what other modules it relies on, this precomp file is always placed in the head of the repository chain.

So you obviously have a module that doesn't have a precomp, and you have ./lib somehow at the top of your repository chain.

It could be in PERL6LIB, a -I command-line argument, or a use lib './lib'; line in your code.

You could try reinstalling the module to see if that stops it from happening.

like image 33
Brad Gilbert Avatar answered Sep 23 '22 01:09

Brad Gilbert