-
-
Notifications
You must be signed in to change notification settings - Fork 429
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
634d074 to
cdd7f4e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2930 +/- ##
==========================================
+ Coverage 67.91% 67.96% +0.05%
==========================================
Files 238 238
Lines 22489 22524 +35
==========================================
+ Hits 15273 15309 +36
+ Misses 6017 6013 -4
- Partials 1199 1202 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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 a sketch.yaml with also relative lib.
1d46837 to
0bd806e
Compare
|
This is amazing! I will finally be able to get rid of my various hacky uses of |
|
@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 Feedbacks are always welcomed 🤓 |
0bd806e to
1589119
Compare
|
I cannot get this to work. I'm trying to share some code between two sketches. I have this sketch file: default_fqbn: esp32:esp32:esp32s3:CDCOnBoot=cdc
profiles:
main:
port: /dev/ttyACM1
platforms:
- platform: esp32:esp32 (3.2.0)
libraries:
- Adafruit BusIO (1.17.2)
- Adafruit GFX Library (1.12.1)
- Adafruit ST7735 and ST7789 Library (1.11.0)
- ESP32Encoder (0.11.7)
- NimBLE-Arduino (2.3.2)
- OneButton (2.6.1)
- dir: ../commonWith this file structure: Inside #include "fs.h"Compiler throws an error: When I run with the |
|
It should probably be generating an error, but I suspect your problem is that the library directory can't just include files, it has to be a proper library in the newer format with a |
|
I actually tried exactly that. Code in the I also passed a non-existent directory in the |
Ok, file a bug and we can debug there instead of commenting on the PR? Ideally include a zip file (or github pointer) for a directory layout that reproduces the issue? |
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.mdhas been updated with a migration guide (for breaking changes)configuration.schema.jsonupdated 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 string
dir:.It also provides this information in
compile --dump-profileWhat 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:
What is the new behavior?
A library installed in the filesystem could be specified as well:
In this case the two libraries:
libraries/MyLib/path/to/library/MyLibOutsideTheSketchwill be included during the compilation. In particular, a relative path refers to a path relative to the sketch path, in this case
libraries/MyLibis to be intended asSKETCHPATH/libaries/MyLib.Does this PR introduce a breaking change, and is titled accordingly?
No
Other information