Skip to content

Auto-import libraries based on sketch profile. #2945

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Jul 7, 2025

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 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 is titled 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

cmaglie added 2 commits July 4, 2025 16:03
it will be useful in the next commits.
…profile.

This will improve sketch compile time.
@cmaglie cmaglie self-assigned this Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant