Skip to content
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

Depend on a library using GitHub URL #498

Closed
probonopd opened this issue Feb 6, 2016 · 4 comments
Closed

Depend on a library using GitHub URL #498

probonopd opened this issue Feb 6, 2016 · 4 comments
Assignees
Labels
feature LDF Library Dependency Finder
Milestone

Comments

@probonopd
Copy link

Wouldn't it be nice if we could
#include "https://raw.githubusercontent.com/Makuna/NeoPixelBus/814a4f0250d408b6f0b7252537352ce0b93e4b3d/src/NeoPixelBus.h"?

Golang seems to work somewhat like this, iirc.

The result would be painless dependency management:

  • Can reference any specific commit of any library on GitHub - even feature branches and development versions
  • Do not need to wait for libraries to be "included" or "submitted" to any central repository

Rough idea of how to implement:
At compile time, platformio would have to download the URLs and any files referenced therein, place them into .pioenvs, and replace the URL include statement with one that would reference the downloaded local file.

@loopj
Copy link

loopj commented Feb 28, 2016

This would effectively require code parsing and rewriting, which seems a little funky in c/c++ land. Go already has this concept built in to the language.

Having github urls in the code would make for very unportable code, and would tightly bind code to platformio's build system.

Just my 2c.

@gerritv
Copy link

gerritv commented Feb 28, 2016

You assume that everything is connected to the internet all the time, not something you should count on. Also any notion of repeatable builds goes out the door. No serious development organization would use this. There is no Change Management (those parts of your code can change at the other parties whim while you are building),non repeatable builds, no sane possibility of source code control.

Plus not to mention that you expect platformio to parse your entire source code looking for #include lines (possibly inside #ifdef's!) before calling the compiler.

@probonopd
Copy link
Author

Also any notion of repeatable builds goes out the door.

Not if you include a specific SHA-1 hash

@ivankravets ivankravets added this to the 3.0.0 milestone Jul 16, 2016
@ivankravets ivankravets self-assigned this Jul 16, 2016
@ivankravets ivankravets added the LDF Library Dependency Finder label Jul 16, 2016
@ivankravets
Copy link
Member

The parse source code and replace with real includes will bring a lot of problems to the different parts of PlatformIO. The integration with IDEs will not works. Code completion and code linting services will raise a lot of errors.

In any case, I'll allow defining of "dependency" as "git" URL.

@ivankravets ivankravets changed the title Include library dependencies using their GitHub URLs Depend on a library using GitHub URL Jul 16, 2016
@ivankravets ivankravets mentioned this issue Jul 16, 2016
37 tasks
ivankravets added a commit that referenced this issue Sep 9, 2016
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature LDF Library Dependency Finder
Projects
None yet
Development

No branches or pull requests

4 participants