windowsrakurakudozstandard

Warnings while building Rakudo in Windows


I followed the instructions for building Rakudo here. With similar reading here and here, I tried building it in Windows with VS-2019.

However, while building Rakudo in windows I get the following build warnings:

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

Only the warnings are shown in the above code block. The full log is given here.

System used for build: Appveyor with VS-2019 in Windows

Configuration:

## 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. Though I have installed zstandard(https://github.com/facebook/zstd) from chocolatey, why do I get .. did not find libzstd; will not use heap snapshot format version 3
  2. Are these warnings (other than zstd) during the build innocuous which I can ignore safely? Or I should worry about?
  3. Is there a way to get rid of these warnings?

Solution

  • I took a quick look:

    The warning about conversion from 'int' to 'HANDLE' of greater size are probably due to a missing #include <io.h>, which leads to the compiler assuming that _get_osfhandle() returns int instead of intptr_t. This is potentially a bug (though it might not manifest in practice depending on the range of values windows actually returns from that function).

    The warnings about 'FARPROC' differs in parameter lists are due to missing casts from the generic pointer returned by GetProcAddress() to the specific type. However, because all pointer types have compatible representation, nothing bad can happen if ignored.

    The warnings about the pragmas can be ignored as well, and could be suppressed with a judicious use of #ifdef __GNUC__.

    The warnings about unrecognized character escape sequence are due to not properly escaping backslashes in paths in generated code. Should be fixed, but can be ignored as well.

    Regarding zstd, the configuration script uses pkg-config to find the library, so no windows support. Someone should fix that. However, I believe this will only affect the profiler, not regular operation of MoarVM.

    I did not investigate the Command line warning stuff, though it looks like something thinks it's compiling on a *nix system and hence passes incorrect flags. Should be fixed, but might not break the build.