[Mono-list] mkbundle not bundling the configs
Robert Jordan
robertj at gmx.net
Thu Dec 16 17:36:21 EST 2010
On 16.12.2010 22:35, XU, Jiangyan wrote:
> Hi all,
>
> I was trying to bundle my application
>
> MONO_OPTIONS=--runtime=v2.0.50215 mkbundle2 -o mybundle.bundle --deps
> --config-dir /etc --machine-config /etc/mono/2.0/machine.config --static -z
> myapp.exe {dlls}
>
> This command emits the following warnings:
> ====
> cc -o mybundle.bundle -Wall `pkg-config --cflags mono` temp.c -lz
> `pkg-config --libs-only-L mono` -Wl,-Bstatic -lmono -Wl,-Bdynamic
> `pkg-config --libs-only-l mono | sed -e "s/\-lmono //"` temp.o
> temp.c: In function ‘install_dll_config_files’:
> temp.c:146: warning: pointer targets in passing argument 2 of
> ‘mono_register_config_for_assembly’ differ in signedness
> /usr/include/mono-1.0/mono/metadata/assembly.h:95: note: expected ‘const
> char *’ but argument is of type ‘const unsigned char *’
> temp.c:148: warning: pointer targets in passing argument 2 of
> ‘mono_register_config_for_assembly’ differ in signedness
> /usr/include/mono-1.0/mono/metadata/assembly.h:95: note: expected ‘const
> char *’ but argument is of type ‘const unsigned char *’
> ====
>
> Then when I ran the bundle on another machine without mono, it couldn't
> locate "msvcrt":
> ====
> System.DllNotFoundException: msvcrt
> at (wrapper managed-to-native) Mono.Unix.Native.Stdlib:free (intptr)
> at Mono.Unix.UnixMarshal.FreeHeap (IntPtr ptr) [0x00000] in<filename
> unknown>:0
> at Mono.Fuse.FileNameMarshaler.CleanUpNativeData (IntPtr pNativeData)
> [0x00000] in<filename unknown>:0
> at (wrapper managed-to-native) Mono.Fuse.FileSystem:mfh_fuse_mount
> (string,Mono.Fuse.Args)
> at Mono.Fuse.FileSystem.Create () [0x00000] in<filename unknown>:0
> at Mono.Fuse.FileSystem.Start () [0x00000] in<filename unknown>:0
> ...
> ====
>
> I know that the mappings are defined in /etc/mono/config, (<dllmap
> dll="i:msvcrt" target="libc.so.6" os="!windows"/>) which I included in
> "--config-dir". It didn't seem to be included and I suspect it has to do
> with the warning messages. I tried to copy contents in /etc/mono/config to
The warnings are harmless.
> machine.config but it didn't help. I Googled the message but couldn't find
> anything useful.
>
> Can someone tell me whether I used the mkbundle command correctly? What
> could be the problem?
You're not bundling mono's config file.
Try this:
mkbundle2 \
--config /etc/mono/config \
--machine-config /etc/mono/2.0/machine.config ...
Or this:
mkdir -p ./etc
cp -a /etc/mono ./etc/
mkbundle2 --config-dir ./etc ...
and deploy ./etc together with the bundle.
Robert
More information about the Mono-list
mailing list