[Opensim-dev] Package manager

Diva Canto diva at metaverseink.com
Sat Dec 27 23:33:37 UTC 2014


Warning: long mail.

On 12/23/2014 3:53 PM, Mic Bowman wrote:
> Figuring out how to make an easily installable opensim package (and 
> package manager) seems like a better use of the time in the long run. 

I still think that the dispatcher should go to core, but let me switch 
to this other issue: package manager.I really need one, so I took some 
time to look at what we already have, and see what's missing.We're much 
closer than I thought.

It looks like the configuration code is already accounting for the 
existence of .ini files under
addon-modules/*/config/*.ini
(This comes from the last line in OpenSimDefaults.ini)

Great.

---

Unfortunately,dlls are still assumed to be all in bin itself, which is 
clumsy when we start using 3rd party modules.There's an easy fix for 
this. Mono addins accounts for the specification of more folders to look 
for dlls [1]. Specifically, if we add a file .addins in bin with this:

<Addins>
      <Directory include-subdirs="true">addon-modules</Directory>
</Addins>

This will make mono addins look for dlls [also] in the addon-modules 
folder and subfolders, which is great for separating core from 3rd party 
code.(It works too, I tested it)

Unfortunately, it doesn't solve the whole thing, and the next point 
subsumes this one.

---

That doesn't solve the whole thing, because many times the region 
modules depend on external libraries that also need to be loaded by the 
.Net runtime. .Net accounts for the specification of additional 
directories under the directory where the .exe is [2]. If we add this in 
OpenSim.exe.config, the assemblies in the privatePath will be loaded:

   <runtime>
     <loadFromRemoteSources enabled="true" />
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <probing privatePath="addon-modules/MyPackage/bin"/>
     </assemblyBinding>
     <gcConcurrent enabled="true" />
     <gcServer enabled="true" />
   </runtime>

Unfortunately, .Net doesn't seem to understand wild cards in the 
<probing> element, so the installation procedure will need to edit this 
<probing> element and add the new directory explicitly to the 
privatePath, with semi-colon in between, which is not very nice. But 
that's Windows philosophy, I guess...

In any case, I tested this, and if we set this privatePath properly, 
both mono addins ans .Net itself will load assemblies from those paths, 
so both the region modules and their dependent dlls will be loaded.

---

Once the assembly path is in place, it will be straightforward to define 
OpenSim packages that are are laid out like this:

MyPackage/
   bin/
     dlls
   config/
     one or more .ini
   resources/
     module-specific stuff can go here

And then the package installer will simply place this package under 
bin/addon-modules as is.

Optionally, packages may include the source code too, so a src 
directory. That one would need to be treated in a special way, and 
placed under ../addon-modules/MyPackage

---

Now, a more difficult problem is versioning, and I don't have any great 
solution for it, other than: if a 3rd-party dll loading crashes your 
opensim, you need to uninstall it and search for a compatible version.

A slightly better approach would be to look for the AssemblyVersion 
information of the 3rd party module, and check that it is the same as 
OpenSim.exe's, and abort the installation when it isn't.

---

Any comments on any of this? I'd like to get started, because I really 
need this.

(There's also packages for Robust, but let's start with packages for the 
simulator, which is already half-way there.)

----
[1] https://github.com/mono/mono-addins/wiki/Add-in-Discovery

[2] http://msdn.microsoft.com/en-us/library/823z9h8w.aspx



More information about the Opensim-dev mailing list