Trying to fix bazel on macOS and Xcode 14.3 (#8304)

* Fixes Bazel issues for windows and ci

Fetching boringssl within the flatbuffers repository, to patch the issues
of not being able to upgrade to Xcode 14.3 due to buildkite throwing
errors. The patch was inspired by the tenserflow patch
https://github.com/tensorflow/tensorflow/issues/60191#issuecomment-1496073147

Removes references of swift from the windows pipeline for bazel

Sets github actions to use xcode 14.3 for kotlin and sets the macOS
build for intel cpus.

* Update build.yml

Remove comment that is not relevant any longer.

---------

Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
mustiikhalil
2024-05-29 02:29:41 +02:00
committed by GitHub
parent d89f611f6f
commit a41fefa1a8
6 changed files with 89 additions and 24 deletions

View File

@@ -31,7 +31,7 @@ platforms:
test_targets: test_targets:
- "//..." - "//..."
macos: macos:
xcode_version: "14.2" xcode_version: "14.3"
build_targets: build_targets:
- "//..." - "//..."
test_targets: test_targets:

View File

@@ -2,3 +2,11 @@
# --deleted_packages. We need to specify it for both build and query instead. # --deleted_packages. We need to specify it for both build and query instead.
build --deleted_packages=tests/bazel_repository_test_dir,tests/ts/bazel_repository_test_dir build --deleted_packages=tests/bazel_repository_test_dir,tests/ts/bazel_repository_test_dir
query --deleted_packages=tests/bazel_repository_test_dir,tests/ts/bazel_repository_test_dir query --deleted_packages=tests/bazel_repository_test_dir,tests/ts/bazel_repository_test_dir
# Point tools such as coursier (used in rules_jvm_external) to Bazel's internal JDK
# suggested in https://github.com/bazelbuild/rules_jvm_external/issues/445
common --repo_env=JAVA_HOME=../bazel_tools/jdk
common --action_env=JAVA_HOME=../bazel_tools/jdk
# Workaround "Error: need --enable_runfiles on Windows for to support rules_js"
common:windows --enable_runfiles
# Swift is not required on Windows
common:windows --deleted_packages=swift

View File

@@ -224,7 +224,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: cmake - name: cmake
run: cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . run: cmake -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON .
- name: build - name: build
run: xcodebuild -toolchain clang -configuration Release -target flattests run: xcodebuild -toolchain clang -configuration Release -target flattests
- name: check that the binary is x86_64 - name: check that the binary is x86_64
@@ -377,26 +377,30 @@ jobs:
working-directory: java working-directory: java
run: mvn test run: mvn test
# Renable build-kotlin-macos:
# build-kotlin-macos: name: Build Kotlin MacOS
# name: Build Kotlin MacOS runs-on: macos-latest
# runs-on: macos-latest-large steps:
# steps: - name: Checkout
# - name: Checkout uses: actions/checkout@v3
# uses: actions/checkout@v3 # Force Xcode 14.3 since Xcode 15 doesnt support older versions of
# - uses: gradle/wrapper-validation-action@v1.0.5 # kotlin. For Xcode 15, kotlin should be bumpped to 1.9.10
# - uses: actions/setup-java@v3 # https://stackoverflow.com/a/77150623
# with: - name: Set up Xcode version
# distribution: 'temurin' run: sudo xcode-select -s /Applications/Xcode_14.3.app/Contents/Developer
# java-version: '11' - uses: gradle/wrapper-validation-action@v1.0.5
# - name: Build flatc - uses: actions/setup-java@v3
# run: | with:
# cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . distribution: 'temurin'
# make -j java-version: '11'
# echo "${PWD}" >> $GITHUB_PATH - name: Build flatc
# - name: Build run: |
# working-directory: kotlin cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF .
# run: ./gradlew clean iosSimulatorArm64Test macosX64Test macosArm64Test make -j
echo "${PWD}" >> $GITHUB_PATH
- name: Build
working-directory: kotlin
run: ./gradlew clean iosSimulatorArm64Test macosX64Test macosArm64Test
build-kotlin-linux: build-kotlin-linux:
name: Build Kotlin Linux name: Build Kotlin Linux

View File

@@ -83,6 +83,28 @@ http_archive(
], ],
) )
#### Building boring ssl
# Fetching boringssl within the flatbuffers repository, to patch the issue
# of not being able to upgrade to Xcode 14.3 due to buildkite throwing errors
# which was patched in the following below.
# https://github.com/google/flatbuffers/commit/67eb95de9281087ccbba9aafd6e8ab1958d12045
# The patch was copied from the following comment on the same issue within tensorflow
# and fixed to adapt the already existing patch for boringssl.
# https://github.com/tensorflow/tensorflow/issues/60191#issuecomment-1496073147
http_archive(
name = "boringssl",
patch_args = ["-p1"],
patches = ["//grpc:boringssl.patch"],
# Use github mirror instead of https://boringssl.googlesource.com/boringssl
# to obtain a boringssl archive with consistent sha256
sha256 = "534fa658bd845fd974b50b10f444d392dfd0d93768c4a51b61263fd37d851c40",
strip_prefix = "boringssl-b9232f9e27e5668bc0414879dcdedb2a59ea75f2",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/boringssl/archive/b9232f9e27e5668bc0414879dcdedb2a59ea75f2.tar.gz",
"https://github.com/google/boringssl/archive/b9232f9e27e5668bc0414879dcdedb2a59ea75f2.tar.gz",
],
)
##### GRPC ##### GRPC
_GRPC_VERSION = "1.49.0" # https://github.com/grpc/grpc/releases/tag/v1.48.0 _GRPC_VERSION = "1.49.0" # https://github.com/grpc/grpc/releases/tag/v1.48.0

View File

@@ -11,3 +11,31 @@ index 1645a264a..12f8ca999 100644
add_executable( add_executable(
bssl bssl
diff --git a/src/crypto/x509/t_x509.c b/src/crypto/x509/t_x509.c
index 7c32a8798..6e50d040e 100644
--- a/src/crypto/x509/t_x509.c
+++ b/src/crypto/x509/t_x509.c
@@ -318,9 +318,7 @@ int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg,
int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase)
{
char *s, *c, *b;
- int ret = 0, l, i;
-
- l = 80 - 2 - obase;
+ int ret = 0, i;
b = X509_NAME_oneline(name, NULL, 0);
if (!b)
@@ -347,12 +345,10 @@ int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase)
if (BIO_write(bp, ", ", 2) != 2)
goto err;
}
- l--;
}
if (*s == '\0')
break;
s++;
- l--;
}
ret = 1;

View File

@@ -2,9 +2,12 @@ diff --git a/bazel/copts.bzl b/bazel/copts.bzl
index 10be944f25..879518b92f 100644 index 10be944f25..879518b92f 100644
--- a/bazel/copts.bzl --- a/bazel/copts.bzl
+++ b/bazel/copts.bzl +++ b/bazel/copts.bzl
@@ -59,4 +59,4 @@ GRPC_LLVM_WARNING_FLAGS = [ @@ -59,4 +59,7 @@ GRPC_LLVM_WARNING_FLAGS = [
GRPC_DEFAULT_COPTS = select({ GRPC_DEFAULT_COPTS = select({
"//:use_strict_warning": GRPC_LLVM_WARNING_FLAGS + ["-DUSE_STRICT_WARNING=1"], "//:use_strict_warning": GRPC_LLVM_WARNING_FLAGS + ["-DUSE_STRICT_WARNING=1"],
"//conditions:default": [], "//conditions:default": [],
-}) -})
+}) + ["-std=c++14"] +}) + select({
+ "@bazel_tools//src/conditions:windows": ["/std:c++14"],
+ "//conditions:default": ["-std=c++14"],
+})