Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
29 changes: 0 additions & 29 deletions ci/WORKSPACE

This file was deleted.

16 changes: 1 addition & 15 deletions ci/build_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ else
fi

# Not sandboxing, since non-privileged Docker can't do nested namespaces.
BAZEL_OPTIONS="--package_path %workspace%:${ENVOY_SRCDIR}"
export BAZEL_QUERY_OPTIONS="${BAZEL_OPTIONS}"
export BAZEL_BUILD_OPTIONS="--strategy=Genrule=standalone --spawn_strategy=standalone \
--verbose_failures ${BAZEL_OPTIONS} --action_env=HOME --action_env=PYTHONUSERBASE \
Expand All @@ -92,7 +91,7 @@ if [ "$1" != "-nofetch" ]; then
then
git clone https://github.com/envoyproxy/envoy-filter-example.git "${ENVOY_FILTER_EXAMPLE_SRCDIR}"
fi

# This is the hash on https://github.com/envoyproxy/envoy-filter-example.git we pin to.
(cd "${ENVOY_FILTER_EXAMPLE_SRCDIR}" && git fetch origin && git checkout -f 6c0625cb4cc9a21df97cef2a1d065463f2ae81ae)
cp -f "${ENVOY_SRCDIR}"/ci/WORKSPACE.filter.example "${ENVOY_FILTER_EXAMPLE_SRCDIR}"/WORKSPACE
Expand All @@ -101,7 +100,6 @@ fi
# Also setup some space for building Envoy standalone.
export ENVOY_BUILD_DIR="${BUILD_DIR}"/envoy
mkdir -p "${ENVOY_BUILD_DIR}"
cp -f "${ENVOY_SRCDIR}"/ci/WORKSPACE "${ENVOY_BUILD_DIR}"

# This is where we copy build deliverables to.
export ENVOY_DELIVERY_DIR="${ENVOY_BUILD_DIR}"/source/exe
Expand All @@ -119,29 +117,17 @@ mkdir -p "${ENVOY_FAILED_TEST_LOGS}"
export ENVOY_BUILD_PROFILE="${ENVOY_BUILD_DIR}"/generated/build-profile
mkdir -p "${ENVOY_BUILD_PROFILE}"

# This is where we build for bazel.release* and bazel.dev.
export ENVOY_CI_DIR="${ENVOY_SRCDIR}"/ci

function cleanup() {
# Remove build artifacts. This doesn't mess with incremental builds as these
# are just symlinks.
rm -rf "${ENVOY_SRCDIR}"/bazel-*
rm -rf "${ENVOY_CI_DIR}"/bazel-*
rm -rf "${ENVOY_CI_DIR}"/bazel
rm -rf "${ENVOY_CI_DIR}"/tools
rm -f "${ENVOY_CI_DIR}"/.bazelrc
}

cleanup
trap cleanup EXIT

# Hack due to https://github.com/envoyproxy/envoy/issues/838 and the need to have
# .bazelrc available for build linkstamping.
mkdir -p "${ENVOY_FILTER_EXAMPLE_SRCDIR}"/bazel
mkdir -p "${ENVOY_CI_DIR}"/bazel
ln -sf "${ENVOY_SRCDIR}"/bazel/get_workspace_status "${ENVOY_FILTER_EXAMPLE_SRCDIR}"/bazel/
ln -sf "${ENVOY_SRCDIR}"/bazel/get_workspace_status "${ENVOY_CI_DIR}"/bazel/
cp -f "${ENVOY_SRCDIR}"/.bazelrc "${ENVOY_FILTER_EXAMPLE_SRCDIR}"/
cp -f "${ENVOY_SRCDIR}"/.bazelrc "${ENVOY_CI_DIR}"/

export BUILDIFIER_BIN="/usr/local/bin/buildifier"
20 changes: 10 additions & 10 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ function bazel_with_collection() {

function bazel_release_binary_build() {
echo "Building..."
cd "${ENVOY_CI_DIR}"
cd "${ENVOY_SRCDIR}"
bazel build ${BAZEL_BUILD_OPTIONS} -c opt //source/exe:envoy-static
collect_build_profile release_build
# Copy the envoy-static binary somewhere that we can access outside of the
# container.
cp -f \
"${ENVOY_CI_DIR}"/bazel-bin/source/exe/envoy-static \
"${ENVOY_SRCDIR}"/bazel-bin/source/exe/envoy-static \
"${ENVOY_DELIVERY_DIR}"/envoy

# TODO(mattklein123): Replace this with caching and a different job which creates images.
Expand All @@ -58,13 +58,13 @@ function bazel_release_binary_build() {

function bazel_debug_binary_build() {
echo "Building..."
cd "${ENVOY_CI_DIR}"
cd "${ENVOY_SRCDIR}"
bazel build ${BAZEL_BUILD_OPTIONS} -c dbg //source/exe:envoy-static
collect_build_profile debug_build
# Copy the envoy-static binary somewhere that we can access outside of the
# container.
cp -f \
"${ENVOY_CI_DIR}"/bazel-bin/source/exe/envoy-static \
"${ENVOY_SRCDIR}"/bazel-bin/source/exe/envoy-static \
"${ENVOY_DELIVERY_DIR}"/envoy-debug
}

Expand Down Expand Up @@ -164,13 +164,13 @@ elif [[ "$1" == "bazel.dev" ]]; then
setup_clang_toolchain
# This doesn't go into CI but is available for developer convenience.
echo "bazel fastbuild build with tests..."
cd "${ENVOY_CI_DIR}"
cd "${ENVOY_SRCDIR}"
echo "Building..."
bazel build ${BAZEL_BUILD_OPTIONS} -c fastbuild //source/exe:envoy-static
# Copy the envoy-static binary somewhere that we can access outside of the
# container for developers.
cp -f \
"${ENVOY_CI_DIR}"/bazel-bin/source/exe/envoy-static \
"${ENVOY_SRCDIR}"/bazel-bin/source/exe/envoy-static \
"${ENVOY_DELIVERY_DIR}"/envoy-fastbuild
echo "Building and testing..."
bazel test ${BAZEL_TEST_OPTIONS} -c fastbuild //test/...
Expand Down Expand Up @@ -218,13 +218,13 @@ elif [[ "$1" == "bazel.ipv6_tests" ]]; then

setup_clang_toolchain
echo "Testing..."
cd "${ENVOY_CI_DIR}"
cd "${ENVOY_SRCDIR}"
bazel_with_collection test ${BAZEL_TEST_OPTIONS} --test_env=ENVOY_IP_TEST_VERSIONS=v6only -c fastbuild \
//test/integration/... //test/common/network/...
exit 0
elif [[ "$1" == "bazel.api" ]]; then
setup_clang_toolchain
cd "${ENVOY_CI_DIR}"
cd "${ENVOY_SRCDIR}"
echo "Building API..."
bazel build ${BAZEL_BUILD_OPTIONS} -c fastbuild @envoy_api//envoy/...
echo "Testing API..."
Expand Down Expand Up @@ -268,7 +268,7 @@ elif [[ "$1" == "bazel.coverage" ]]; then
exit 0
elif [[ "$1" == "bazel.clang_tidy" ]]; then
setup_clang_toolchain
cd "${ENVOY_CI_DIR}"
cd "${ENVOY_SRCDIR}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we already in ENVOY_SRCDIR in all ofthese?

./run_clang_tidy.sh
exit 0
elif [[ "$1" == "bazel.coverity" ]]; then
Expand All @@ -279,7 +279,7 @@ elif [[ "$1" == "bazel.coverity" ]]; then
setup_gcc_toolchain
echo "bazel Coverity Scan build"
echo "Building..."
cd "${ENVOY_CI_DIR}"
cd "${ENVOY_SRCDIR}"
/build/cov-analysis/bin/cov-build --dir "${ENVOY_BUILD_DIR}"/cov-int bazel build --action_env=LD_PRELOAD ${BAZEL_BUILD_OPTIONS} \
-c opt //source/exe:envoy-static
# tar up the coverity results
Expand Down
5 changes: 0 additions & 5 deletions ci/run_clang_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ echo "build ${BAZEL_BUILD_OPTIONS}" >> .bazelrc
# by clang-tidy
"${ENVOY_SRCDIR}/tools/gen_compilation_database.py" --run_bazel_build --include_headers

# It had to be in ENVOY_CI_DIR to run bazel to generate compile database, but clang-tidy-diff
# diff against current directory, moving them to ENVOY_SRCDIR.
mv ./compile_commands.json "${ENVOY_SRCDIR}/compile_commands.json"
cd "${ENVOY_SRCDIR}"

# Do not run incremental clang-tidy on check_format testdata files.
function exclude_testdata() {
grep -v tools/testdata/check_format/
Expand Down