Skip to content

Feature request - Allow additional location for libraries, for libraries under development. #1315

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

Closed
MHotchin opened this issue Jun 15, 2020 · 5 comments
Assignees
Labels
conclusion: resolved Issue was resolved topic: build-process Related to the sketch build process topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@MHotchin
Copy link

Right now, libraries under development need to reside in the 'libraries' folder under the 'sketchbook' location.

This works well enough for initial development, but is problematic for continuing development. For example, I have a local fix in the 'Ethernet' library. If a new official version comes out, then merging the new version with the work in progress is difficult, since the IDE may stomp on the working copy I have. Instead, the merge should come through git and propagated to my machine that way. Essentially, having two entities trying to update the same location using entirely different means is a recipe for disaster.

If in-development libs could reside elsewhere, continuing development would be much easier. I envision:

  • A new folder that is seached during the build process. Perhaps a message during build that in-development libs are being used.
  • the IDE never updates libs in this location.
  • It is of lower priority than the one in the sketchbook, ie the library manager version would need to be removed before the in-development version was used.
  • As an 'advanced' feature, no need to make IDE UI changes - document it in the library development web pages.
@per1234 per1234 transferred this issue from arduino/Arduino Jun 12, 2021
@silvanocerza
Copy link
Contributor

With the arduino-cli you can specify additional libraries folders or specify a path to a library when running the compile command.

The --libraries flag expects a path to a folder containing multiple libraries, much like the <sketchbook>/libraries folder does.
Assume we have two libraries in these paths:

/home/user/workspace/libraries/WiFi101
/home/user/workspace/libraries/AudioZero

The --libraries flag must be used like so:

arduino-cli compile -b arduino:avr:uno --libraries /home/user/workspace/libraries /path/to/MySketch

Instead the --library flag expects a path to the root folder of a single library, so it must be used like so:

arduino-cli compile -b arduino:avr:uno --library /home/user/workspace/libraries/WiFi101 --library /home/user/workspace/libraries/AudioZero /path/to/MySketch

The library set with --library gets top priority if there is another with an identical name.

There is more information in PR #1258.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Mar 31, 2022
@per1234
Copy link
Contributor

per1234 commented Mar 31, 2022

There is a similar request at #1257

However, this request is different in that the other is about supporting organization of libraries into arbitrary folder structures, which would be searched recursively during library discovery but not be an intentional factor in resolution priority. In this case, it would be a folder of a specific name which is given special treatment in terms of lib install and dependency resolution.

@umbynos umbynos added the topic: build-process Related to the sketch build process label Oct 20, 2022
@umbynos
Copy link
Contributor

umbynos commented Oct 20, 2022

Hi @MHotchin can we consider this solved using this trick?

@umbynos umbynos added status: waiting for information More information must be provided before work can proceed help wanted Assistance from the community is especially welcome labels Oct 20, 2022
@MHotchin
Copy link
Author

Hi @MHotchin can we consider this solved using this trick?

It addresses the problem for command line users, but doesn't appear to help IDE users.

I'll leave it to you to decide if the IDE needs to be supported, and if you decide not, then close the issue.

@umbynos
Copy link
Contributor

umbynos commented Oct 21, 2022

Thanks! I'll close this one then since this is not strictly related to the CLI. Feel free to open a feature request in the Arduino IDE repository

@umbynos umbynos closed this as completed Oct 21, 2022
@per1234 per1234 added conclusion: resolved Issue was resolved and removed status: waiting for information More information must be provided before work can proceed help wanted Assistance from the community is especially welcome labels Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: build-process Related to the sketch build process topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

4 participants