Skip to content

Allow linking utf8_validity alongside protobuf in cargo builds. - #2011

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_981304171
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_981304171

Conversation

@copybara-service

Copy link
Copy Markdown

Allow linking utf8_validity alongside protobuf in cargo builds.

libprotobuf has undefined references to utf8_range_IsValid and
utf8_range_ValidPrefix, which are provided by libutf8_validity.
Previously, collect_protobuf_libs only accepted the archive named
protobuf.

This change extends the allowlist to include utf8_validity. The
discovery remains an explicit allowlist, because other archives in the
protobuf install tree must not be linked together:

  • utf8_range defines the same symbols as utf8_validity and causes
    duplicate symbol errors (LNK2005).
  • protobuf-lite duplicates symbols from protobuf.
  • protoc and upb are not needed by Crubit.

This change allows Chromium's tools/rust/build_crubit.py to remove
the workaround that merged libutf8_validity into libprotobuf.

`libprotobuf` has undefined references to `utf8_range_IsValid` and
`utf8_range_ValidPrefix`, which are provided by `libutf8_validity`.
Previously, `collect_protobuf_libs` only accepted the archive named
`protobuf`.

This change extends the allowlist to include `utf8_validity`.  The
discovery remains an explicit allowlist, because other archives in the
protobuf install tree must not be linked together:
* `utf8_range` defines the same symbols as `utf8_validity` and causes
  duplicate symbol errors (`LNK2005`).
* `protobuf-lite` duplicates symbols from `protobuf`.
* `protoc` and `upb` are not needed by Crubit.

This change allows Chromium's `tools/rust/build_crubit.py` to remove
the workaround that merged `libutf8_validity` into `libprotobuf`.

PiperOrigin-RevId: 981304171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant