-
-
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
Implement "lib_extra_dirs" option for project environment #537
Comments
PlatformIO, version 2.8.4 |
The I want to mention that in PlatformIO 3.0 the logic with Library Manager will be rewritten from the scratch. By default all libs will be installed in I recommend to take a look on the all lib-related issues for PlatformIO 3.0. https://github.com/platformio/platformio/issues?q=is%3Aopen+milestone%3A3.0.0+label%3Alib The question: will PlatformIO 3.0 resolve your issue? |
The way you explain it, it won't, because my private library is in ../lib and not in ./lib . In my case I need to have :
If I understood well, the first point is not possible in pio 3 , I assume the semver lib dir can be changed so the second point would be. |
How about Currently, we have only 3 locations where LDF looks for libs https://github.com/platformio/platformio/blob/develop/platformio/builder/main.py#L91 Summary:
The order/priority:
|
I'm not very good at python. What I see from ( https://github.com/platformio/platformio/blob/develop/platformio/util.py )
getprojectlib_dir should have its own resolution instead of static lib/, eg def get_projectlib_dir():
return _get_projconf_option_dir(
"inc_dir",
join(get_home_dir(), "lib")
) then this method could return a list of directories ( change the get_projconf_option_dirS to split the option_dir by ',' then map using expanduser) which would be appended the two other lib directories in main.py I'm not very good at python so I don't try to do that right now, but I may give it a try if you can't afford. |
Please don't look into the code. Please read my comment #537 (comment) and give me an answer about this approach in PlatformIO 3.0. I'll not change LDF in PlatformIO 2.0. |
Sorry I didn't get a question in previous comment, so to be constructive I looked at your link which actually was some code. It took me some time and I feel awkward when you tell me to look at code then to not to after I did look at code. Please rephrase your question. I can rephrase my issue if you don't get my point, as it seems we don't understand each other well. My previous comment proposed to modify code in utils.py. It was composed of two successive modifications, the second one being optionnal
Those modifications do not require to modify LDF, furthermore they only ADD functions (the |
@glelouet I've just tried to re-read your #537 (comment).
This is equal to the default value
This is equal to the
If you don't want to put any info into |
You don't understand me, and I'm tired of trying to explain myself. |
Please provide archive with example project |
why ? |
Dear @glelouet,
Let me rephrase:
As I've said above, I don't like current PlatformIO 2.0 scheme with these lib folders. In this case, I propose these options:
*And the last... * You want to have "OWN" PRIVATE INC dirs. No problems. See my #537 (comment). According to it you will have ability to specify OWN EXTRA LIB dirs. You can call them "PRIVATE" or even "SPONGE BOB DIRS". For example, [env:myenv]
platform = ...
board = ...
lib_extra_dirs = /path/to/private/dir1,/path/to/private/dir2,/path/to/sponge/bob/dir Now, please forget about "i want inc_dir" and try to listen what I propose. If you have corrections/comments to my proposition, I'm glad to correct it. P.S: Guys, @FWeinb, @marvinroger, @dave-newson, @furyfire, @oskargargas, @sarfata, @jasonmhite what do you think? |
@glelouet I am pretty sure working on such an important _open-source_ project and getting this kind of answers is tiring too. Just saying. @ivankravets what you propose sounds good and reflected to me 👍 |
@glelouet I'm having trouble reading the original request. If I'm reading you right, you've got two concerns;
Going back to your original requirements (I've fiddled with the names because the terminology is confusing);
My understanding is that the Arduino IDE is an ignorant beast, and it'll only include libs which sit inside
I'm not understanding how this would solve your problem. Using this method it sounds like you would be telling PlatformIO to use/place libs from/in Concerning Arduino IDE compatibility, even if you tell platformio to dump libraries in the You could work around this issue by using symlinks (yay for linux) or in PlatformIO 3 you can fold @ivankravets suggestion of using a I would expect the following to work just fine:
Honestly, I can't see a way to fix compatibility with the Arduino IDE if you keep using the Bear in mind I'm not very familiar with the Arduino IDE because I find it horrible to use. If you know something we don't about how to include libraries, let us know. |
Well, it also has a list of libraries folder to look into.
following this blog ( http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides ) it would. (short : setting the lib_dir to ~/Arduino/Libraries )
I didn't understand the [env:xxx] and it was about platformio 3 . I only had ONE issue with platformio 2 , and this was, that I could not override the ./lib/ as being the SPONGE BOB folder. Maybe the example of code I gave you could help, maybe it was stupid ; but in the end you throw it away and this is rude.
Yes but when I feel like my point is out of the discussion there is no reason for me to try to discuss. I don't want to waste time, nor to waste yours - platformio is good and I'm sure you can enhance it. I unsuscribe, just realized I didn't get nor bring anything good from this. |
@glelouet Why did you close this issue? Please read my comments above. I don't have any objections to resolve this issue but it will be done in PlatformIO 3.0. Also, please read carefully #537 (comment) and I wait for the answer: "Will PlatformIO 3.0 resolve your issue?" according #537 (comment) P.S: You are right, let's save time each other. What is more, all PlatformIO users are equal for me. I mentioned a few PlatformIO users above "not for the help to humble @glelouet", but for the constructive answer as for #537 (comment). I don't know these users, but they are authors/commentors of a few issues related to PlatformIO 3.0 Library Manager. See https://github.com/platformio/platformio/labels/lib As you can see, I don't have aim to "discard all users requests" but quite the contrary I'm grateful them for the comments, ideas and corrections. The only this friendly and politely discussions in our community will help PlatformIO Team to create PlatformIO FOR THE ALL, but not only for @ivankravets. Regards, Ivan. |
@glelouet don't be discouraged, your requests are still valid. The biggest problem with this issue is the terminology and requirements are slightly confusing, so unfortunately you will need to bear with us while we confirm exactly what the issue is, and if it's something PlatformIO can/should resolve.
Thanks for the link, that's very informative about what it is you're trying to accomplish. Unfortunately, I think this still doesn't address the problem of Arduino IDE not being able to see the With that covered, let's ignore the issue of Arduino IDE's terrible library management and address this whole
I think Ivan is really trying to concentrate his efforts on bringing PlatformIO3 into production, as it'll fix a massive range of issues rather than just this one concern, so he's looking for how a feature could be added to PlatformIO3 which will solve this issue, rather than continuing to work on deprecated PlatformIO2 code, which will only be thrown away in the coming months. Unfortunately with OSS, unless you're willing to make your own contributions, it can mean waiting until the authors goals align with yours and also coming to a compromise with them. As an aside, using CLion I achieved the same ability - adding multiple lib dirs in PlatformIO2, by adding the following configs:
and I think I also used:
How do you set this? I Googled for it and I couldn't find anything. ///// Thanks for the clarification. |
That is compiler/preprocessor flag. PlatformIO Library Dependency Finder doesn't handle it. We have 2 different meaning under
As for Arduino IDE & PlatformIO. @glelouet is right, we can share the same folder between PlatformIO & Arduino IDE without problems. The issue here that @glelouet wants to keep "some private" libs between both sides. I hope that PlatformIO 3.0 will help him to achieve it. @glelouet please answer. Thanks. |
I gave up arduino IDE and gave Atom+Platformio a try.
well I wont discuss the variable name, I think separating global and project-specific libs like this is good
Well, I think we should have a separation between platformio Besides those may-be issues, it seems good to me. |
Temporary link to development version of PlatformIO 3.0 docs http://docs.platformio.org/en/feature-platformio-30/projectconf.html#lib-extra-dirs |
this thread got me confused as hell, i have a couple of questions:
note: build_flags = -L didn't work as well |
@mohsh86 PIO3 You can place temporary your own libraries to PIO3 is planned for release tomorrow. |
awesome dude, you rock ! |
* 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
My platformio.ini :
I also have ../lib/mylib/lib.h that is #include in my sources
when I init, platformio downloads the onewire lib and add it to ../lib . However this leads to two issues
lib/*_ID*
)possible solution is to have two environment variables : lib_dir to specify where we PUT the required libs, and inc_dir to specify where are our private library not managed by platformio downloader.
This way, I could set inc_dir to ../lib (or ../lib, ./lib, ../../lib with a list) in my platformio.ini , and set the lib_dir in the cli if modification required (eg using arduino IDE)
The text was updated successfully, but these errors were encountered: