Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build farm for Windows #839

Merged
merged 99 commits into from
Jul 8, 2021
Merged

Build farm for Windows #839

merged 99 commits into from
Jul 8, 2021

Conversation

maxgolov
Copy link
Contributor

@maxgolov maxgolov commented Jun 8, 2021

This PR implements a CMake + ninja build farm setup for the most common compilers used on modern versions of Windows.

Both - developer -focused and CI/CD pipeline -focused, to cover the following compilers:

  • Visual Studio 2015 (v140) - C++11/C++14 - targeting Windows 8.1 SDK and above.
  • Visual Studio 2017 (v141) - C++17 - targeting Windows 10 and above.
  • Visual Studio 2019 (v142) - C++20 - targeting Windows 10 and above.
  • LLVM Clang - targeting whatever version of Windows SDK. Tested with 11 and 12.

Using the following build systems:

  • CMake
  • Ninja - fastest, with optional fallback to MSBuild.
  • vcpkg - used for dependency management.

The process is largely documented here . Except that now we also support not only 2019. But older compilers too, plus LLVM Clang which we never had in our build system for Windows. Ad-hoc tested that the code works well with Clang-11 and Clang-12. This comes in handy, because things like Chromium on Windows - build with clang.

Build scripts contain enough comments for further customization and tweaking as-necessary. Someone implementing their own custom build pipeline may use these scripts as a reference example. Devs may also use these scripts to quickly build and test the SDK side-by-side with a set of different compilers installed on one box. Output from the build is laid out as follows:

image

Running something like:

tools\build-vs2015.cmd
tools\build-vs2017.cmd
tools\build-vs2019.cmd
tools\build-clang-12.cmd

Produces a set of build artifacts in one run:

  • nostd classes - for ABI compat across different compilers.
  • WITH_STL - for static linking, with native STL classes.
    for all compilers above.

Note that vcpkg installation for Visual Studio 2015 must always be stored separately from the rest. Because if you use vs2019 to compile and link vcpkg libraries -- these packages won't link to SDK being built with vs2015 compiler and linker. That limitation described in Visual Studio compiler documentation here :

image

…PI with Abseil Variant, but without entire Abseil Library
…s explicitly be defined, no implicit conversion to string_view)
…en both `std::` and `absl::` work differently!
…cts that do not link to opentelemetry_api target
@maxgolov maxgolov changed the title [WIP] Build tools to support vs2015+8.1 and clang compiler + ninja on Windows Build farm for Windows Jun 10, 2021
@maxgolov maxgolov marked this pull request as ready for review June 10, 2021 22:41
@maxgolov
Copy link
Contributor Author

maxgolov commented Jul 7, 2021

@lalitb @ThomsonTan - this PR is only dev build scripts necessary for all versions of Visual Studio. If you can have a quick look and merge, that'd be great!

@maxgolov maxgolov added the pr:please-merge This PR is ready to be merged by a Maintainer (rebased, CI passed, has enough valid approvals, etc.) label Jul 7, 2021
@maxgolov maxgolov linked an issue Jul 7, 2021 that may be closed by this pull request
@lalitb lalitb merged commit 9b1725b into main Jul 8, 2021
@lalitb lalitb deleted the maxgolov/clang_tools branch July 8, 2021 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:please-merge This PR is ready to be merged by a Maintainer (rebased, CI passed, has enough valid approvals, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Visual Studio 2015 + Windows 7.1 / 8.1 SDK build
3 participants