-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ted Poole <tpoole@redhat.com>
- Loading branch information
Showing
10,255 changed files
with
1,457,641 additions
and
95 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import %workspace%/envoy/.bazelrc | ||
import %workspace%/vendor/envoy/.bazelrc | ||
import %workspace%/vendor.bazelrc | ||
build --@envoy//bazel:http3=False | ||
try-import %workspace%/user.bazelrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
envoy/.bazelversion | ||
vendor/envoy/.bazelversion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "patch", "workspace_and_buildfile") | ||
|
||
# Do not edit these values directly. To update the version | ||
# of envoy to be used, please run the update-envoy.sh script. | ||
ENVOY_ORG = "envoyproxy" | ||
ENVOY_REPO = "envoy" | ||
ENVOY_BRANCH = "v1.26.6" | ||
ENVOY_COMMIT = "c2919e90b0e63ad78602122d6c2c3e2c0df1e0fc" | ||
ENVOY_SHA256 = "358df10deb5de6f6a02fae4994d9269672ae8eb6d9cd66bdba349bef7843d14a" | ||
|
||
|
||
def _bssl_compat_repository_impl(ctx): | ||
ctx.symlink(ctx.path(Label("//:bssl-compat/WORKSPACE")).dirname, "") | ||
|
||
_bssl_compat_repository = repository_rule( | ||
implementation = _bssl_compat_repository_impl, | ||
local = True, | ||
) | ||
|
||
|
||
def _vendored_envoy_impl(ctx): | ||
ctx.symlink(ctx.path(Label("//:vendor/envoy/BUILD")).dirname, "") | ||
|
||
_vendored_envoy = repository_rule( | ||
implementation = _vendored_envoy_impl, | ||
local = True, | ||
) | ||
|
||
|
||
def _downloaded_envoy_impl(ctx): | ||
ctx.download_and_extract( | ||
url = "https://github.com/" + ENVOY_ORG + "/" + ENVOY_REPO + "/archive/" + ENVOY_COMMIT + ".tar.gz", | ||
sha256 = ENVOY_SHA256, | ||
stripPrefix = ENVOY_REPO + "-" + ENVOY_COMMIT, | ||
) | ||
patch(ctx) | ||
for f in ctx.attr.overwrites: | ||
ctx.file(Label(f).name, content = ctx.read(f),) | ||
|
||
_downloaded_envoy = repository_rule( | ||
implementation = _downloaded_envoy_impl, | ||
attrs = { | ||
"patches": attr.label_list(), | ||
"patch_args": attr.string_list(default = ["-p1"]), | ||
"overwrites": attr.label_list(), | ||
}, | ||
) | ||
|
||
|
||
# Sets up the @bssl-compat and @envoy repositories, ensuring that | ||
# the @envoy repository uses @bssl-compat instead of @boringssl | ||
def envoy_openssl_repositories(download = False): | ||
_bssl_compat_repository( | ||
name = "bssl-compat", | ||
) | ||
|
||
if download: | ||
_downloaded_envoy( | ||
name = "envoy", | ||
patches = [ | ||
"//patch/envoy:bazel/repositories_extra.bzl.patch", | ||
"//patch/envoy:bazel/repositories.bzl.patch", | ||
"//patch/envoy:source/common/quic/BUILD.patch", | ||
"//patch/envoy:source/extensions/extensions_build_config.bzl.patch", | ||
"//patch/envoy:source/extensions/transport_sockets/tls/io_handle_bio.cc.patch", | ||
"//patch/envoy:source/extensions/transport_sockets/tls/ocsp/asn1_utility.cc.patch", | ||
"//patch/envoy:source/extensions/transport_sockets/tls/utility.cc.patch", | ||
], | ||
overwrites = [ | ||
# "//patch/envoy:source/extensions/transport_sockets/tls/context_impl.cc", | ||
# "//patch/envoy:source/extensions/transport_sockets/tls/context_impl.h", | ||
], | ||
repo_mapping = { "@boringssl": "@bssl-compat" } | ||
) | ||
else: | ||
_vendored_envoy( | ||
name = "envoy", | ||
repo_mapping = { "@boringssl": "@bssl-compat" } | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../envoy/bazel/get_workspace_status | ||
../vendor/envoy/bazel/get_workspace_status |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../envoy/bazel/platform_mappings | ||
../vendor/envoy/bazel/platform_mappings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
set -x | ||
|
||
SCRATCHDIR="$(mktemp -d)" | ||
trap 'rm -rf -- "${SCRATCHDIR}" &> /dev/null' EXIT | ||
|
||
ENVOY_ORG="${ENVOY_ORG:-envoyproxy}" | ||
ENVOY_REPO="${ENVOY_REPO:-envoy}" | ||
ENVOY_BRANCH="${ENVOY_BRANCH:-}" | ||
|
||
WORKSPACE="$(cd "$(dirname "$0")" & pwd)" | ||
VENDOR_DIR="${WORKSPACE}/vendor" | ||
VENDOR_BAZELRC="${WORKSPACE}/vendor.bazelrc" | ||
OUTPUT_BASE="${SCRATCHDIR}/output" | ||
|
||
# If ${ENVOY_BRANCH} is blank then work out what branch | ||
# of the envoy-openssl repository we are on, and use that. | ||
if [[ -z "${ENVOY_BRANCH}" ]]; then | ||
ENVOY_BRANCH="$(cd "${WORKSPACE}" && git symbolic-ref --quiet --short HEAD)" | ||
fi | ||
|
||
# If ${ENVOY_BRANCH} has been specified by the caller, or worked out by us, | ||
# then update the constants in bazel/envoy_openssl_repositories.bzl | ||
if [[ "${ENVOY_BRANCH}" != "skip" ]]; then | ||
# Download the envoy branch | ||
cd "${SCRATCHDIR}" | ||
echo "Fetching ${ENVOY_ORG}/${ENVOY_REPO}[${ENVOY_BRANCH}]" | ||
git clone --depth=1 -b "${ENVOY_BRANCH}" "https://github.com/${ENVOY_ORG}/${ENVOY_REPO}.git" | ||
|
||
# Get the commit id | ||
cd "${ENVOY_REPO}" | ||
ENVOY_COMMIT=$(git rev-parse HEAD) | ||
|
||
# Get the SHA256 | ||
cd "${SCRATCHDIR}" | ||
curl -sfLO "https://github.com/${ENVOY_ORG}/${ENVOY_REPO}/archive/${ENVOY_COMMIT}.tar.gz" | ||
ENVOY_SHA256=$(sha256sum "${ENVOY_COMMIT}.tar.gz" | awk '{print $1}') | ||
|
||
# Update the envoy org, repo, commit & sha256 valuse in envoy_openssl_repositories.bzl | ||
sed -i "s|^ENVOY_ORG = .*|ENVOY_ORG = \"${ENVOY_ORG}\"|" "${WORKSPACE}/bazel/envoy_openssl_repositories.bzl" | ||
sed -i "s|^ENVOY_REPO = .*|ENVOY_REPO = \"${ENVOY_REPO}\"|" "${WORKSPACE}/bazel/envoy_openssl_repositories.bzl" | ||
sed -i "s|^ENVOY_BRANCH = .*|ENVOY_BRANCH = \"${ENVOY_BRANCH}\"|" "${WORKSPACE}/bazel/envoy_openssl_repositories.bzl" | ||
sed -i "s|^ENVOY_COMMIT = .*|ENVOY_COMMIT = \"${ENVOY_COMMIT}\"|" "${WORKSPACE}/bazel/envoy_openssl_repositories.bzl" | ||
sed -i "s|^ENVOY_SHA256 = .*|ENVOY_SHA256 = \"${ENVOY_SHA256}\"|" "${WORKSPACE}/bazel/envoy_openssl_repositories.bzl" | ||
fi | ||
|
||
|
||
# Work out what bazel cache options to use | ||
BAZEL_CACHE_FLAGS="" | ||
if [[ -n ${BAZEL_REMOTE_CACHE} ]]; then | ||
BAZEL_CACHE_FLAGS="--remote_cache=${BAZEL_REMOTE_CACHE}" | ||
if [[ -n ${BAZEL_EXPERIMENTAL_REMOTE_DOWNLOADER} ]]; then | ||
BAZEL_CACHE_FLAGS+=" --experimental_remote_downloader=${BAZEL_EXPERIMENTAL_REMOTE_DOWNLOADER}" | ||
fi | ||
elif [[ -n ${BAZEL_DISK_CACHE} ]]; then | ||
BAZEL_CACHE_FLAGS+="--disk_cache=${BAZEL_DISK_CACHE}" | ||
fi | ||
|
||
# Empty the vendor bazelrc file so bazel will always fetch envoy | ||
: > "${VENDOR_BAZELRC}" | ||
|
||
# Use build --nobuild, rather than fetch, because it honours configuration options | ||
cd "${WORKSPACE}" | ||
bazel --output_base="${OUTPUT_BASE}" build --nobuild ${BAZEL_CACHE_FLAGS} @envoy//:envoy | ||
|
||
# Copy the fetched & patched envoy directory to the ${VENDOR_DIR} | ||
rm -r "${VENDOR_DIR}/envoy" | ||
cp -rL "${OUTPUT_BASE}/external/envoy" "${VENDOR_DIR}/envoy" | ||
|
||
# Remove stuff that we don't need to vendor | ||
find "${VENDOR_DIR}" -name .git -type d -print0 | xargs -0 -r rm -rf | ||
find "${VENDOR_DIR}" -name .gitignore -type f -delete | ||
find "${VENDOR_DIR}" -name __pycache__ -type d -print0 | xargs -0 -r rm -rf | ||
find "${VENDOR_DIR}" -name '*.pyc' -delete | ||
|
||
# Reintate the vendored envoy repository mapping | ||
echo "build --override_repository=envoy=%workspace%/vendor/envoy" > "${VENDOR_BAZELRC}" | ||
|
||
|
||
echo | ||
echo "========================================" | ||
echo "Done. Inspect the result with git status" | ||
echo "========================================" | ||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build --override_repository=envoy=%workspace%/vendor/envoy |
Oops, something went wrong.