windows - 在 Windows 中构建 Rakudo 时的警告

标签 windows raku rakudo zstandard

我按照构建 Rakudo 的说明进行操作here .类似阅读 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
...

仅显示警告 在上面的代码块中。完整的日志给出 here .

用于构建的系统:在 Windows 中使用 VS-2019 的 Appveyor

配置:
## 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
  • 虽然我已经安装了zstandard (https://github.com/facebook/zstd) 来自 Chocolatey,为什么我会得到 .. did not find libzstd; will not use heap snapshot format version 3
  • 这些警告(除了 zstd )在构建期间是否无害,我可以安全地忽略?还是我应该担心?
  • 有没有办法摆脱这些警告?
  • 最佳答案

    我快速浏览了一下:

    关于 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 系统上编译,因此传递了不正确的标志。应该修复,但可能不会破坏构建。

    关于windows - 在 Windows 中构建 Rakudo 时的警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62137280/

    相关文章:

    list - 如何在Raku中无限期地和懒惰地循环浏览列表?

    raku - 权重 'randomness' 例程的 'pick'?

    node.js - 使用本地 deps 运行 npm 脚本

    windows - 每个开发人员都应该知道的 PowerShell 脚本

    mysql - Windows 10 企业版 - MYSQL 意外关闭

    raku - Perl6中的多种可能的输出类型

    error-handling - 将抛出的异常更改为失败的简洁方法?

    windows - sox 失败实用程序 : Unable to load MAD decoder library (libmad) function "mad_stream_buffer"

    raku - 如何在 Perl6 NativeCall 结构中定义固定长度字符串?

    raku - 无法使用 Rakudo Perl 6 zef 安装 Readline