Closed Tectu closed 2 years ago
hmm, looks like its something wrong with the ninja file generated by cmake. Its not something I've encountered before but since its only happening on windows I'm guessing theres something amiss with the toolchain there. I'm currently in uni so I have limited time to contribute (that + malloy doing basically everything I need it for currently is why I've been a bit inactive :p), and I don't have a windows laptop so I probably won't be able to look into this till the weekend or friday at the earliest
I had another go at this. I setup a clean Windows 10 machine with VisualStudio 2022 Community Edition. Upon building I am getting the exact same error as the CI instances:
Severity Code Description Project File Line Suppression State
Error CMake Error:
Running
'C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe' '-C' 'C:/Users/joel/Documents/projects/malloy/out/build/x64-Debug' '-t' 'recompact'
failed with:
ninja: error: CMakeFiles\rules.ninja:88: expected '=', got lexing error
Copyright (C) Microsoft Corporation. All rights reserved.
^ near here C:\Users\joel\Documents\projects\malloy\ ninja
Looking at the rules.nina
file, there is certainly something wrong there (the first line of this snippet is line 82):
#############################################
# Rule for compiling CXX files.
rule CXX_COMPILER__doctest_main_Debug
deps = msvc
command = "Microsoft (R) C\C++ Optimizing Compiler Version 19.30.30706 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ \link linkoption... ]; MSVC_VERSION=1930; MSVC_TOOLSET_VERSION=142" /nologo /TP $DEFINES $INCLUDES $FLAGS /showIncludes /Fo$out /Fd$TARGET_COMPILE_PDB /FS -c $in
description = Building CXX object $out
It would seem that the command
value is getting wrapped to a new line which ninja doesn't like.
After some more digging it would seem that somewhere in the cmake script there is a \n
which doesn't get escaped properly.
Furthermore, this seems to be localized to the malloy-tests
target. Setting BUILD_TESTING
to OFF
causes the error to vanish.
I managed to track this down to the nlohmann::json
dependency. If we disable the dependency's test suite the error no longer appears.
As we don't want to build the nlohmann::json
test suites anyway, we disabled them in commit be2a0dd616b88caf039213f3e12b9ba8d102eb42.
I still have to track down the exact problem in upstream. But apparently we're not the first ones to encounter this: https://github.com/nlohmann/json/issues/2734
MSVC CI builds are building again. We're just back to the previous situation where the build runs out of heap space when TLS is enabled.
The MSVC test suites are currently not building: https://github.com/Tectu/malloy/runs/3998713914
This appears to be an issue outside of malloy's C++ code base.
@0x00002a Any ideas on this? Have you encountered this elsewhere?