Depend on a specific version of a library #413

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

Comments

Projects
None yet
4 participants
@FWeinb

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 lib feature and removed feature labels Dec 29, 2015

@ivankravets ivankravets referenced this issue Jan 1, 2016

Closed

PlatformIO 3.0 Roadmap #423

28 of 37 tasks complete
@ivankravets

This comment has been minimized.

Show comment
Hide comment
@ivankravets

ivankravets Jan 3, 2016

Member

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/PJON.git@v2.0

@marvinroger, @FWeinb WDYT?

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/PJON.git@v2.0

@marvinroger, @FWeinb WDYT?

@ivankravets

This comment has been minimized.

Show comment
Hide comment
@ivankravets

ivankravets Jan 3, 2016

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?

Member

ivankravets commented Jan 3, 2016

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

This comment has been minimized.

Show comment
Hide comment
@marvinroger

marvinroger Jan 4, 2016

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).

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

This comment has been minimized.

Show comment
Hide comment
@marvinroger

marvinroger Jan 4, 2016

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

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

@ivankravets

This comment has been minimized.

Show comment
Hide comment
@ivankravets

ivankravets Jan 4, 2016

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

Member

ivankravets commented Jan 4, 2016

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

This comment has been minimized.

Show comment
Hide comment
@andig

andig Jul 12, 2016

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

andig commented Jul 12, 2016

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

@ivankravets

This comment has been minimized.

Show comment
Hide comment
@ivankravets

ivankravets Aug 8, 2016

Member

Please re-test the latest development version.

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

Member

ivankravets commented Aug 8, 2016

Please re-test the latest development version.

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

@andig

This comment has been minimized.

Show comment
Hide comment
@andig

andig 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.

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

This comment has been minimized.

Show comment
Hide comment
@ivankravets

ivankravets Aug 8, 2016

Member

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
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

This comment has been minimized.

Show comment
Hide comment
@andig

andig Aug 8, 2016

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

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

This comment has been minimized.

Show comment
Hide comment
@ivankravets

ivankravets Aug 8, 2016

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
Member

ivankravets commented Aug 8, 2016

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

Merge branch 'develop' into feature/unicode-issue-771
* 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