Skip to content

Commit 0d36667

Browse files
authored
Git Patch BoringSSL to disable Windows build warnings/errors (#454)
This change fixes the boringSSL sources so that they no longer causes warnings on windows-latest runners. Switched the boringSSL dependency to a git checkout instead of a tarball download. Created a git patch to alter boringSSL's cmake files, adding C4255 as a warning that shall be suppressed. Updated GHA configuration to use windows-latest again. This was previously changed to windows-2016 since those tools didn't report C4255 as a warning. See #444 for more information about these reverted changes.
1 parent 8598f29 commit 0d36667

File tree

6 files changed

+42
-20
lines changed

6 files changed

+42
-20
lines changed

.github/workflows/cpp-packaging.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,18 +246,18 @@ jobs:
246246
strategy:
247247
fail-fast: false
248248
matrix:
249-
os: [windows-2016, ubuntu-latest, macos-latest]
249+
os: [windows-latest, ubuntu-latest, macos-latest]
250250
build_type: ["Release", "Debug"]
251251
architecture: ["x64", "x86"]
252252
msvc_runtime: ["static", "dynamic"]
253253
linux_abi: ["legacy", "c++11"]
254254
python_version: [3.7]
255255
include:
256-
- os: windows-2016
256+
- os: windows-latest
257257
vcpkg_triplet_suffix: "windows-static"
258258
additional_build_flags: "--build_tests"
259259
sdk_platform: "windows"
260-
- os: windows-2016
260+
- os: windows-latest
261261
msvc_runtime: "dynamic"
262262
vcpkg_triplet_suffix: "windows-static-md"
263263
additional_build_flags: "--build_tests"
@@ -272,7 +272,7 @@ jobs:
272272
sdk_platform: "darwin"
273273

274274
exclude:
275-
- os: windows-2016
275+
- os: windows-latest
276276
linux_abi: "c++11"
277277
- os: macos-latest
278278
architecture: "x86"

.github/workflows/integration_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
required: true
1919
operating_systems:
2020
description: 'CSV of VMs to run on'
21-
default: 'ubuntu-latest,windows-2016,macos-latest'
21+
default: 'ubuntu-latest,windows-latest,macos-latest'
2222
required: true
2323
desktop_ssl_variants:
2424
description: 'CSV of desktop SSL variants to use'

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# Top level CMake file that defines the entire Firebase C++ SDK build.
1616

1717
cmake_minimum_required (VERSION 3.1)
18+
1819
set (CMAKE_CXX_STANDARD 11)
1920

2021
# Turn on virtual folders for visual studio

cmake/external/boringssl.cmake

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,16 @@ if(TARGET boringssl OR NOT DOWNLOAD_BORINGSSL)
1818
return()
1919
endif()
2020

21-
# Based on https://github.com/grpc/grpc/blob/v1.27.0/bazel/grpc_deps.bzl
22-
# master-with-bazel@{2019-10-18}
23-
set(commit 83da28a68f32023fd3b95a8ae94991a07b1f6c62)
24-
# set(commit master)
21+
set(patch_file
22+
${CMAKE_CURRENT_LIST_DIR}/../../scripts/git/patches/boringssl/0001-disable-C4255-converting-empty-params-to-void.patch)
2523

2624
ExternalProject_Add(
2725
boringssl
2826

29-
DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR}
30-
DOWNLOAD_NAME boringssl-${commit}.tar.gz
31-
URL https://github.com/google/boringssl/archive/${commit}.tar.gz
32-
27+
GIT_REPOSITORY https://github.com/google/boringssl/
28+
GIT_TAG 83da28a68f32023fd3b95a8ae94991a07b1f6c62
29+
PATCH_COMMAND git apply ${patch_file}
3330
PREFIX ${PROJECT_BINARY_DIR}
34-
3531
CONFIGURE_COMMAND ""
3632
BUILD_COMMAND ""
3733
INSTALL_COMMAND ""

scripts/gha/print_matrix_configuration.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,27 @@
7777
"python_version": ["3.7"],
7878

7979
EXPANDED_KEY: {
80-
"os": ["ubuntu-latest", "macos-latest", "windows-2016"],
80+
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
8181
"xcode_version": ["11.7", "12.4"],
8282
}
8383
}
8484
},
8585

8686
"android": {
8787
"matrix": {
88-
"os": ["ubuntu-latest", "macos-latest", "windows-2016"],
88+
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
8989
"architecture": ["x64"],
9090
"python_version": ["3.7"],
9191

9292
EXPANDED_KEY: {
93-
"os": ["ubuntu-latest", "macos-latest", "windows-2016"]
93+
"os": ["ubuntu-latest", "macos-latest", "windows-latest"]
9494
}
9595
}
9696
},
9797

9898
"integration_tests": {
9999
"matrix": {
100-
"os": ["ubuntu-latest", "macos-latest", "windows-2016"],
100+
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
101101
"platform": ["Desktop", "Android", "iOS"],
102102
"ssl_lib": ["openssl", "boringssl"],
103103
"android_device": ["android_latest", "emulator_target"],
@@ -215,9 +215,9 @@ def print_value(value):
215215
""" Print Json formatted string that can be consumed in Github workflow."""
216216
# Eg: for lists,
217217
# print(json.dumps) ->
218-
# ["ubuntu-latest", "macos-latest", "windows-2016"]
218+
# ["ubuntu-latest", "macos-latest", "windows-latest"]
219219
# print(repr(json.dumps)) ->
220-
# '["ubuntu-latest", "macos-latest", "windows-2016"]'
220+
# '["ubuntu-latest", "macos-latest", "windows-latest"]'
221221

222222
# Eg: for strings
223223
# print(json.dumps) -> "flame"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 831806231dd360278dac2a37e3c3158420ad7bb3 Mon Sep 17 00:00:00 2001
2+
From: "google.com" <google.com>
3+
Date: Mon, 7 Jun 2021 13:57:27 -0400
4+
Subject: [PATCH] disable C4255 converting () to (void)
5+
6+
---
7+
src/CMakeLists.txt | 2 ++
8+
1 file changed, 2 insertions(+)
9+
10+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
11+
index b7f468fe6..48f61bfd8 100644
12+
--- a/src/CMakeLists.txt
13+
+++ b/src/CMakeLists.txt
14+
@@ -193,6 +193,8 @@ elseif(MSVC)
15+
# possible loss of data
16+
"C4244" # 'function' : conversion from 'int' to 'uint8_t',
17+
# possible loss of data
18+
+ "C4255" # 'function' : no function prototype given: converting '()' to
19+
+ # '(void)'
20+
"C4267" # conversion from 'size_t' to 'int', possible loss of data
21+
"C4371" # layout of class may have changed from a previous version of the
22+
# compiler due to better packing of member '...'
23+
--
24+
2.32.0.rc1.229.g3e70b5a671-goog
25+

0 commit comments

Comments
 (0)