6

在阅读README.mdhttps://github.com/rakudo/rakudo之后,我开始冒险为 rakudo 构建多个后端。

我使用 64 位 Ubuntu 20.04 来做到这一点。首先我安装

  • build essential,libencode-perl
  • default-jdk准备编译 rakudo 的机器。

克隆 repo 后,当我运行命令时perl Configure.pl --backends=moar,jvm --prefix=/usr,出现以下错误:

root@1145eac1ed77:/rakudo# perl Configure.pl --backends=moar,jvm --prefix=/usr
No pre-existing installed file found at /usr/bin/nqp-m
No pre-existing installed file found at /usr/bin/nqp-j
No pre-existing installed file found at /usr/bin/nqp-m
No pre-existing installed file found at /usr/bin/nqp-j
Use of uninitialized value $str in substitution (s///) at /rakudo/3rdparty/nqp-configure/lib/NQP/Config.pm line 1420.
Use of uninitialized value $str in substitution (s///) at /rakudo/3rdparty/nqp-configure/lib/NQP/Config.pm line 1421.
Use of uninitialized value in concatenation (.) or string at /rakudo/tools/lib/NQP/Config/Rakudo.pm line 361.
Use of uninitialized value in quotemeta at /rakudo/tools/lib/NQP/Config/Rakudo.pm line 371.
Use of uninitialized value in substitution (s///) at /rakudo/tools/lib/NQP/Config/Rakudo.pm line 371.
Use of uninitialized value in substitution (s///) at /rakudo/tools/lib/NQP/Config/Rakudo.pm line 371.
Use of uninitialized value in quotemeta at /rakudo/tools/lib/NQP/Config/Rakudo.pm line 373.
Use of uninitialized value in sprintf at /rakudo/tools/lib/NQP/Config/Rakudo.pm line 414.
Redundant argument in sprintf at /rakudo/tools/lib/NQP/Config/Rakudo.pm line 414.
Use of uninitialized value in concatenation (.) or string at /rakudo/tools/lib/NQP/Config/Rakudo.pm line 423.
Use of uninitialized value in concatenation (.) or string at /rakudo/tools/lib/NQP/Config/Rakudo.pm line 423.
Using /usr/bin/nqp-m (version  / MoarVM ).
Use of uninitialized value in sprintf at /rakudo/tools/lib/NQP/Config/Rakudo.pm line 428.
Redundant argument in sprintf at /rakudo/tools/lib/NQP/Config/Rakudo.pm line 428.
===SORRY!===
  jvm::runtime.jars value not available from /usr/bin/nqp-j --show-config.

  To automatically clone (git) and build a copy of NQP 2020.02.1-154-ga7b0b7be2,
  try re-running Configure.pl with the '--gen-moar' option.
  Or, use '--prefix=' to explicitly specify the path where the NQP and MoarVM
  executables can be found that are use to build Rakudo. at /rakudo/3rdparty/nqp-configure/lib/NQP/Config.pm line 192.
 at /rakudo/3rdparty/nqp-configure/lib/NQP/Config.pm line 34.
        NQP::Config::__ANON__("===SORRY!===\x{a}  jvm::runtime.jars value not available from /us"...) called at /rakudo/3rdparty/nqp-configure/lib/NQP/Config.pm line 192
        NQP::Config::sorry(NQP::Config::Rakudo=HASH(0x55e4cb9c5258), "jvm::runtime.jars value not available from /usr/bin/nqp-j --s"..., "\x{a}To automatically clone (git) and build a copy of NQP 2020.02"..., "try re-running Configure.pl with the '--gen-moar' option.", "Or, use '--prefix=' to explicitly specify the path where the "..., "executables can be found that are use to build Rakudo.") called at /rakudo/tools/lib/NQP/Config/Rakudo.pm line 576
        NQP::Config::Rakudo::post_active_backends(NQP::Config::Rakudo=HASH(0x55e4cb9c5258)) called at /rakudo/3rdparty/nqp-configure/lib/NQP/Config.pm line 660
        NQP::Config::configure_active_backends(NQP::Config::Rakudo=HASH(0x55e4cb9c5258)) called at /rakudo/tools/lib/NQP/Config/Rakudo.pm line 473
        NQP::Config::Rakudo::configure_active_backends(NQP::Config::Rakudo=HASH(0x55e4cb9c5258)) called at Configure.pl line 102

如何修复?

我想知道ALL命令perl Configure.pl --backends=ALL中指的是什么。

这里这里有一个项目(我猜还是在 master 中合并了)Rakudo.js 。这是 Javascript 后端吗?这是否意味着,和后端?ALLmoarjvmJavascript

4

1 回答 1

7

正如@ugexe 所指出的,--gen-moar我的命令中丢失了。

为了将来参考,我想记录我在反复尝试构建Rakudo.

Moar 和 JVM 后端


对于构建moarjvm后端,您需要依赖项

apt-get install -y gcc \
        libc6-dev \
        libencode-perl \
        wget \
        libzstd-dev \
        default-jdk \
        make

并运行命令

perl Configure.pl --prefix=/usr --gen-moar --backends=moar,jvm --relocatable

用于建筑。成功构建后,您将获得rakudo-m, rakudo-gdb-m, rakudo-valgrind-m,rakudo-lldb-m用于moar后端和 rakudo-j,rakudo-debug-j用于jvm后端。

Javascript 和 Moar 后端


您无法构建独立的 JavaScript 后端。构建js后端时,您还必须构建moar. 因此,要构建 javascript 后端,构建命令将是,

perl Configure.pl --prefix=/usr --gen-moar --backends=moar,js --relocatable

构建javascript后端的额外依赖是可用性,nodejs可以通过g++npm

apt-get install gcc g++ \
        libc6-dev \
        libencode-perl \
        wget \
        libzstd-dev \
        nodejs \
        npm \
        make

但是在构建javascript后端时,出现以下错误,

'/usr/bin/perl' tools/build/npm-install-or-link.pl . src/vm/js/nqp-runtime nqp-runtime 
Can't exec "npm": No such file or directory at tools/build/npm-install-or-link.pl line 18.
=== SORRY! === `npm install /rakudo/nqp/src/vm/js/nqp-runtime` failed with exit code -1 (72057594037927935)
make: *** [Makefile:852: js-deps] Error 255

搜索显示

如果您正在开发 nqp-js,您可能需要传递 --link 选项来配置以链接而不是安装 nqp-runtime

虽然建立隔离没有问题NQP。我不确定如何在自动构建 rakudo 时使用 npm 链接。

所有后端


我了解到这ALL确实意味着moar,jvmjs后端。这在您运行命令时得到确认

perl Configure.pl --prefix=/usr --gen-moar --backends=ALL --relocatable

您会在终端中看到以下运行:

/usr/bin/perl Configure.pl --prefix=/usr --make-install --git-protocol=https --relocatable --no-ignore-errors --silent-build --no-force-rebuild --backends=moar,jvm,js --gen-moar

对此的依赖项将是

apt-get install gcc g++ \
        libc6-dev \
        libencode-perl \
        wget \
        libzstd-dev \
        default-jdk \
        nodejs \
        npm \
        make

如果通过解决上述问题可以成功构建 Javascript 后端npm link,我相信所有后端:moarjvm并且javascript可以构建。

所以这里留下的问题是如何在构建 rakudo 时 npm 链接。希望有人的专家帮助能解决这个问题。

于 2020-04-26T19:18:31.667 回答