-
-
Notifications
You must be signed in to change notification settings - Fork 795
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
Allow library.json to specify sources other than PlatformIO's Repository #461
Comments
On top of that please allow checkout of specific version based on git (or other vcs) tag or commit hash. |
@oskargargas Of course, I'll implement it. |
The design specs for PHP's composer should apply directly to platformio. What about resolving dependecies? Can package A require package B which will also be automatically installed and updated? |
Thanks! See #475
These features are partially implemented in the PlatformIO 2.0. However, this functionality will be rewritten from the scratch in PlatformIO 3.0. See https://github.com/platformio/platformio/issues?utf8=✓&q=is%3Aopen+milestone%3A3.0.0+label%3Alib |
👍 |
1 similar comment
👍 |
* develop: Fix incorrect line order when converting from INO to CPP and pointer is used Fix unit test Notify about `version` field when creating library Add support for SparkFun Blynk Board Return valid exit code from ``plaformio test`` command Disable SSL Server-Name-Indication for Python < 2.7.9 Version bump to 3.0.1 (issue #772) Disable temporary SSL for PlatformIO services // Resolve #772 Version bump to 3.0.0 (issues #770, #766, #747, #730, #765, #640, #659, #742, #459, #542, #763, #759, #753, #757, #749, #748, #745, #519, #709, #743, #413, #498, #410, #740, #361, #414, #554, #732, #588, #475, #461, #101, #719, #721, #537, #415, #522, #289, #556, #570, #456, #617, #432, #408, #479, #667, #510) Fix menu height for docs Fix issue with multiple archives when linking firmware Add migration guide for PIO2 to PIO3 Search libraries by headers/includes with ``platformio lib search --header`` option Update pio run command examples Add Unit Testing Demo Update PIO Plus badge title and link Add PlatformIO Plus badge Add links to PlatformIO Plus
I stumbled upon this issue because I'm trying to accomplish the exact same thing as @dave-newson, but I can't manage to get it working. I'm trying to have a My structure looks like this (I've heavily simplified it for the sake of clarity):
I need the I can't get it to work. When I specify I've considered several other solutions:
Am I missing something? I think it should be possible to make platformio download the library for me based on a local manifest, right? |
http://docs.platformio.org/en/latest/projectconf/section_env_library.html#lib-compat-mode |
When I remove that line, LDF still does not find it 😢. And I actually want to use the compatibility feature of the LDF, because I have different environments in my
|
What does mean framework=native in library.json? Do you mean platform=native? Anyway, could you provide a simple project to reproduce this issue? |
You are right, it should have been I attached a simple project to reproduce the issue. When I run it, compilation fails because including |
@danielschenk how can LDF find a library if there is no #include <RtMidi.h>? |
@ivankravets The include statement is there, in If you're talking about the actual header file If it is not possible what I want, then we unfortunately misunderstood each other. |
Sure, I don't understand your problem but I'm glad to help. Please create PlatformIO project which does not work but has source files. I'll try to debug it. |
The source file is already there, in the example I uploaded. It's I can imagine that LDF doesn't know that it needs to download RtMidi from GitHub because it doesn't know that {
"name": "rtmidi",
"repository": {
"type": "git",
"url": "https://github.com/thestk/rtmidi.git",
"branch": "v3.0.0"
},
"frameworks": "native",
"build": {
"extraScript": "rtmidi.py"
},
"headers": [
"RtMidi.h"
]
} |
This already implemented. There 2 options in your case:
|
Thanks, I could not find option 2 in the documentation. I will try it out later today :) Will it still make use of my local |
Yes, it will use See http://docs.platformio.org/en/latest/projectconf/section_env_library.html#projectconf-lib-deps |
That's still not exactly what I want. I want to use the original RtMidi from GitHub, but I want I attached a new example to make this clear. When I run it, it tries to build a library directly (with no files) and therefore stops with an error. Instead, I expect it to:
|
LDF depends on
|
The Problem
If I want to use a
library.json
to manage my projects 3rd party dependencies, then these 3rd party libraries;Desired Functionality
Let's assume that, in a perfect world:
library.json
manages all the third party dependencies in my project.platformio update
all dependencies are fulfilled.The desire is to eliminate the need to manual checkouts, clones, code downloads, etc. In 90% of common use cases I want to just run
platformio update
and have all the magic taken care of.Use Case 1 - I want to use a library which isn't on the PlatformIO repository
There are always going to be cases where I want to include a library in my code but the libraries author has not included a
library.json
file in their source.This may be because:
Frankly, and this is the important bit; Who cares? I should not require their consent to perform what is basically
git clone
. The library.json file is a helper for PlatformIOs repository, and not necessary for code to function.The official solution to this problem is "submit a library.json PR to the 3rd party", but come on. That could take weeks to get actioned, and in the mean time I have to manually include the dep. That's hardly a solution.
Use Case 2 - I want to use a specific fork
Say I've followed the standard GitHub approach of forking, branching, creating a change and then PRing it back to the main third party project. That's nice, and I'm a good open-source citizen.
Problem is, this change won't be available in the library via PlatformIO until it gets merged back in, if it gets merged back in.
I could submit my fork up to PlatformIO's repository, so now we have "arduino-stepper-dave-newson", but frankly that's just silly. Do we want people to do that for every hotfix and branch? No, I don't believe we do.
Use Case 3: Source code isn't on VCS at all.
There's also cases where libraries have been put online as .zip files by authors born in the 50s and who still write their documentation in .txt files and put things on .edu domains. These libraries simply may never end up on a VCS like GitHub (licensing, anyone?).
The only way around this right now is a manual install.
Desired Change
This approach is stolen directly from the PHP package manager Composer.
I can specify required dependencies in PlatformIO's
library.json
as follows:Please also allow me to override the libraries source with something akin to:
The
name
property indicates to the PlatformIO executable that I want the dependencyderp
to come from the specified GitHub repository. This way I can use forks and branches of my own.In additional, PlatformIO shouldn't require this repository to contain a
library.json
file. It should just checkout the entire repo wholesale and dump it into my project.Again, stolen from the likes of Composer, a similar approach can be used to drag in zip archives:
Obviously PlatformIO requires its own approach and json structure, but this would enable people to include from any git-based repository or zip archive, without the need for registration with PlatformIO.
This would greatly expand its capabilities and enable faster adoption.
This system could also allow expansion for compatibility with any other VCS like Mercurial or SVN.
The text was updated successfully, but these errors were encountered: