Skip to content

Commit

Permalink
Experimental feature generate_pdb_file in opt build to capture pdb ou…
Browse files Browse the repository at this point in the history
…tput

See bazelbuild/rules_cc#94 for details

Use generate_pdb_file feature to capture pdb from envoy-static.exe

- Introduces features list arg to envoy_cc_binary
- Toggles the feature only for the windows opt case in the envoy-static target
- Capture the resulting envoy-static.pdb output

Signed-off-by: William A Rowe Jr <[email protected]>
  • Loading branch information
wrowe committed Oct 4, 2021
1 parent 9f79431 commit 4c50b57
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bazel/envoy_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def envoy_cc_binary(
stamped = False,
deps = [],
linkopts = [],
tags = []):
tags = [],
features = []):
if not linkopts:
linkopts = _envoy_linkopts()
if stamped:
Expand All @@ -42,6 +43,7 @@ def envoy_cc_binary(
stamp = 1,
deps = deps,
tags = tags,
features = features,
)

# Select the given values if exporting is enabled in the current build.
Expand Down
4 changes: 3 additions & 1 deletion ci/windows_ci_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ fi
if [[ $BUILD_ENVOY_STATIC -eq 1 ]]; then
bazel "${BAZEL_STARTUP_OPTIONS[@]}" build "${BAZEL_BUILD_OPTIONS[@]}" //source/exe:envoy-static

# Copy binary to delivery directory
# Copy binary and pdb to delivery directory
cp -f bazel-bin/source/exe/envoy-static.exe "${ENVOY_DELIVERY_DIR}/envoy.exe"
cp -f bazel-bin/source/exe/envoy-static.pdb "${ENVOY_DELIVERY_DIR}/envoy.pdb"

# Copy for azp, creating a tar archive
tar czf "${ENVOY_BUILD_DIR}"/envoy_binary.tar.gz -C "${ENVOY_DELIVERY_DIR}" envoy.exe
tar czf "${ENVOY_BUILD_DIR}"/envoy_binary_debug.tar.gz -C "${ENVOY_DELIVERY_DIR}" envoy.exe envoy.pdb
fi

# Test invocations of known-working tests on Windows
Expand Down
4 changes: 4 additions & 0 deletions source/exe/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ alias(

envoy_cc_binary(
name = "envoy-static",
features = select({
"//bazel:windows_opt_build": ["generate_pdb_file"],
"//conditions:default": [],
}),
stamped = True,
deps = [":envoy_main_entry_lib"],
)
Expand Down

0 comments on commit 4c50b57

Please sign in to comment.