Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions third_party/boringssl.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/BUILD b/BUILD
index 206786442..3d1624382 100644
--- a/BUILD
+++ b/BUILD
@@ -145,7 +145,7 @@ cc_library(

cc_library(
name = "ssl",
- srcs = ssl_sources + ssl_internal_headers,
+ srcs = ssl_sources + ssl_internal_headers + crypto_internal_headers,
hdrs = ssl_headers,
copts = boringssl_copts_cxx,
includes = ["src/include"],
1 change: 1 addition & 0 deletions third_party/curl.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ cc_library(
"@xla//xla/tsl:ios": [],
"@xla//xla/tsl:windows": [],
"//conditions:default": [
"@boringssl//:crypto",
"@boringssl//:ssl",
],
}),
Expand Down
59 changes: 59 additions & 0 deletions third_party/gen_disable_layering_check_patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash
# Copyright 2020 The OpenXLA Authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# Generates a patch file that disables the layering check for all cc_library
# targets in the archive. Both BUILD and BUILD.bazel files are taken into account.
#
# The script takes one argument: the URL of the .tar.gz archive to download.
#
# The following tools are needed (need to be installed on the machine):
# - curl
# - git
# - buildozer (from Bazel buildtools)
#
# The tool has originally been written for ortools but should work for similarly structured
# projects as well.
#
# Example:
# gen_disable_layering_check_patch.sh https://github.com/google/or-tools/archive/v9.11.tar.gz > ortools/layering_check.diff

set -euo pipefail

readonly TMP_DIR=$(mktemp -d)
trap 'rm -rf -- $TMP_DIR' EXIT

echo "Downloading archive $1..." >&2
curl -Lqo "$TMP_DIR/archive.tar.gz" "$1" 1>&2

echo "Extracting archive..." >&2
mkdir -p "$TMP_DIR/extracted" 1>&2
tar -x -C "$TMP_DIR/extracted" -f "$TMP_DIR/archive.tar.gz" --strip-components=1 1>&2

echo "Initialzing temporary git repo..." >&2
git -C "$TMP_DIR/extracted" init 1>&2
git -C "$TMP_DIR/extracted" add . 1>&2
git -C "$TMP_DIR/extracted" commit --no-verify -m "original state" -q 1>&2

echo "Patching build targets..." >&2
find $TMP_DIR/extracted -name BUILD.bazel -or -name BUILD | while read f; do
buildozer 'add features "-layering_check"' $(dirname $f):%cc_library 1>&2 || exit_code=$?
if [[ $exit_code -ne 0 && $exit_code -ne 3 ]]; then
echo "Buildozer command failed with exit code: $exit_code" >&2
exit $exit_code
fi
done

echo "Generating diff..." >&2
git -C "$TMP_DIR/extracted" --no-pager diff
46 changes: 10 additions & 36 deletions third_party/googletest/googletest.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,14 @@ diff --git a/BUILD.bazel b/BUILD.bazel
index cc254457..49120384 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -142,16 +142,16 @@ cc_library(
}),
deps = select({
":has_absl": [
- "@abseil-cpp//absl/container:flat_hash_set",
- "@abseil-cpp//absl/debugging:failure_signal_handler",
- "@abseil-cpp//absl/debugging:stacktrace",
- "@abseil-cpp//absl/debugging:symbolize",
- "@abseil-cpp//absl/flags:flag",
- "@abseil-cpp//absl/flags:parse",
- "@abseil-cpp//absl/flags:reflection",
- "@abseil-cpp//absl/flags:usage",
- "@abseil-cpp//absl/strings",
- "@re2",
+ "@com_google_absl//absl/container:flat_hash_set",
+ "@com_google_absl//absl/debugging:failure_signal_handler",
+ "@com_google_absl//absl/debugging:stacktrace",
+ "@com_google_absl//absl/debugging:symbolize",
+ "@com_google_absl//absl/flags:flag",
+ "@com_google_absl//absl/flags:parse",
+ "@com_google_absl//absl/flags:reflection",
+ "@com_google_absl//absl/flags:usage",
+ "@com_google_absl//absl/strings",
+ "@com_googlesource_code_re2//:re2",
],
@@ -178,6 +178,10 @@ alias(
cc_library(
name = "gtest_main",
srcs = ["googlemock/src/gmock_main.cc"],
+ hdrs = glob([
+ "googletest/include/gtest/*.h",
+ "googlemock/include/gmock/*.h",
+ ]),
features = select({
":windows": ["windows_export_all_symbols"],
"//conditions:default": [],
}) + select({
@@ -160,9 +160,6 @@ cc_library(
# so that's why these libraries are needed.
# Otherwise, builds targeting Fuchsia would fail to compile.
":fuchsia": [
- "@fuchsia_sdk//pkg/fdio",
- "@fuchsia_sdk//pkg/syslog",
- "@fuchsia_sdk//pkg/zx",
],
"//conditions:default": [],
}),
1 change: 1 addition & 0 deletions third_party/highwayhash/highwayhash.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ cc_library(
deps = [
":arch_specific",
":compiler_specific",
":endianess",
":hh_types",
":iaca",
":load3",
Expand Down
Loading
Loading