Protobuf/Buf Formatter Fails for Files Larger than 64KiB
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java
- Domain
- build-system
Research direction
Reproduce the failure with a valid .proto file larger than 64 KiB and run spotlessApply. Start by reading ProcessRunner.start and the BufStep.java:109 call site shown in the trace; done means formatting completes without a Broken pipe lint and the generated output remains valid.
Written by the indexing model from the issue text.
Description
Test case:
- Define a .proto files larger than 64 KiB (or your platform's pipe buffer limit). Padding with whitespace should also work.
- Configure spotless to format said file.
- Run spotlessApply (gradle example).
Expected behavior:
Formatting runs and passes (if valid proto file).
Actual behavior:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':treatment:api:spotlessProtobufApply'.
...
Caused by: org.gradle.api.GradleException: There were 1 lint error(s), they must be fixed or suppressed.
src/...:LINE_UNDEFINED buf(java.io.IOException) Broken pipe (...)
Resolve these lints or suppress with `suppressLintsFor`
at com.diffplug.gradle.spotless.SpotlessApply.performAction(SpotlessApply.java:60)
cat-ing /build/spotless-lints/... shows:
Broken pipe
at java.base/java.io.FileOutputStream.writeBytes(Native Method)
at java.base/java.io.FileOutputStream.write(FileOutputStream.java:367)
at java.base/java.io.BufferedOutputStream.implWrite(BufferedOutputStream.java:217)
at java.base/java.io.BufferedOutputStream.write(BufferedOutputStream.java:206)
at java.base/java.io.FilterOutputStream.write(FilterOutputStream.java:110)
at com.diffplug.spotless.ProcessRunner.start(ProcessRunner.java:165)
at com.diffplug.spotless.ProcessRunner.start(ProcessRunner.java:131)
at com.diffplug.spotless.ProcessRunner.exec(ProcessRunner.java:114)
at com.diffplug.spotless.ProcessRunner.exec(ProcessRunner.java:109)
at com.diffplug.spotless.protobuf.BufStep$State.format(BufStep.java:109)
at com.diffplug.spotless.FormatterFunc$Closeable$3.apply(FormatterFunc.java:140)
at com.diffplug.spotless.FormatterStepEqualityOnStateSerialization.format(FormatterStepEqualityOnStateSerialization.java:49)
at com.diffplug.spotless.LintState.of(LintState.java:177)
at com.diffplug.spotless.LintState.of(LintState.java:134)
at com.diffplug.gradle.spotless.SpotlessTaskImpl.processInputFile(SpotlessTaskImpl.java:134)
at com.diffplug.gradle.spotless.SpotlessTaskImpl.performAction(SpotlessTaskImpl.java:117)
...
- Dominant language
- Java
- Stars
- 5.7k
- Forks
- 560
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 43
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from diffplug/spotless
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
All issues in diffplug/spotless
Similar issues
-
certification
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Openbug ecr
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Needs: Triage Type: Feature request
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
github/copilot-sdk#2760 ·