ctags: filterSketchSource: enlarge buffer size to handle long lines by facchinm · Pull Request #2935 · arduino/arduino-cli (original) (raw)

Fixes arduino/ArduinoCore-zephyr#140

Please check if the PR fulfills these requirements

See how to contribute

What kind of change does this PR introduce?

When parsing the preprocessed file, only the lines relevant for the sketch are preserved.
However, golang's scanner fails if a line is too long for its buffer.
Overcome the issue by adding a 1MB buffer (extremely conservative) and a non-fatal error message in case it's still not enough.

What is the current behavior?

Compiling any sketch from https://github.com/arduino/ArduinoCore-zephyr fails to create prototypes due to analogPins macro, which expands into a ~90K characters line

What is the new behavior?

The prototypes are created correctly

Does this PR introduce a breaking change, and is titled accordingly?

No breaking change

Other information