Skip to content

[breaking] Fix regression in core caching #2145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 12, 2023

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Apr 12, 2023

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?

Fix a regression in compiled core caching. A wrong precompiled core may be selected if build options are changed.

What is the current behavior?

The same "cached" core is wrongly used:

$ arduino-cli compile -b arduino:avr:mega -v | grep -i precompiled
Using precompiled core: /tmp/arduino/cores/arduino_avr_mega_f702e3425f7b051e4211596c91e0b47a/core.a
$ arduino-cli compile -b arduino:avr:mega:cpu=atmega1280 -v | grep -i precompiled
Using precompiled core: /tmp/arduino/cores/arduino_avr_mega_f702e3425f7b051e4211596c91e0b47a/core.a

What is the new behavior?

$ arduino-cli compile -b arduino:avr:mega -v | grep -i precompiled
Using precompiled core: /tmp/arduino/cores/arduino_avr_mega_f702e3425f7b051e4211596c91e0b47a/core.a
$ arduino-cli compile -b arduino:avr:mega:cpu=atmega1280 -v | grep -i precompiled
Using precompiled core: /tmp/arduino/cores/arduino_avr_mega_cpu_atmega1280_f702e3425f7b051e4211596c91e0b47a/core.a

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

There is a change in the golang API, no visible change for users.

Other information

Fix: https://github.com/arduino/arduino-ide/issues/1990

See also:
https://forum.arduino.cc/t/teensy-compile-sketch-fails-clear-out-temp-build-completes/1110104/6
https://forum.pjrc.com/threads/72572-Teensyduino-1-59-Beta-2?p=324071&viewfull=1#post324071

@cmaglie cmaglie added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Apr 12, 2023
@cmaglie cmaglie self-assigned this Apr 12, 2023
@cmaglie cmaglie requested a review from umbynos April 12, 2023 08:54
@cmaglie cmaglie requested a review from per1234 April 12, 2023 09:11
@codecov
Copy link

codecov bot commented Apr 12, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 🎉

Comparison is base (ea066cc) 62.57% compared to head (474ffac) 62.59%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2145      +/-   ##
==========================================
+ Coverage   62.57%   62.59%   +0.02%     
==========================================
  Files         227      227              
  Lines       19538    19540       +2     
==========================================
+ Hits        12225    12231       +6     
+ Misses       6216     6213       -3     
+ Partials     1097     1096       -1     
Flag Coverage Δ
unit 62.59% <100.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
arduino/cores/board.go 93.65% <100.00%> (ø)
arduino/cores/packagemanager/package_manager.go 74.71% <100.00%> (ø)
legacy/builder/phases/core_builder.go 74.28% <100.00%> (+4.38%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@cmaglie cmaglie merged commit 042f76a into arduino:master Apr 12, 2023
@cmaglie cmaglie deleted the fix_regression_core_caching branch April 12, 2023 09:33
cmaglie added a commit that referenced this pull request Apr 12, 2023
* Added integration test

* Removing useless constants

* Fixed regression in core caching

* Updated tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Caching of core build may get out of sync when doing multiple windows causing build to fail.
2 participants