• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 35131111084
93%

Build:
DEFAULT BRANCH: main
Ran 16 Sep 2026 06:04PM UTC
Jobs 11
Files 1783
Run time 5min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Sep 2026 05:54PM UTC coverage: 92.916% (+0.004%) from 92.912%
35131111084

push

github

web-flow
jvm: resolve protobuf codegen ambiguity per requesting language (#23668)

## Summary

Implements the design proposed in #23648 ("preferred codegen" dispatch)
to fix a bug where a single, unparametrized `protobuf_sources` target
could not be depended on by both a `java_sources` and a `scala_sources`
target at the same time.

When both the Java and Scala protobuf codegen backends
(`pants.backend.codegen.protobuf.java` and
`pants.backend.codegen.protobuf.scala`) are active, this previously
raised an ambiguity error in two independent places:

- JVM classpath resolution (`ClasspathEntryRequestFactory` in
`pants.jvm.compile`) found both `CompileJavaSourceRequest` and
`CompileScalaSourceRequest` compatible with the same `protobuf_sources`
component and raised `ClasspathSourceAmbiguity`.
- Source hydration (`hydrate_sources` in `pants.engine.internals.graph`)
found two matching `GenerateSourcesRequest` candidates for the same
member and raised `AmbiguousCodegenImplementationsException`, once the
classpath-level ambiguity above was resolved and
`compile_scala_source`'s mixed `for_sources_types=(ScalaSourceField,
JavaSourceField)` request reached it.

## Fix

Both are resolved per dependency edge, based on which language is
actually asking — with **no BUILD file changes required**:

- `ClasspathEntryRequestFactory.for_targets`/`classify_impl` take a
`preferred_impl` parameter (the requesting component's own
`ClasspathEntryRequest` type), and `classpath_dependency_requests`
passes `type(request.request)` as that argument. When a codegen input is
shared by more than one impl, only the preferred impl claims it.
- `hydrate_sources` narrows an otherwise-ambiguous set of
`GenerateSourcesRequest` candidates using `for_sources_types` order: the
first `for_sources_types` entry with exactly one matching generator
wins, matching the existing type-compatibility-preference convention of
that tuple. It still raises if no single preference resolves the tie.

51 of 52 new or added lines in 3 files covered. (98.08%)

95884 of 103194 relevant lines covered (92.92%)

3.66 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
92.88
0.24% src/python/pants/engine/internals/graph.py
Jobs
ID Job ID Ran Files Coverage
1 test_python_linux_x86_64_4/10 - 35131111084.1 16 Sep 2026 06:20PM UTC 1245
59.04
GitHub Action Run
2 test_python_linux_x86_64_7/10 - 35131111084.2 16 Sep 2026 06:17PM UTC 1219
50.88
GitHub Action Run
3 test_python_linux_x86_64_2/10 - 35131111084.3 16 Sep 2026 06:11PM UTC 1215
58.59
GitHub Action Run
4 test_python_linux_x86_64_1/10 - 35131111084.4 16 Sep 2026 06:16PM UTC 1215
48.86
GitHub Action Run
5 test_python_linux_arm64 - 35131111084.5 16 Sep 2026 06:04PM UTC 1196
52.65
GitHub Action Run
6 test_python_linux_x86_64_8/10 - 35131111084.6 16 Sep 2026 06:18PM UTC 1214
52.71
GitHub Action Run
7 test_python_linux_x86_64_5/10 - 35131111084.7 16 Sep 2026 06:12PM UTC 1230
60.37
GitHub Action Run
8 test_python_linux_x86_64_9/10 - 35131111084.8 16 Sep 2026 06:13PM UTC 1225
53.99
GitHub Action Run
9 test_python_linux_x86_64_6/10 - 35131111084.9 16 Sep 2026 06:13PM UTC 1212
50.05
GitHub Action Run
10 test_python_linux_x86_64_0/10 - 35131111084.10 16 Sep 2026 06:18PM UTC 1236
57.46
GitHub Action Run
11 test_python_linux_x86_64_3/10 - 35131111084.11 16 Sep 2026 06:17PM UTC 1214
52.37
GitHub Action Run
Source Files on build 35131111084
  • Tree
  • List 1783
  • Changed 13
  • Source Changed 3
  • Coverage Changed 13
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #35131111084
  • 511d4a7d on github
  • Prev Build on main (#34980155614)
  • Next Build on main (#35688753145)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc