-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Support multiple version of a given library #4065
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
Comments
How is user supposed to choose which library version to use? |
Apparently, you missed the point: where and what the user clicks when something goes bad? |
Then you could search via library manager for an old version (because you saved the url before) But if you saved both versions you can have multiple sketches work with multiple versions of a library. This makes it easier to provide dev versions. Then the user dont have to fix on a very old library version, because his main project requires it and his "try and error debug" sketch want to try out new features. |
I have yet to encounter a situation where this kind of start leads to productive outcomes.. but let's try. The first post was leaving some details out... let me retrace my steps, trying to be more specific. Everything hinges on retroffiting the UI with 2 new internal properties. I only explicitly referred one, but the 'dependencies.txt' snippet I pasted shows lets you infer the existence of the second one. I was and still am of the opinion that these should be accessible with new config panel entries. These are the settings in question (they are represented as check boxes for simplicity, but they could as well be drop-downs):
These setting drive how the IDE handles the scenario you described. In the absence of sketch specific instructions:
This is for the very bare minimum support... minimum workload to implement, low level of commitment for the future, and quite extensible. Then we get into the more elaborate support for the feature. The global behavior is now customizable per sketch via entries in dependencies.txt. Again here, a minimum first step is to simply have the same properties (see my first snippet) configured manually, nothing else... However extended capabilities can be provided by storing a version number requirement for the libs. This level of feature coverage can still be done with minimal work in the IDE as well as in the arduino-builder. The next level of functionality is where the more benefits come for users, with
Again trying to keep the implementation workload light, my snapshot hints at a very simply initial approach that would treat dependencies.txt like I am currently treating keywords.txt and library.properties when editing the code for a library: a simple text editor tab with some sanity checking to prevent silly situations. This capability relies on code I wrote that makes it simple to specialize Editor.java based on the nature of the file being edited (I shared some of that today on a different issue and was thinking about sharing the rest via PR). To be exhaustive on this last topic, I believe there is a case to be made for externalizing the capability to alter the editor behavior in the form of JavaScript code, the idea being that it would be easier to perform some small changes if there is no need to recompile the entire IDE, not to mention that users could do it themselves (I will try it out soon). Hope this is clearer. |
No matter what, this is just a suggestion for how to support multiple versions. I do not think it is the only way to do so, but they are a compromise, and IMHO not the worst possible choice. Another alternative could be to have a 'link' (either a real symlink or something like the .url files on windows) that 'points' to the 'active' version of a lib (managed manually or in lib mgr). Another alternative is to name the folders Adafruit_NeoPixel-1.0.3, Adafruit_NeoPixel-1.0.5 directly, and keep the straight Adafruit_NeoPixel name for the currently active lib. Yet another way would be following the OSX scheme. Regardless of how, IMHO side-by-side versions of the same lib is useful. After all .NET, Un*x, OSX, ... all support it. I was just trying to share some idea for providing user value at the lowest implementation cost (ergo soon). |
You're too focused on making the implementation simple and are missing the most important goal: provide a tool that is easy to use for novices. Indeed, allowing multiple versions of libraries, making the IDE guess which one to use automagically, add yet-another checkbox for trying to control its behaviour, all this makes it harder to use it |
I love your enthusiasm @lmihalkovic but I think you're using it wrong. Please think about final users instead of which java file to edit. |
Looking at some of the things you have done and some of the many complaints you have closed in the past from other users, it is almost comical to read this
Reminds me of what happens in declining empires when successive generations inherit things too big for their shoulders. |
linked to
|
I too think this is necessary. For ideas or insperation, look at how npm supports multiple versions of packages, or how nuget does it. |
The thought here is for LIB MANAGER to allow several version of a given library and let users choose when they want to move their code up/down.
At the moment libraries are stored in something like this
Supporting something like the following would allow different versions to coexist together without forcing all user sketches to share a single version
#4064 has more info
The text was updated successfully, but these errors were encountered: