Skip to content

build(deps): Align protobuf and related dependencies with the gRPC v1.81.1 bump#516

Merged
mc-nv merged 3 commits into
mainfrom
mchornyi/TRI-1608/cinightly-fix-broken-build
Jul 23, 2026
Merged

build(deps): Align protobuf and related dependencies with the gRPC v1.81.1 bump#516
mc-nv merged 3 commits into
mainfrom
mchornyi/TRI-1608/cinightly-fix-broken-build

Conversation

@mc-nv

@mc-nv mc-nv commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What does the PR do?

Fixes the nightly core build against protobuf v33 (gRPC v1.81.1 third_party bump):

  • Pass utf8_range_DIR into the triton-core ExternalProject cache args — protobuf v33's CMake package config requires the utf8_range package config to resolve.
  • Adapt model_config_utils.cc to the protobuf v33 API: FieldDescriptor::name() now returns absl::string_view (explicit std::string conversion), always_print_primitive_fields is renamed to always_print_fields_with_no_presence, and the now-nodiscard MessageToJsonString() status is checked and surfaced as an INTERNAL error.

Checklist

  • PR title reflects the change and is of format <commit_type>: <Title>
  • Changes are described in the pull request.
  • Related issues are referenced.
  • Populated github labels field
  • Added test plan and verified test passes.
  • Verified that the PR passes existing CI.
  • Verified copyright is correct on all changed files.
  • Added succinct git squash message before merging ref.
  • All template sections are filled out.
  • Optional: Additional screenshots for behavior/output changes with before/after.

Related PRs:

Where should the reviewer start?

  • CMakeLists.txtutf8_range_DIR propagation
  • src/model_config_utils.cc — protobuf v33 API adaptations

Test plan:

Nightly build pipeline on internal GitLab CI.

  • CI Pipeline ID: 58489960

Caveats:

None.

Background

The gRPC v1.81.1 / protobuf v33 update in triton-inference-server/third_party#76 broke the nightly build across the Triton repos; this PR chain repairs it.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • Resolves: TRI-1608
CI (internal): [#58489960](http://tritonserver.local/ci/pipelines/58489960)

mc-nv added 2 commits July 17, 2026 19:15
The protobuf bundled with gRPC v1.81.1 (v33.5) installs utf8_range as a
separate CMake package and protobuf-config.cmake references the
utf8_range::utf8_validity imported target. find_package(Protobuf CONFIG)
with only Protobuf_DIR set fails at generate time with 'the target was
not found'. Provide utf8_range_DIR alongside Protobuf_DIR.
Three breakages against the protobuf bundled with gRPC v1.81.1:
- FieldDescriptor::name() now returns absl::string_view; wrap in
  std::string for concatenation.
- JsonPrintOptions::always_print_primitive_fields was removed; use its
  designated replacement always_print_fields_with_no_presence.
- MessageToJsonString's absl::Status return is nodiscard and fails the
  -Werror build when ignored; propagate it as an INTERNAL status.
@mc-nv
mc-nv force-pushed the mchornyi/TRI-1608/cinightly-fix-broken-build branch from 6df36fb to 3df65f8 Compare July 18, 2026 02:16
protobuf v33 makes DebugString() output intentionally unstable (injects a
'goo.gle/debugstr' marker that is not valid text format), which polluted
the 'Server side auto-completed config' log and broke L0_logging's
log_format parser. Serialize with TextFormat::PrintToString at the call
site instead of LOG_PROTOBUF_VERBOSE.
@mc-nv
mc-nv marked this pull request as ready for review July 18, 2026 17:31
@mc-nv
mc-nv requested a review from pskiran1 July 22, 2026 15:11
@mc-nv
mc-nv requested a review from mattwittwer July 22, 2026 15:11
@Vinya567

Copy link
Copy Markdown
Contributor

@greptileai

@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown

Greptile Summary

This PR repairs the nightly build broken by the gRPC v1.81.1 / protobuf v33 bump by propagating the new utf8_range_DIR cmake dependency and adapting model_config_utils.cc to three protobuf v33 API changes.

  • CMakeLists.txt: adds -Dutf8_range_DIR to the triton-core ExternalProject cache args so the protobuf v33 package config can resolve its utf8_range dependency.
  • src/model_config_utils.cc: converts field->name() to std::string (now returns absl::string_view), renames always_print_primitive_fieldsalways_print_fields_with_no_presence, checks the [[nodiscard]] return of MessageToJsonString, and replaces LOG_PROTOBUF_VERBOSE with a TextFormat::PrintToString-based block to avoid the unstable DebugString() marker injected by protobuf v33.

Confidence Score: 4/5

Safe to merge; all three protobuf v33 API adaptations are correct and the cmake fix is straightforward.

The core changes — utf8_range_DIR propagation, absl::string_view conversion, option rename, and MessageToJsonString status check — are all correct and complete. The new verbose-logging block silently discards PrintToString's failure return and emits at kINFO rather than the VERBOSE level used everywhere else in the file; neither affects runtime correctness, only log quality.

src/model_config_utils.cc — the new logging block around line 765

Important Files Changed

Filename Overview
CMakeLists.txt Adds utf8_range_DIR to the ExternalProject cmake cache args so protobuf v33's package config can find the utf8_range dependency — straightforward, correct fix.
src/model_config_utils.cc Adapts three protobuf v33 API changes (FieldDescriptor::name(), always_print_fields_with_no_presence rename, and MessageToJsonString nodiscard). Also replaces LOG_PROTOBUF_VERBOSE with a TextFormat::PrintToString-based block, but PrintToString's return value is silently dropped and the emitted log level is kINFO inside a LOG_VERBOSE_IS_ON(1) guard.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[GetNormalizedModelConfig] --> B[AutoCompleteBackendFields]
    B --> C{LOG_VERBOSE_IS_ON 1}
    C -- yes --> D[TextFormat::PrintToString config]
    D --> E[LogMessage kINFO stream]
    C -- no --> F[NormalizeModelConfig]
    E --> F

    G[ModelConfigToJson] --> H[JsonPrintOptions always_print_fields_with_no_presence]
    H --> I[MessageToJsonString]
    I --> J{status.ok?}
    J -- no --> K[return INTERNAL error]
    J -- yes --> L[fix up int64 fields in JSON]

    M[CollectInt64Fields] --> N[field->name returns absl::string_view]
    N --> O[std::string fullname = prefix + '::' + std::string field->name]
Loading

Reviews (1): Last reviewed commit: "fix: Log auto-completed model config wit..." | Re-trigger Greptile

Comment thread src/model_config_utils.cc
Comment on lines +765 to +766
google::protobuf::TextFormat::PrintToString(
*config, &auto_completed_config);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 TextFormat::PrintToString returns false when serialization fails (e.g., the message contains an unknown field that triggers strict printing). The return value is silently discarded here, so if it fails auto_completed_config will be empty and the log line will print nothing useful. Since this is only for diagnostics the cost is low, but a silent empty-string log can be confusing. Binding the result and logging a fallback is safer.

Suggested change
google::protobuf::TextFormat::PrintToString(
*config, &auto_completed_config);
if (!google::protobuf::TextFormat::PrintToString(
*config, &auto_completed_config)) {
auto_completed_config = "<serialization failed>";
}

Comment thread src/model_config_utils.cc
Comment on lines +767 to +771
triton::common::LogMessage(
__FILE__, __LINE__, triton::common::Logger::Level::kINFO,
"Server side auto-completed config: ", false)
.stream()
<< auto_completed_config;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 The block is guarded by LOG_VERBOSE_IS_ON(1) but LogMessage is called with Logger::Level::kINFO. This means when verbose level 1 is enabled the auto-completed config is emitted as an INFO message, not a VERBOSE message, which could clutter INFO-level log streams. The rest of the file uses LOG_VERBOSE(1) << ... for the same pattern; using it here would match codebase conventions and emit at the correct level.

Suggested change
triton::common::LogMessage(
__FILE__, __LINE__, triton::common::Logger::Level::kINFO,
"Server side auto-completed config: ", false)
.stream()
<< auto_completed_config;
LOG_VERBOSE(1) << "Server side auto-completed config: "
<< auto_completed_config;

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@mc-nv
mc-nv merged commit bf44dbe into main Jul 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants