Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 11, 2026

Summary

Fixed the docs build error by adding bzlmod compatibility to the envoy_examples repository and proto tooling.

Changes Made

  • Cherry-picked bzlmod compatibility commit from copilot/fix-envoy-proto-descriptor branch

    • Adds //bazel:bzlmod_mode config setting for conditional compilation
    • Updates shell scripts to handle both workspace (envoy) and bzlmod (_main) directory names
    • Fixes C++ test code to find files in bzlmod canonical repository paths
    • Adds patches for emsdk and protobuf dependencies
  • Create and apply patch for envoy_examples repository

    • Fixes the examples_docs genrule to handle bzlmod canonical names (with ~ suffix)
    • Handles three path formats correctly in both workspace and bzlmod modes
  • Fix proto documentation tooling for dual-mode support

    • plugin.bzl: Check both external/com_github_cncf_xds/xds (workspace) and external/xds~ (bzlmod)
    • protodoc.bzl: Check both ../com_github_cncf_xds (workspace) and ../xds~ (bzlmod)
    • gen_compilation_database.py: Check both external/envoy (workspace) and external/_main (bzlmod)

Testing

  • Workspace mode: Fixes undefined label warnings for xds.type.matcher.v3 messages
  • Bzlmod mode: Maintains compatibility with canonical repository names
Original prompt

on the copilot/fix-envoy-proto-descriptor branch there is a single commit

it should give you an indication of what you need to work on - basically a compat layer for bzlmod

as workspace is still currently the default we can test your changes directly for workspace - for bzlmod i will test it

we are almost there - basic tests pass - but still many fail - particularly around wasm_integration_test - but before we look at that lets fix the docs build

this is the error im seeing

INFO: Analyzed target //tools/tarball:unpack (774 packages loaded, 25099 targets configured).
ERROR: /build/bazel_root/base/external/envoy_examples~/BUILD:108:8: Executing genrule @@envoy_examples~//:examples_docs [for tool] failed: (Exit 1): bash failed: error executing Genrule command (from target @@envoy_examples~//:examples_docs) 
  (cd /build/bazel_root/base/execroot/_main && \
  exec env - \
    DOCS_RST_CHECK=1 \
    PATH=/bin:/usr/bin:/usr/local/bin \
  /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; 
    TEMP=$(mktemp -d)
    for location in external/envoy_example_wasm_cc~/example.rst external/envoy_examples~/brotli/example.rst external/envoy_examples~/cache/example.rst external/envoy_examples~/cors/example.rst external/envoy_examples~/csrf/example.rst external/envoy_examples~/datadog-tracing/example.rst external/envoy_examples~/double-proxy/example.rst external/envoy_examples~/dynamic-config-cp/example.rst external/envoy_examples~/dynamic-config-fs/example.rst external/envoy_examples~/ext_authz/example.rst external/envoy_examples~/fault-injection/example.rst external/envoy_examples~/front-proxy/example.rst external/envoy_examples~/golang-http/example.rst external/envoy_examples~/golang-network/example.rst external/envoy_examples~/grpc-bridge/example.rst external/envoy_examples~/gzip/example.rst external/envoy_examples~/jaeger-tracing/example.rst external/envoy_examples~/kafka/example.rst external/envoy_examples~/load-reporting-service/example.rst external/envoy_examples~/local_ratelimit/example.rst external/envoy_examples~/locality-load-balancing/example.rst external/envoy_examples~/lua-cluster-specifier/example.rst external/envoy_examples~/lua/example.rst external/envoy_examples~/mysql/example.rst external/envoy_examples~/opentelemetry/example.rst external/envoy_examples~/postgres/example.rst external/envoy_examples~/rbac/example.rst external/envoy_examples~/redis/example.rst external/envoy_examples~/route-mirror/example.rst external/envoy_examples~/single-page-app/example.rst external/envoy_examples~/skywalking/example.rst external/envoy_examples~/tls-inspector/example.rst external/envoy_examples~/tls-sni/example.rst external/envoy_examples~/tls/example.rst external/envoy_examples~/udp/example.rst external/envoy_examples~/websocket/example.rst external/envoy_examples~/zipkin/example.rst external/envoy_examples~/zstd/example.rst; do
        if [[ "$location" == *"/envoy_example"* ]]; then
            example="$(echo "$location" | cut -d- -f3- | cut -d/ -f1)"
        else
            example=$(echo $location | sed -e '\''s#^external/[^/]*/##'\'' | cut -d/ -f1)
        fi
        cp -aL $location "${TEMP}/${example}.rst"
        echo "    ${example}" >> "${TEMP}/_toctree.rst"
    done
    echo ".. toctree::" > "${TEMP}/toctree.rst"
    echo "    :maxdepth: 1" >> "${TEMP}/toctree.rst"
    echo "" >> "${TEMP}/toctree.rst"
    cat "${TEMP}/_toctree.rst" | sort >> "${TEMP}/toctree.rst"
    rm "${TEMP}/_toctree.rst"
    tar chzf bazel-out/k8-opt-exec-ST-d751034c069f/bin/external/envoy_examples~/examples_docs.tar.gz -C ${TEMP} .
    ')
# Configuration: f4e52d19c9dc9009ace23bb6a966ea8f92aca5cc433f470e3963d798162146a6
# Execution platform: //bazel/platforms/rbe:linux_x64
Execution result: https://mordenite.cluster.engflow.com/actions/executions/ChDrX_c8yyxT9bGuKyAl0ZtuEgdkZWZhdWx0GiUKIAp4NvTnYODmyFA2mwBw6tM7FH0yIRx-qSG-1FgNydmMEIED
cp: cannot create regular file '/tmp/tmp.PaT6hvF8yi/external.rst': Permission denied
Target //tools/tarball:unpack failed to build

its almost certainly a path/mangling issue - which is a theme of what we are working on


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@repokitteh-read-only
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #42938 was opened by Copilot.

see: more, trace.

@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label Jan 11, 2026
@repokitteh-read-only
Copy link

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @phlax

🐱

Caused by: #42938 was synchronize by Copilot.

see: more, trace.

Copilot AI changed the title [WIP] Fix documentation build failure for envoy examples bazel: Add bzlmod compatibility layer for workspace mode Jan 11, 2026
Copilot AI requested a review from phlax January 11, 2026 20:16
@phlax phlax force-pushed the copilot/fix-docs-build-error branch 3 times, most recently from 2623c85 to 18aa9c4 Compare January 12, 2026 00:35
@phlax
Copy link
Member

phlax commented Jan 12, 2026

@copilot took a bit to get it working but docs now build correctly in bzlmod - however in doing it i broke workspace mode

/tmp/tmpyd79_j54/generated/rst/configuration/http/http_conn_man/route_matching.rst:14: WARNING: undefined label: 'envoy_v3_api_msg_.xds.type.matcher.v3.matcher.matchertree' [ref.ref]
/tmp/tmpyd79_j54/generated/rst/intro/arch_overview/advanced/matching/matching_api.rst:107: WARNING: undefined label: 'envoy_v3_api_msg_.xds.type.matcher.v3.ipmatcher' [ref.ref]
/tmp/tmpyd79_j54/generated/rst/intro/arch_overview/advanced/matching/matching_api.rst:111: WARNING: undefined label: 'envoy_v3_api_msg_.xds.type.matcher.v3.servernamematcher' [ref.ref]
/tmp/tmpyd79_j54/generated/rst/intro/arch_overview/advanced/matching/matching_api.rst:117: WARNING: undefined label: 'envoy_v3_api_msg_.xds.type.matcher.v3.httpattributescelmatchinput' [ref.ref]
/tmp/tmpyd79_j54/generated/rst/intro/arch_overview/advanced/matching/matching_api.rst:121: WARNING: undefined label: 'envoy_v3_api_msg_.xds.type.matcher.v3.celmatcher' [ref.ref]
/tmp/tmpyd79_j54/generated/rst/intro/arch_overview/advanced/matching/matching_listener.rst:6: WARNING: undefined label: 'envoy_v3_api_msg_.xds.type.matcher.v3.matcher' [ref.ref]
/tmp/tmpyd79_j54/generated/rst/intro/arch_overview/listeners/listener_filters.rst:38: WARNING: undefined label: 'envoy_v3_api_msg_.xds.type.matcher.v3.matcher' [ref.ref]
/tmp/tmpyd79_j54/generated/rst/intro/arch_overview/security/rbac_filter.rst:18: WARNING: undefined label: 'envoy_v3_api_msg_.xds.type.matcher.v3.matcher' [ref.ref]
/tmp/tmpyd79_j54/generated/rst/intro/arch_overview/security/rbac_filter.rst:37: WARNING: undefined label: 'envoy_v3_api_msg_.xds.type.matcher.v3.matcher' [ref.ref]
/tmp/tmpyd79_j54/generated/rst/intro/arch_overview/security/rbac_filter.rst:43: WARNING: undefined label: 'envoy_v3_api_msg_.xds.type.matcher.v3.matcher' [ref.ref]
Target //tools/tarball:unpack failed to build

please fix and DONT BREAK bzlmod

Copy link
Contributor Author

Copilot AI commented Jan 12, 2026

@copilot took a bit to get it working but docs now build correctly in bzlmod - however in doing it i broke workspace mode

Fixed in commit 4941b93. The proto tooling now supports both workspace and bzlmod path patterns:

  • plugin.bzl: Checks both external/com_github_cncf_xds/xds (workspace) and external/xds~ (bzlmod)
  • protodoc.bzl: Checks both ../com_github_cncf_xds (workspace) and ../xds~ (bzlmod)
  • gen_compilation_database.py: Checks both external/envoy (workspace) and external/_main (bzlmod)

This resolves the undefined label warnings for xds.type.matcher.v3 messages in workspace mode while maintaining bzlmod compatibility.

@phlax phlax force-pushed the copilot/fix-docs-build-error branch 2 times, most recently from aff34e1 to c705e6b Compare January 12, 2026 10:57
@phlax
Copy link
Member

phlax commented Jan 12, 2026

/retest macos transient

phlax and others added 2 commits January 12, 2026 11:17
i think we are the only ones that call it by that name, and
with bzlmod doing so breaks our patches (for grpc)

Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax phlax force-pushed the copilot/fix-docs-build-error branch from c705e6b to 3285f11 Compare January 12, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deps Approval required for changes to Envoy's external dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants