5

Rakudo 我按照此处的说明进行了构建。通过类似的阅读herehere,我尝试使用VS-2019在Windows中构建它。

但是,Rakudo在 Windows 中构建时,我收到以下构建警告:

Updating submodules .................................... OK
Configuring native build environment ................... 
    trying to compile a simple C program ............... YES
did not find libzstd; will not use heap snapshot format version 3
OK
...
src\io\syncfile.c(272): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size
src\io\syncfile.c(334): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size
...
src\io\signals.c(115): warning C4068: unknown pragma
src\io\signals.c(116): warning C4068: unknown pragma
src\io\signals.c(120): warning C4068: unknown pragma
...
src\platform\random.c(132): warning C4113: 'FARPROC' differs in parameter lists from 'CRYPTGENRANDOM'
src\platform\random.c(132): warning C4133: '=': incompatible types - from 'FARPROC' to 'CRYPTGENRANDOM'
src\platform\random.c(130): warning C4113: 'FARPROC' differs in parameter lists from 'CRYPTACQUIRECONTEXTA'
src\platform\random.c(130): warning C4133: 'initializing': incompatible types - from 'FARPROC' to 'CRYPTACQUIRECONTEXTA'
...
src\platform\win32\io.c(27): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size
src\platform\win32\io.c(116): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater size
...
cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
cl : Command line warning D9002 : ignoring unknown option '-lm'
minilua.c
...
src\jit\x64\emit.c(8): warning C4129: 'j': unrecognized character escape sequence
src\jit\x64\emit.c(8): warning C4129: 'e': unrecognized character escape sequence
srcjitdemit.dasc(4): warning C4068: unknown pragma
srcjitdemit.dasc(5): warning C4068: unknown pragma
srcjitdemit.dasc(7): warning C4068: unknown pragma
srcjitdemit.dasc(8): warning C4068: unknown pragma
src/jit/x64/tiles.dasc(2): warning C4068: unknown pragma
...

上面的代码块中只显示了警告。完整的日志在这里给出。

用于构建的系统:Appveyor with VS-2019 in Windows

配置

## Appveyor configuration for Rakudo

# Manually build and don't use MSVC's build process so disable it
build: off

platform:
  - x64

install:
  - '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"'
  # install zstd
  - choco install zstandard
  - SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
  - perl Configure.pl --gen-moar --gen-nqp --backends=moar --prefix=%APPVEYOR_BUILD_FOLDER%\raku
  - nmake 
  - nmake install

environment:
  matrix:
  - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019

branches:
  only:
    - master
  1. 虽然我已经从 Chocolatey 安装zstandardhttps://github.com/facebook/zstd),但为什么我会得到.. did not find libzstd; will not use heap snapshot format version 3
  2. 在构建过程中这些警告(除了zstd)是否是我可以安全忽略的无害的?还是我应该担心?
  3. 有没有办法摆脱这些警告?
4

1 回答 1

4

我快速浏览了一下:

关于的警告conversion from 'int' to 'HANDLE' of greater size可能是由于缺少#include <io.h>,这导致编译器假设_get_osfhandle()返回int而不是intptr_t. 这可能是一个错误(尽管它可能不会在实践中体现出来,具体取决于窗口实际从该函数返回的值的范围)。

关于的警告'FARPROC' differs in parameter lists是由于缺少从返回的泛型指针GetProcAddress()到特定类型的转换。但是,因为所有指针类型都具有兼容的表示,所以如果忽略,不会发生任何不好的事情。

关于 pragma 的警告也可以被忽略,并且可以通过明智地使用#ifdef __GNUC__.

关于的警告unrecognized character escape sequence是由于在生成的代码中没有正确转义路径中的反斜杠。应该修复,但也可以忽略。

关于zstd,配置脚本用于pkg-config查找库,因此不支持 Windows。应该有人解决这个问题。但是,我相信这只会影响分析器,不会影响 MoarVM 的正常运行。

我没有调查这些Command line warning东西,尽管它看起来像是在 *nix 系统上编译,因此传递了不正确的标志。应该修复,但可能不会破坏构建。

于 2020-06-01T22:04:28.633 回答