Skip to content

C windows CI setup - #458

Draft
pkspyder007 wants to merge 4 commits into
metacall:developfrom
pkspyder007:ci-c
Draft

pkspyder007 wants to merge 4 commits into
metacall:developfrom
pkspyder007:ci-c

Conversation

@pkspyder007

Copy link
Copy Markdown
Contributor

WIP

C loader requires few dependencies to built on windows

  • libffi
  • llvm for libclang and headers
  • tinycc

Building libffi is achieved using this fork https://github.com/newlawrence/Libffi
alternative found https://github.com/microsoft/vcpkg/blob/master/ports/libffi/CMakeLists.txt

For setting up LLVM I have used choco to install LLVM which includes clang

Building LIbTCC is not achieved yet it is having errors - logs https://pastebin.com/q1jFxpuh

@viferga
viferga marked this pull request as draft August 10, 2023 10:59
@viferga

viferga commented Dec 3, 2024

Copy link
Copy Markdown
Member

@pkspyder007 I am leaving this here: https://vcpkg.link/ports/libffi

@viferga

viferga commented Jun 10, 2026

Copy link
Copy Markdown
Member
PS E:\metacall\core\build> ..\tools\metacall-configure.ps1 debug scripts ports tests c
Build all scripts in debug mode
Build all scripts
Build all ports
Build all tests
Build with c support
BUILD COMMAND: cmake -DOPTION_BUILD_SECURITY=OFF -DOPTION_FORK_SAFE=OFF -DWARNINGS_ENABLED=OFF -DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_EXAMPLES=Off -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=Off -DOPTION_BUILD_PORTS=On -DOPTION_COVERAGE=Off -DOPTION_BUILD_SANITIZER=Off -DOPTION_BUILD_THREAD_SANITIZER=Off -DCMAKE_BUILD_TYPE=Debug -DLIBFFI_LIBRARY="E:/metacall/core/dependencies/libffi/build/lib/libffi.lib" -DLIBFFI_INCLUDE_DIR="E:/metacall/core/dependencies/libffi/build/include/" -DLibClang_INCLUDE_DIR="C:/Program Files/LLVM/include/clang;C:/Program Files (x86)/LLVM/include/clang" -DLibClang_LIBRARY=""C:/Program Files/LLVM/lib/libclang.lib;C:/Program Files (x86)/LLVM/lib/libclang.lib"" -DLIBFFI_LIBRARY="E:/metacall/core/dependencies/libffi/build/lib/libffi.lib" -DLIBFFI_INCLUDE_DIR="E:/metacall/core/dependencies/libffi/build/include/" -DLibClang_INCLUDE_DIR="C:/Program Files/LLVM/include/clang" -DLibClang_LIBRARY="C:/Program Files/LLVM/lib/libclang.lib" ..
CMake Warning:
  Ignoring extra path from command line:
 
   "E:/metacall/core/build/Files/LLVM/lib/libclang.lib;C:/Program"
 
 
CMake Warning:
  Ignoring extra path from command line:
 
   "(x86)/LLVM/lib/libclang.lib"
 
 
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.
-- Target Operative System: Windows
-- Target OS Family: win32
-- 64bit architecture AMD64 detected
-- Lib version
-- Lib preprocessor
-- Lib environment
-- Lib format
-- Lib log
-- Lib memory
-- Lib portability
-- Lib threading
-- Lib adt
-- Lib filesystem
-- Lib dynlink
-- Lib plugin
-- Lib detour
-- Lib reflect
-- Lib serial
-- Lib configuration
-- Lib loader
-- Lib metacall
-- Could NOT find LibTCC (missing: LIBTCC_LIBRARY LIBTCC_INCLUDE_DIR)
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.25/Modules/ExternalProject.cmake:3075 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.25/Modules/ExternalProject.cmake:4185 (_ep_add_download_command)
  cmake/InstallLibTCC.cmake:100 (ExternalProject_Add)
  source/loaders/c_loader/CMakeLists.txt:21 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.
 
-- Installing LibTCC afc1362
-- Plugin c_loader
-- Plugin ext_loader
-- Plugin mock_loader
-- Serial metacall_serial
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.25/Modules/ExternalProject.cmake:3075 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.25/Modules/ExternalProject.cmake:4185 (_ep_add_download_command)
  cmake/InstallRapidJSON.cmake:31 (ExternalProject_Add)
  source/serials/rapid_json_serial/CMakeLists.txt:14 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.
 
-- Installing RapidJSON v232389d
-- Serial rapid_json_serial
-- Extension plugin_extension
-- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR LIBDL_LIBRARY LIBDL_INCLUDE_DIR)
-- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR LIBDL_LIBRARY LIBDL_INCLUDE_DIR)
-- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR LIBDL_LIBRARY LIBDL_INCLUDE_DIR)
-- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR LIBDL_LIBRARY LIBDL_INCLUDE_DIR)
-- Plugin backtrace_plugin
-- Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR)
CMake Warning at source/ports/CMakeLists.txt:64 (message):
  Swig not found: disabling ports depending on swig
 
 
-- Script compiled
-- Script ffi
-- Script cbks
-- Script libloadtest
-- Script sum_extension
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) (Required is at least version "1.11.0")
-- Install Google Test v1.11.0
-- Test preprocessor-test
-- Test environment-test
-- Test log-test
-- Test log-custom-test
-- Test adt-set-test
-- Test adt-trie-test
-- Test adt-vector-test
-- Test adt-map-test
-- Test reflect-value-cast-test
-- Test reflect-function-test
-- Test reflect-object-class-test
-- Test reflect-scope-test
-- Test reflect-metadata-test
-- Test dynlink-test
-- Test serial-test
-- Test configuration-test
-- Test portability-path-test
-- Test metacall-logs-test
-- Test metacall-load-memory-test
-- Test metacall-load-memory-empty-test
-- Test metacall-load-configuration-test
-- Test metacall-handle-export-test
-- Test metacall-test
-- Test metacall-distributable-test
-- Test metacall-ducktype-test
-- Test metacall-inspect-test
-- Test metacall-map-test
-- Test metacall-initialize-test
-- Test metacall-initialize-ex-test
-- Test metacall-reinitialize-test
-- Test metacall-initialize-destroy-multiple-test
-- Test metacall-invalid-loader-test
-- Test metacall-c-test
-- Test metacall-version-test
-- Test metacall-dynlink-path-test
-- Test metacall-library-path-without-env-vars-test
-- Test metacall-ext-test
-- Test metacall-plugin-extension-destroy-order-test
-- CLI metacallcli
-- Plugin cli_core_plugin
-- Installing git hooks at E:/metacall/core
-- Configuring done
-- Generating done
-- Build files have been written to: E:/metacall/core/build
PS E:\metacall\core\build> ..\tools\metacall-build.ps1 debug
Build all scripts in debug mode
Building MetaCall...
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
 
  Performing configure step for 'libtcc-depends'
CUSTOMBUILD : CMake warning :  [E:\metacall\core\build\source\loaders\c_loader\libtcc-depends.vcxproj]
    Ignoring extra path from command line:
 
     "E:/metacall/core/build/source/loaders/c_loader/libtcc-depends-prefix/src/libtcc-depends"
 
 
CUSTOMBUILD : CMake error : The source directory "E:/metacall/core/build/source/loaders/c_loader/libtcc-depends-prefix/src/libtcc-depends" does not appear to contain CMake
Lists.txt. [E:\metacall\core\build\source\loaders\c_loader\libtcc-depends.vcxproj]
  Specify --help for usage, or press the help button on the CMake GUI.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom build for 'E:\metacall\co
re\build\CMakeFiles\8a1d27b053cb880c37e32f645a4eecaf\libtcc-depends-configure.rule;E:\metacall\core\build\CMakeFiles\8a1d27b053cb880c37e32f645a4eecaf\libtcc-depends-build.
rule;E:\metacall\core\build\CMakeFiles\8a1d27b053cb880c37e32f645a4eecaf\libtcc-depends-install.rule;E:\metacall\core\build\CMakeFiles\8a1d27b053cb880c37e32f645a4eecaf\libt
cc-depends-test.rule;E:\metacall\core\build\CMakeFiles\c998417d65ca2314d7e53a3f3378c553\libtcc-depends-complete.rule;E:\metacall\core\build\CMakeFiles\0d04cb69e6802c007dd5
7373eec530d5\libtcc-depends.rule' exited with code 1. [E:\metacall\core\build\source\loaders\c_loader\libtcc-depends.vcxproj]
  backward_object.vcxproj -> E:\metacall\core\build\_deps\backwardcpp-build\backward_object.dir\Debug\backward_object.lib
  metacall.vcxproj -> E:\metacall\core\build\Debug\metacalld.dll
  plugin_extension.vcxproj -> E:\metacall\core\build\Debug\plugin_extensiond.dll
  sum_extension.vcxproj -> E:\metacall\core\build\Debug\sum_extensiond.dll
  mock_loader.vcxproj -> E:\metacall\core\build\Debug\mock_loaderd.dll
  metacall_serial.vcxproj -> E:\metacall\core\build\Debug\metacall_seriald.dll
  ext_loader.vcxproj -> E:\metacall\core\build\Debug\ext_loaderd.dll
  rapid_json_serial.vcxproj -> E:\metacall\core\build\Debug\rapid_json_seriald.dll
  cli_core_plugin.vcxproj -> E:\metacall\core\build\Debug\plugins\cli\cli_core_plugin\cli_core_plugind.dll
  backtrace_plugin.vcxproj -> E:\metacall\core\build\Debug\plugins\backtrace_plugin\backtrace_plugind.dll
Failure in build with exit code: 1
PS E:\metacall\core\build>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants