How to hack on installed perl6 module source?

ぐ巨炮叔叔 提交于 2019-12-10 13:27:48

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/56084388/how-to-hack-on-installed-perl6-module-source

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!