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

Allow locally installed libraries in sketch profiles.#2930

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

Open
cmaglie wants to merge6 commits intoarduino:master
base:master
Choose a base branch
Loading
fromcmaglie:allow_paths_in_profile_libs

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 change allows us to specify libraries in the sketch profile using a path to a local directory by prefixing the path with the stringdir:.
It also provides this information incompile --dump-profile

What is the current behavior?

Only libraries in the Arduino Libraries Index could be specified in a sketch profile. A typical example may be the following:

profiles:  uno:    fqbn: arduino:avr:uno    platforms:      - platform: arduino:avr (1.8.6)    libraries:      - Adafruit SSD1306 (2.5.13)      - Adafruit GFX Library (1.11.11)      - Adafruit BusIO (1.17.0)

What is the new behavior?

A library installed in the filesystem could be specified as well:

profiles:  uno:    fqbn: arduino:avr:uno    platforms:      - platform: arduino:avr (1.8.6)    libraries:      - dir: libraries/MyLib      - dir: /path/to/library/MyLibOutsideTheSketch       - Adafruit SSD1306 (2.5.13)      - Adafruit GFX Library (1.11.11)      - Adafruit BusIO (1.17.0)

In this case the two libraries:

  • libraries/MyLib
  • /path/to/library/MyLibOutsideTheSketch
    will be included during the compilation. In particular, a relative path refers to a path relative to the sketch path, in this caselibraries/MyLib is to be intended asSKETCHPATH/libaries/MyLib.

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

No

Other information

@cmagliecmaglie self-assigned thisJun 10, 2025
@cmagliecmaglie added type: enhancementProposed improvement topic: build-processRelated to the sketch build process labelsJun 10, 2025
@cmagliecmaglieforce-pushed theallow_paths_in_profile_libs branch from634d074 tocdd7f4eCompareJune 10, 2025 14:50
@cmagliecmaglie requested a review froma teamJune 10, 2025 15:11
@codecovCodecov
Copy link

codecovbot commentedJun 10, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is65.95745% with16 lines in your changes missing coverage. Please review.

Project coverage is 67.88%. Comparing base(2947cfb) to head(0bd806e).

Files with missing linesPatch %Lines
internal/arduino/sketch/profiles.go45.00%6 Missing and 5 partials⚠️
commands/instances.go68.75%4 Missing and 1 partial⚠️
Additional details and impacted files
@@            Coverage Diff             @@##           master    #2930      +/-   ##==========================================+ Coverage   67.84%   67.88%   +0.04%==========================================  Files         238      238                Lines       22442    22477      +35     ==========================================+ Hits        15226    15259      +33+ Misses       6014     6012       -2- Partials     1202     1206       +4
FlagCoverage Δ
unit67.88% <65.95%> (+0.04%)⬆️

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.

The implementation looks good, I'd just add a test to assert the compilation given asketch.yaml with also relative lib.

@cmagliecmaglie linked an issueJun 11, 2025 that may beclosed by this pull request
3 tasks
@cmagliecmaglieforce-pushed theallow_paths_in_profile_libs branch from1d46837 to0bd806eCompareJune 11, 2025 13:55
@egnor
Copy link

This is amazing! I will finally be able to get rid of my various hacky uses ofsrc/ directory symlinks!

@alessio-perugini
Copy link
Contributor

alessio-perugini commentedJun 13, 2025
edited
Loading

@egnor 😄 If you want to give it a try, before we merge this, you can find the test binaries here:https://github.com/arduino/arduino-cli/actions/runs/15586877233
Or you can git-checkout this PR, and rungo build .

Feedbacks are always welcomed 🤓

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@alessio-peruginialessio-peruginialessio-perugini approved these changes

Assignees

@cmagliecmaglie

Labels
topic: build-processRelated to the sketch build processtype: enhancementProposed improvement
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Support for custom libraries when usingsketch.yaml
3 participants
@cmaglie@egnor@alessio-perugini

[8]ページ先頭

©2009-2025 Movatter.jp