Skip to content

fix: Arduino Preprocess should always run if the target file is missing#3149

Merged
cmaglie merged 5 commits into
arduino:masterfrom
cmaglie:fix-compile-glitch
Apr 10, 2026
Merged

fix: Arduino Preprocess should always run if the target file is missing#3149
cmaglie merged 5 commits into
arduino:masterfrom
cmaglie:fix-compile-glitch

Conversation

@cmaglie

@cmaglie cmaglie commented Apr 1, 2026

Copy link
Copy Markdown
Member

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

This is a regression introduced in #3112, but not yet released.

What is the current behavior?

If an error occurs during Arduino preprocessing, the preprocessed sketch is not generated, and the error is displayed.

By the way, if another compile happens immediately without changing the sketch, the Arduino Preprocessing is skipped because the sketch is "unchanged." As a result, the previously displayed error is no longer shown, and the compile continues, leading to another unrelated error (probably "missing setup" or "missing loop" because the preprocessed sketch hasn't been generated).

What is the new behavior?

If the preprocessed sketch hasn't been created, the Arduino Preprocessor is always executed, even if the sketch is unchanged.

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

Other information

@cmaglie cmaglie self-assigned this Apr 1, 2026
@cmaglie cmaglie added type: imperfection Perceived defect in any part of project topic: build-process Related to the sketch build process labels Apr 1, 2026
@cmaglie cmaglie requested review from a team and giulio93 April 1, 2026 14:54
@codecov

codecov Bot commented Apr 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.38%. Comparing base (da1d3eb) to head (e1b5cb9).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...rnal/arduino/builder/internal/detector/detector.go 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3149      +/-   ##
==========================================
+ Coverage   69.36%   69.38%   +0.02%     
==========================================
  Files         252      252              
  Lines       19422    19505      +83     
==========================================
+ Hits        13472    13534      +62     
- Misses       4706     4714       +8     
- Partials     1244     1257      +13     
Flag Coverage Δ
unit 69.38% <84.61%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@cmaglie cmaglie force-pushed the fix-compile-glitch branch from 7116ba3 to 77f88a2 Compare April 2, 2026 10:48
@cmaglie cmaglie force-pushed the fix-compile-glitch branch from ce8e048 to e1b5cb9 Compare April 10, 2026 10:35
@cmaglie cmaglie merged commit 5391989 into arduino:master Apr 10, 2026
101 checks passed
@cmaglie cmaglie deleted the fix-compile-glitch branch April 10, 2026 10:53
@per1234 per1234 added the topic: code Related to content of the project itself label Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: build-process Related to the sketch build process topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

3 participants