How to deal with MSVC in DevOps

This page summarizes the projects mentioned and recommended in the original post on /r/cpp

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • msvc-wine

    Scripts for setting up and running MSVC in Wine on Linux

  • Okay, I am trying it, but it does not exactly work out of the box. Do you remember how you got a hand on the MSVC libraries? I use https://github.com/mstorsjo/msvc-wine to download the MSVC toolchain using python, and then I simply wget this file https://raw.githubusercontent.com/llvm/llvm-project/main/llvm/cmake/platforms/WinMsvc.cmake, and call CMake like in the example the file has as a comment in the first few lines. I installed clang-tools-15 and lld-15 using apt. Does this sound somehow correct? I set all the paths correctly and I get a CMake Error "include could not find requested file: [...] //ClangClCMakeCompileRules.cmake", the error occurs while CMake is testing the C compiler if it works.

  • act

    Run your GitHub Actions locally 🚀

  • Option 1: Build everything using GCC in ubuntu-latest and MSVC in windows-latest. It might work well, but you are tied to using GH Actions, the actions also cannot be run locally using something like [act](https://github.com/nektos/act), and every build script must be written multiple times for Bash and Batch. You are basically tied to just the runner itself and everything outside of that you're f*cked. This solution is really ugly and I want to circumvent it.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • NGL

    The NCCA Graphics Library

  • My Windows build is here https://github.com/NCCA/NGL/blob/main/.github/workflows/windows.yml I use vcpkg for installing 3rd party libs and the msvc-dev command from here https://github.com/ilammy/msvc-dev-cmd

  • msvc-dev-cmd

    GitHub Action to setup Developer Command Prompt for Microsoft Visual C++

  • My Windows build is here https://github.com/NCCA/NGL/blob/main/.github/workflows/windows.yml I use vcpkg for installing 3rd party libs and the msvc-dev command from here https://github.com/ilammy/msvc-dev-cmd

  • NCCABoilerplate

    A set of Boilerplate projects for most of the work we do

  • Been working well, recently setup another set of boiler plate code for Mac, Windows and Linux here as well https://github.com/NCCA/NCCABoilerplate/tree/main/.github/workflows

  • llvm-project

    The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.

  • As for using that combination on non-Windows hosts, I think LLVM's WinMsvc.cmake might help quite a bit - given paths to Windows libs/headers and an LLVM install, it sets up cross-compilation fairly painlessly. Given the size and/or prominence of LLVM, I think it's arguably fairly well-supported and probably not likely to break any time soon.

  • setup-build2-github-action

    Set up your GitHub Actions workflow with a specific version of build2.

  • There is also (community-maintained) GH Actions support. I don't believe there is integration for binary distribution package generation/upload, but I am sure it shouldn't be that difficult to add (all the underlying command are described in the first link I gave you): https://github.com/build2/setup-build2-github-action

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • runner

    The Runner for GitHub Actions :rocket:

  • If i understand this writing correctly (https://github.com/actions/runner/issues/904), running Windows containers in a windows-latest GH Actions host is not possible. While using a self-hosted runner on a Windows server might be an option, this is not what I want since it is a package repo for a well-known open source project, think of the package repo part as a mini-Conan. I wouldn't know who would want to host that. In the best case we would stay with just GH Actions to keep everything confined in one space :)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts