Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Auto-import libraries based on sketch profile.#2951

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@cmaglie
Copy link
Member

Please check if the PR fulfills these requirements

Seehow to contribute

  • The PR has no duplicates (please search among thePull 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 PR changes the way libraries are imported when using sketch profiles.

What is the current behavior?

The libraries specified on profiles are "loaded" in the global state. Still, they are imported and compiled only if referenced by the sketch (or indirectly by a library imported from the sketch) after the so-called "library discovery".

What is the new behavior?

The libraries specified on profiles are always imported and compiled, even if not referenced directly or indirectly by the sketch.
This reduces the number of "library discovery" passes and slightly improves compilation times. Still, the main part of the library discovery phase remains.

Does this PR introduce a breaking change, and istitled accordingly?

It might introduce a breaking change. For example, if a library is listed in a sketch profile but not used in the sketch, after this update, the library will still be compiled, leading to a compilation failure.

Other information

This change is preparatory for next refactorings
This equivalent change moves the 'first' variable closer to his definition and use.
it will be useful in the next commits.
…profile.This will improve sketch compile time.
This avoid cache invalidation if recompiled.
@cmagliecmaglie self-assigned thisJul 11, 2025
@cmagliecmaglie added type: enhancementProposed improvement topic: build-processRelated to the sketch build process labelsJul 11, 2025
@per1234per1234 added the topic: codeRelated to content of the project itself labelJul 11, 2025
@codecov
Copy link

codecovbot commentedJul 11, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is69.44444% with66 lines in your changes missing coverage. Please review.

Project coverage is 67.99%. Comparing base(3db4ad8) to head(07d9452).
Report is 3 commits behind head on master.

Files with missing linesPatch %Lines
...nternal/arduino/builder/internal/detector/cache.go70.31%14 Missing and 5 partials⚠️
...lder/internal/preprocessor/arduino_preprocessor.go0.00%16 Missing⚠️
...rnal/arduino/builder/internal/detector/detector.go83.63%5 Missing and 4 partials⚠️
...nal/arduino/builder/internal/preprocessor/ctags.go45.45%6 Missing⚠️
...l/arduino/builder/internal/detector/source_file.go88.63%3 Missing and 2 partials⚠️
internal/arduino/libraries/libraries_location.go44.44%5 Missing⚠️
...ernal/arduino/builder/internal/preprocessor/gcc.go33.33%4 Missing⚠️
commands/service_compile.go50.00%1 Missing and 1 partial⚠️
Additional details and impacted files
@@            Coverage Diff             @@##           master    #2951      +/-   ##==========================================- Coverage   68.01%   67.99%   -0.03%==========================================  Files         238      239       +1       Lines       22567    22589      +22     ==========================================+ Hits        15350    15360      +10- Misses       6015     6025      +10- Partials     1202     1204       +2
FlagCoverage Δ
unit67.99% <69.44%> (-0.03%)⬇️

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.

Copy link
Contributor

@alessio-peruginialessio-perugini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

@cmagliecmaglie merged commitae68728 intoarduino:masterJul 11, 2025
104 checks passed
@cmagliecmaglie deleted the improve_lib_discovery_in_profiles branchJuly 11, 2025 15:44
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@alessio-peruginialessio-peruginialessio-perugini approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

@cmagliecmaglie

Labels

topic: build-processRelated to the sketch build processtopic: codeRelated to content of the project itselftype: enhancementProposed improvement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@cmaglie@alessio-perugini@per1234

[8]ページ先頭

©2009-2025 Movatter.jp