Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hack on installed perl6 module source?

I'd like to be able to view and make changes to the source code of installed (via zef) perl6 modules. How can I do that?

On my system, the module sources are under ~/.perl6/sources/ and there's also some kind of metadata file about the modules in ~/.perl6/dist/.

I can also use zef locate ... to show a module's source path, but making changes directly to the source files doesn't seem to have any effects (i.e., use the module from the REPL doesn't show my changes).

I'm guessing it's because the modules were pre-compiled, and perl6 doesn't pick up my changes and re-precompile the modules when I make changes directly to the module source files that way...

UPDATE: Deleting the corresponding pre-compiled files under ~/.perl6/precomp/... seems to work, but I'm not sure how and if that messes up anything.

like image 890
cowbaymoo Avatar asked May 10 '19 20:05

cowbaymoo


1 Answers

I'd like to be able to view and make changes to the source code of installed (via zef) perl6 modules. How can I do that?

Please, don't do it that way. Installed modules are supposed to be immutable and as you've found out: if there is a pre-compiled version of a module available, it will not check if the original source file has been updated. That's because it doesn't have to, because it is considered immutable.

If you want to test changes on an installed module, please download the tar file / git clone the module's distribution, make changes you need in there, and then do:

zef install . --force-install

while in the top directory in the distribution. That will re-install the module and handle pre-compilation for you.

like image 144
Elizabeth Mattijsen Avatar answered Sep 20 '22 23:09

Elizabeth Mattijsen