[Gambas-user] Sharing libraries across projects

Tobias Boege taboege at ...626...
Tue Jan 26 06:36:24 CET 2016


On Tue, 26 Jan 2016, Beno??t Minisini wrote:
> Here is a proposal, tell me what you think.
> 
> 1) When you create a project library, you will have to specify a vendor.
> 
> 2) When creating the library executable of a library project, a symbolic 
> link to the executable will be created in 
> '~/.local/share/gambas3/lib/<vendor>'.
> 

Instead of an implicit symbolic link it is more straightforward (and still
easy enough) to have a new button in the Project > Make menu which creates
the executable at the proper place.

> 3) When another project wants to use that library, it stores in its 
> project configuration file the relative path '<vendor>/<library>'. 
> Through the symbolic link created in 2), the true library executable 
> will be found by the IDE and by the project at runtime.
> 
> 4) When creating a package of a library, the library executable will be 
> installed in '/usr/lib/gambas3/<vendor>' ('/usr/lib/gambas3' is for 
> components). Maybe '/usr/share/gambas3/lib/<vendor>' should be better, 
> to mimic 2). After all, Gambas libraries are not to be run, and are not 
> system shared libraries.
> 
> 5) When running a project using a library outside of the IDE (i.e. not 
> in debugging mode), the project will search its libraries in 
> '/usr/lib/gambas3' (or maybe '/usr/share/gambas3/lib'). Never in 
> '~/.local/share/gambas3/lib' for security reasons. Tell me if I am 
> paranoid here.
> 

I don't know. I don't want everyone to check their ~/.local/share/gambas3/lib
before starting any project in the future, but in the end my need is to use a
custom library from some executables.

> 6) A project can use a library whose only the executable is installed. 
> The IDE must present the user everything it finds in 
> '~/.local/share/gambas3/lib' and '/usr/lib/gambas3' sub-directories when 
> selecting a library. It will search the '<vendor>/<library>' stored in 
> the project configuration file first in '~/.local/share/gambas3/lib', 
> then in '/usr/lib/gambas3'.
> 
> 7) Backward-compatibility. If a project library has no vendor, then the 
> old behaviour will be retained:
> - No symbolic link is created.
> - The project using it stores its absolute path.
> - When creating a package, the library executable is stored in the same 
> place as normal executables.
> - When the project runs outside of the IDE, the library is searched in 
> '/bin' and '/usr/bin' only.
> 
> I'd like all that stuff as simple as possible. If you can simplify it 
> and keep all the features we need, just tell me!
> 

T Lee Davidson has a point. As I am now aware, for all I care the library
search path does not need to be user-specific. If there is a button in the
IDE which:

  - asks for the sudo / su password and
  - copies the executable to /usr/local/lib/gambas3/<vendor>/

that would be alright. The interpreter should be able to trust libraries
under /usr/local/lib and load them even when not debugging.

If asking for root-enabling passwords in the IDE is not a good idea (I would
understand that), a button to run a Makefile would even be enough :-) But
this is would be far removed from a self-contained solution...

Points 1, 3, 4, 6 and 7 are fine, modulo details about the path.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the User mailing list