Skip to content

Commit

Permalink
Resurrect Windows-2022 with LLVM 16 [WIP]
Browse files Browse the repository at this point in the history
Changes:
- adds back Windows-2022 to test.yml matrix
- adds LLVM upgrade step to test.yml to install LLVM 16
- adds command to test.yml to fix LLVM include path
- adds macro definition to .bazelrc prefer __builtin_offsetof
- adds include path override for hrss.c in external/ssl.

Currently fails building boringssl during to include path ordering: clang headers included after MSVC ones and both contain incompatible emmintrin.h.
  • Loading branch information
ohodson committed Aug 30, 2023
1 parent ed6e0ef commit 5706ae1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@ build:windows --cxxopt='/std:c++20' --host_cxxopt='/std:c++20'
build:windows --cxxopt='/await' --host_cxxopt='/await'
build:windows --cxxopt='/wo4503' --host_cxxopt='/wo4503'
build:windows --cxxopt='/DWINDOWS_LEAN_AND_MEAN' --host_cxxopt='/DWINDOWS_LEAN_AND_MEAN'
build:windows --cxxopt='/D_CRT_USE_BUILTIN_OFFSETOF' --host_cxxopt='/D_CRT_USE_BUILTIN_OFFSETOF'
# The `/std:c++14` argument is unused during boringssl compilation and we don't
# want a warning when compiling each file.
build:windows --cxxopt='-Wno-unused-command-line-argument' --host_cxxopt='-Wno-unused-command-line-argument'

# The following is required on github runners temporarily due to
# https://github.com/actions/runner-images/issues/8125#issuecomment-1691194433
# For reasons TBD, clang in LLVM 16 is including the MSFT version emmintrin.h in
# preference to the very packaged in LLVM 16 when compiling hrss.c. The compiler
# command-line and environment set by Bazel is the same, modulo the LLVM version
# strings.
build:windows --per_file_copt='external/ssl/src/crypto/hrss/hrss\.c@-imsvcC:\\Program Files\\LLVM\\lib\\clang\\16.0.6\\include' --host_per_file_copt='external/ssl/src/crypto/hrss/hrss\.c@-imsvcC:\\Program Files\\LLVM\\lib\\clang\\16.0.6\\include'
10 changes: 7 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
test:
strategy:
matrix:
os: [ubuntu-20.04, macos-latest] # windows-2022 disabled due to actions/runner-images#812
os: [ubuntu-20.04, macos-latest, windows-2022]
include:
- os-name: linux
os: ubuntu-20.04
- os-name: macOS
os: macos-latest
# - os-name: windows
# os: windows-2022
- os-name: windows
os: windows-2022
runs-on: ${{ matrix.os }}
name: test (${{ matrix.os-name }})
steps:
Expand Down Expand Up @@ -59,6 +59,10 @@ jobs:
run: |
[System.IO.File]::WriteAllLines((Join-Path -Path $env:USERPROFILE -ChildPath '.bazelrc'), 'startup --output_user_root=C:/tmp')
[System.IO.File]::WriteAllLines((Join-Path -Path $env:USERPROFILE -ChildPath '.bazelrc'), 'build:windows --config=windows_no_dbg')
# Upgrade to LLVM16, default install is currently 15 (https://github.com/actions/runner-images/issues/8125).
choco upgrade llvm
# Work around bazel clang 16 include path bug (https://github.com/bazelbuild/bazel/issues/17863)
Move-Item -Path "C:\Program Files\LLVM\lib\clang\16" -Destination "C:\Program Files\LLVM\lib\clang\16.0.6"
- name: Bazel build
# timestamps are no longer being added here, the GitHub logs include timestamps (Use
# 'Show timestamps' on the web interface)
Expand Down

0 comments on commit 5706ae1

Please sign in to comment.