* dllmap config for a Mono app
@ 2017-06-08 6:41 Craig McQueen
2017-06-08 14:08 ` Joshua Watt
2017-06-08 17:59 ` Khem Raj
0 siblings, 2 replies; 4+ messages in thread
From: Craig McQueen @ 2017-06-08 6:41 UTC (permalink / raw)
To: yocto@yoctoproject.org
I have a Mono app that uses DllImport to load some functions from libraries. The app can't find the libraries unless I create a Mono config file containing dllmap lines to map the library's plain "DLL" name (e.g. "foo") to the real name of the .so file (e.g. "libfoo.so.4").
* What would be a good way in the .bb recipe to automatically create the required Mono config file? It would need to find the "real" names of the library files from the library(s) build output. So it would DEPENDS on the library(s).
* Is it better to create a local config file, or write it into /etc/mono/config? (My Mono app has the DllImports in a compiled DLL, and so far I've found that I need to create a local MyDll.dll.config file; making a MyApp.exe.config file doesn't work.)
* Alternatively, the Mono app can find the libraries if plain libfoo.so symbolic link to libfoo.so.4 exists in the rootfs. But this symbolic link normally is only in the libfoo-dev package, not the libfoo package. Is there some reasonable way to create and install the libfoo.so symbolic links on the rootfs?
--
Craig McQueen
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: dllmap config for a Mono app
2017-06-08 6:41 dllmap config for a Mono app Craig McQueen
@ 2017-06-08 14:08 ` Joshua Watt
2017-06-09 2:35 ` Craig McQueen
2017-06-08 17:59 ` Khem Raj
1 sibling, 1 reply; 4+ messages in thread
From: Joshua Watt @ 2017-06-08 14:08 UTC (permalink / raw)
To: Craig McQueen, yocto@yoctoproject.org
On Thu, 2017-06-08 at 16:41 +1000, Craig McQueen wrote:
> I have a Mono app that uses DllImport to load some functions from
> libraries. The app can't find the libraries unless I create a Mono
> config file containing dllmap lines to map the library's plain "DLL"
> name (e.g. "foo") to the real name of the .so file (e.g.
> "libfoo.so.4").
I'm not familiar with Mono, is libfoo a plain old library that anyone
can use, or it is some special "Mono Library"
>
> * What would be a good way in the .bb recipe to automatically create
> the required Mono config file? It would need to find the "real" names
> of the library files from the library(s) build output. So it would
> DEPENDS on the library(s).
>
> * Is it better to create a local config file, or write it into
> /etc/mono/config? (My Mono app has the DllImports in a compiled DLL,
> and so far I've found that I need to create a local MyDll.dll.config
> file; making a MyApp.exe.config file doesn't work.)
Packaging rules require that every file belong to one and only one
package. If your application writes /etc/mono/config, you wouldn't be
able to write that file from any other package, including some other
Mono application. The MyApp.exe.config file (unfortunately) sounds like
the ideal solution, because you know that no other package is going to
try and write that file. Writing MyDll.dll.config runs into the same
problem as /etc/mono/config (at least if you are trying to write it
from your MyApp recipe), as another app might want to write the same
file because it uses the same library but that isn't allowed by the
packaging rules. If you want to write MyDll.dll.config, it should be
done in the recipe that actually creates the dll.
>
> --
> Craig McQueen
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: dllmap config for a Mono app
2017-06-08 6:41 dllmap config for a Mono app Craig McQueen
2017-06-08 14:08 ` Joshua Watt
@ 2017-06-08 17:59 ` Khem Raj
1 sibling, 0 replies; 4+ messages in thread
From: Khem Raj @ 2017-06-08 17:59 UTC (permalink / raw)
To: Craig McQueen; +Cc: yocto@yoctoproject.org
On Wed, Jun 7, 2017 at 11:41 PM, Craig McQueen
<craig.mcqueen@innerrange.com> wrote:
> I have a Mono app that uses DllImport to load some functions from libraries. The app can't find the libraries unless I create a Mono config file containing dllmap lines to map the library's plain "DLL" name (e.g. "foo") to the real name of the .so file (e.g. "libfoo.so.4").
>
> * What would be a good way in the .bb recipe to automatically create the required Mono config file? It would need to find the "real" names of the library files from the library(s) build output. So it would DEPENDS on the library(s).
>
mono.bbclass.
> * Is it better to create a local config file, or write it into /etc/mono/config? (My Mono app has the DllImports in a compiled DLL, and so far I've found that I need to create a local MyDll.dll.config file; making a MyApp.exe.config file doesn't work.)
as long as it stays unique in rootfs you should be fine.
>
> * Alternatively, the Mono app can find the libraries if plain libfoo.so symbolic link to libfoo.so.4 exists in the rootfs. But this symbolic link normally is only in the libfoo-dev package, not the libfoo package. Is there some reasonable way to create and install the libfoo.so symbolic links on the rootfs?
>
.so are considered used for development so its usually a symlink to real
versioned .so or its a linker script in some projects. The default packaging
rules therefore considers it so as well. This is as I said most common case
but then there are packages where they use .so ( unversioned name) usually
dlopen/ cases ( e.g. gstreamer plugins )
> --
> Craig McQueen
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: dllmap config for a Mono app
2017-06-08 14:08 ` Joshua Watt
@ 2017-06-09 2:35 ` Craig McQueen
0 siblings, 0 replies; 4+ messages in thread
From: Craig McQueen @ 2017-06-09 2:35 UTC (permalink / raw)
To: Joshua Watt, yocto@yoctoproject.org
Joshua Watt wrote:
> On Thu, 2017-06-08 at 16:41 +1000, Craig McQueen wrote:
> > I have a Mono app that uses DllImport to load some functions from
> > libraries. The app can't find the libraries unless I create a Mono
> > config file containing dllmap lines to map the library's plain "DLL"
> > name (e.g. "foo") to the real name of the .so file (e.g.
> > "libfoo.so.4").
>
> I'm not familiar with Mono, is libfoo a plain old library that anyone can use, or
> it is some special "Mono Library"
It's a plain old library. It just so happens that I wrote it, but other than that it's a typical library.
> > * What would be a good way in the .bb recipe to automatically create
> > the required Mono config file? It would need to find the "real" names
> > of the library files from the library(s) build output. So it would
> > DEPENDS on the library(s).
> >
> > * Is it better to create a local config file, or write it into
> > /etc/mono/config? (My Mono app has the DllImports in a compiled DLL,
> > and so far I've found that I need to create a local MyDll.dll.config
> > file; making a MyApp.exe.config file doesn't work.)
>
> Packaging rules require that every file belong to one and only one package. If
> your application writes /etc/mono/config, you wouldn't be able to write that
> file from any other package, including some other Mono application. The
> MyApp.exe.config file (unfortunately) sounds like the ideal solution, because
> you know that no other package is going to try and write that file. Writing
> MyDll.dll.config runs into the same problem as /etc/mono/config (at least if
> you are trying to write it from your MyApp recipe), as another app might
> want to write the same file because it uses the same library but that isn't
> allowed by the packaging rules. If you want to write MyDll.dll.config, it should
> be done in the recipe that actually creates the dll.
/etc/mono/config is the "standard" system file for Mono, and an initial file is created by the mono recipe, so Mono can load various standard system libraries such as libc.so.6. Modifying it would be comparable to modifying other system config files such as /etc/modules, where it would be better to add a file to /etc/modprobe.d/. But unfortunately Mono doesn't provide for loading config from files in a directory like /etc/mono/config.d/
I guess I need to write to MyDll.dll.config in the recipe for my Mono app then.
Thanks for the advice on this, much appreciated.
--
Craig McQueen
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-06-09 2:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-08 6:41 dllmap config for a Mono app Craig McQueen
2017-06-08 14:08 ` Joshua Watt
2017-06-09 2:35 ` Craig McQueen
2017-06-08 17:59 ` Khem Raj
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.