如何破解已安装的perl6模块源代码? [英] How to hack on installed perl6 module source?

查看:87
本文介绍了如何破解已安装的perl6模块源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够查看和更改已安装(通过zef)perl6模块的源代码.我该怎么办?

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?

在我的系统上,模块源位于~/.perl6/sources/下,并且~/.perl6/dist/中还有一些有关模块的元数据文件.

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/.

我还可以使用zef locate ...来显示模块的源路径,但是直接对源文件进行更改似乎没有任何效果(即,来自REPL的use模块没有显示我的更改).

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).

我猜这是因为模块是预先编译的,而当我直接对模块源文件进行更改时,perl6不会接受我的更改并重新预编译模块...

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...

更新:在~/.perl6/precomp/...下删除相应的预编译文件似乎可行,但是我不确定如何以及是否弄乱了任何东西.

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.

推荐答案

我希望能够查看和更改已安装的(通过zef)perl6模块的源代码.我该怎么办?

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.

如果要测试已安装模块的更改,请下载tar文件/git clone该模块的发行版,在其中进行所需的更改,然后执行以下操作:

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.

这篇关于如何破解已安装的perl6模块源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆