Compilation using source override fails if sketch file content longer than maximum gRPC message length #2718
Closed
3 tasks done
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
topic: gRPC
Related to the gRPC interface
type: imperfection
Perceived defect in any part of project
Milestone
Describe the problem
The
cc.arduino.cli.commands.v1.ArduinoCoreService.Compile
request message of Arduino CLI's gRPC interface has asourceOverride
field:The design of the field is such that the entire content of the sketch file must be sent in a single message.
🐛 The compilation will fail spuriously if the field is used with a sketch file with content larger than the default maximum gRPC message length.
To reproduce
It will probably be most convenient to use Arduino IDE to reproduce the fault:
BigFileSketch.zip
The "Preferences" dialog will open.
The "Preferences" dialog will close.
ⓘ This is an arbitrary innocuous change in order to put the editor into the "dirty" state, which will cause Arduino IDE to send the contents of the sketch through the
sourceOverride
field of thecc.arduino.cli.commands.v1.ArduinoCoreService.Compile
request message.🐛 Compilation fails:
Expected behavior
The API is designed in a way that allows the source override feature to be used even with large sketch files.
Arduino CLI version
1.0.4
Operating system
Windows
Operating system version
Windows 11
Additional context
Originally reported at https://forum.arduino.cc/t/compilation-error-grpc-received-message-larger-than-max-4322345-vs-4194304/1304422
A silly contrived sketch was used in the demo for the sake of simplicity. For an example of a real world sketch that also produces the fault, see:
https://forum.arduino.cc/t/compilation-error-grpc-received-message-larger-than-max-4322345-vs-4194304/1304422/5
Workaround
Save the sketch before compiling.
Issue checklist
The text was updated successfully, but these errors were encountered: