Plugins manifests and config files
Discussion page to better understand how to organize files like plugins ini files, manifests for modules and applications and configuration files.
The idea is to come up wiith a solution that works for the following situations:
- YARP as independent library
- YARP and iCub coexisting together
In addition we support the usual view in which software can be installed or compiled locally.
The plugin system need to fins *.ini files. These files could be in a single or multiple directories.
When YARP is installed, plugins ini files will be installed in a known directory.
When YARP is compiled locally plugins ini files will be in the binary tree (check: binary or source tree).
Other packages i.e. iCub can contribute other plugins. They may be installed in a known location or compiled locally.
Note: not talking about dll or .so, these follow the rules of the os.
From the current yarp tutorial:
YARP is configured to aggregate plugin.ini files in a directory called etc/yarp/plugins. The ini files are collected in this directory irrespective of whether the corresponding plugins are compiled or not. To add plugins not included with YARP, an ini file may be placed in etc/yarp/plugins.
Question: do you need env variables to get this behavior? I would say no but sentence below seems to contradict.
YARP looks for etc/yarp/plugins using a yarp::os::ResourceFinder. If you don't already use configuration files with YARP, one way to get going would be to create a file in your home directory called .yarp/plugins.ini (or yarp\plugins.ini on Windows) containing:
style capability default_capability /path/to/your/yarp/build
and then set a YARP_POLICY environment variable to plugins (matching the name of the ini file you placed in the .yarp/yarp directory).
Problem: isn't this conflicting with the situation in which we set YARP_POLICY to ICUB_ROOT (or anything like that)?
Question: wouldn't it be better if plugins could use a specific policy (i.e. YARP_PLUGINS); in this way there would be no need for setting YARP_POLICY when yarp is installed (assuming this is the case). Other possibilities:
- put plugins ini files in the same directories in which we put configuration files (for YARP and for iCub); each "framework" will have its own set of configuration files and plugins (and maybe manifest), see below.
- add to the policy file (i.e. YARP_POLICY.ini/ICUB_ROOT.ini) a specific entry plugins
We use the ResourceFinder and a policy file. iCub checks:
--> ICUB_ROOT.ini points to /usr/share/iCub or something like that.
--> ICUB_ROOT.ini points to "app" locally.
So far this has been OK to support installations 1) and local compilation 2).
In YARP yarpscope and gyarpmanager/gyarpbuilder need also config files. YARP_POLICY is checked. This allows for YARP users to have their own configuration files. I guess in /etc/YARP_POLICY.ini or $YARP_POLICY/YARP_POLICY.ini.
YARP and iCub can coexist. If YARP_POLICY is equal to an existing environment variable, i.e. ICUB_ROOT then iCub and YARP can share the same config files.
gyarpmanager needs manifest files for modules. At the moment it uses YARP_POLICY to find ymanager.ini; this contains a list of directories to be parsed looking for xml manifest files.
This works. However it is a little different than the other approaches (although it also looks much simpler ;) ).