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 specific version of a library #413

Closed
FWeinb opened this issue Dec 29, 2015 · 11 comments
Closed

Depend on a specific version of a library #413

FWeinb opened this issue Dec 29, 2015 · 11 comments
Labels
feature LDF Library Dependency Finder
Milestone

Comments

@FWeinb
Copy link

FWeinb commented Dec 29, 2015

Resolved


This is probably related to #410. To support reproducible builds and work on projects that depend on the same library but a different version it would be best to support a way of installing library with the Project and not as a global package of platformio. To get this working one has to define a version range in addition to the library in lib_install.

@ivankravets ivankravets modified the milestone: 3.0.0 Dec 29, 2015
@ivankravets ivankravets added LDF Library Dependency Finder feature and removed feature labels Dec 29, 2015
@ivankravets ivankravets mentioned this issue Jan 1, 2016
37 tasks
@ivankravets
Copy link
Member

ivankravets commented Jan 3, 2016

TODO: add new lib_deps field to platformio.ini with the next format:

lib_deps = 
    %LIB_NAME%@%semiver1%,%semiver2%,%semiverN%
    id=%LIB_ID%@%semiver1%,%semiver2%,%semiverN%
    https://github.com/author/project.git
    https://github.com/author/project.git@tag
    https://github.com/author/project.git@commit

For example,

lib_deps = 
    Json@^1.0.0
    id=64@>=1.0.0,<2.0.0,!=1.5.7
    https://github.com/gioblu/PJON.git
    https://github.com/gioblu/[email protected]

@marvinroger, @FWeinb WDYT?

@ivankravets
Copy link
Member

Currently all libs will be installed in http://docs.platformio.org/en/latest/projectconf.html#lib-dir. What I should do when 2 projects require the same libs with different lib_requires? Is it good idea to install required libraries directly to project's lib folder?

@marvinroger
Copy link

lib_requires should be spelled lib_require, as we currently have lib_use and lib_ignore without the leading s. So lib_install will be deprecated/removed? Otherwise It would sounds redundant.
And I would remove the commas, just Json: >=1.0.0 <2.0.0 !=1.5.7 as this is more common and standard.

Maybe you could store libs by library and version. I mean:

* Json
    * 1.0.0
        * src...
    * 2.0.0
        * src...

What's the benefit of storing the library in the project folder? I can't find any. But storing it globally avoids to download multiple copies of the same library (ArduinoJson for example will probably be used in multiple projects).

@marvinroger
Copy link

Plus, we would have to .gitignore the lib folder if we use Git. I'd stay on the global install.

@ivankravets
Copy link
Member

lib_requires should be spelled lib_require, as we currently have lib_use and lib_ignore without the leading s. So lib_install will be deprecated/removed? Otherwise It would sounds redundant.
And I would remove the commas, just Json: >=1.0.0 <2.0.0 !=1.5.7 as this is more common and standard.

Done! #413 (comment)

Maybe you could store libs by library and version. I mean:

npm uses this scheme. Oh... How much work need to do with it. Yes, this scheme is the best from all views. Because project's lib was intended for private/specific libraries

@andig
Copy link

andig commented Jul 12, 2016

Please make sure to add ability for requiring dev versions as well (both for libraries and platforms ;)

@ivankravets
Copy link
Member

Please re-test the latest development version.

Docs: http://docs.platformio.org/en/latest/projectconf.html#lib-deps

@andig
Copy link

andig commented Aug 8, 2016

I'm a little bit lost as to how lib_deps works with lib_install. Is lib_install obsolete now? Also, how is it possible to specify dev version for known libraries (e.g. ESPAsyncTCP@dev)?

Some more details for the docs would be highly appreciated.

@ivankravets
Copy link
Member

ivankravets commented Aug 8, 2016

I'll write "Migration" section in the docs later.

Is lib_install obsolete now?

lib_install is obsolete and is equal to lib_deps but need to specify ID per new line. For example,

lib_install = 1, 2, 3
lib_deps = 
    1
    2
    3


# or even
lib_deps = 
    id=1
    id=2
    id=3

Also, how is it possible to specify dev version for known libraries (e.g. ESPAsyncTCP@dev)?

The short version for GitHub repo is

lib_deps =  me-no-dev/ESPAsyncTCP

@andig
Copy link

andig commented Aug 8, 2016

Really off-topic now, but is it also possible to use dev version of a platform (use case is espressif here)?

@ivankravets
Copy link
Member

The same is with development platforms. They are moved to separate repositories. See https://github.com/platformio/platform-espressif

pio platform install https://github.com/platformio/platform-espressif.git

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