2015-11-23 1 views
0

J'essaie de regrouper une application que j'ai créée dans monodevelop sur archlinux.mkbundle System.ComponentModel.Win32Exception error

Une fois que je construis l'application monodevelop je vais faire un paquet avec la commande suivante:

mkbundle --deps file.exe --static 

Mais la sortie est:

OS is: Linux 
Note that statically linking the LGPL Mono runtime has more licensing restrictions than dynamically linking. 
See http://www.mono-project.com/Licensing for details on licensing. 
Sources: 1 Auto-dependencies: True 
    embedding: /home/test/Test/Test/bin/Release/file.exe 
    embedding: /usr/lib/mono/gac/gtk-sharp/2.12.0.0__35e10195dab3c99f/gtk-sharp.dll 
config from: /usr/lib/mono/gac/gtk-sharp/2.12.0.0__35e10195dab3c99f/gtk-sharp.dll.config 
    embedding: /usr/lib/mono/4.5/mscorlib.dll 
    embedding: /usr/lib/mono/gac/gdk-sharp/2.12.0.0__35e10195dab3c99f/gdk-sharp.dll 
config from: /usr/lib/mono/gac/gdk-sharp/2.12.0.0__35e10195dab3c99f/gdk-sharp.dll.config 
    embedding: /usr/lib/mono/gac/glib-sharp/2.12.0.0__35e10195dab3c99f/glib-sharp.dll 
config from: /usr/lib/mono/gac/glib-sharp/2.12.0.0__35e10195dab3c99f/glib-sharp.dll.config 
    embedding: /usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll 
    embedding: /usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll 
    embedding: /usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll 
    embedding: /usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll 
    embedding: /usr/lib/mono/gac/System.Security/4.0.0.0__b03f5f7f11d50a3a/System.Security.dll 
    embedding: /usr/lib/mono/gac/Mono.Cairo/4.0.0.0__0738eb9f132ed756/Mono.Cairo.dll 
    embedding: /usr/lib/mono/gac/pango-sharp/2.12.0.0__35e10195dab3c99f/pango-sharp.dll 
config from: /usr/lib/mono/gac/pango-sharp/2.12.0.0__35e10195dab3c99f/pango-sharp.dll.config 
    embedding: /usr/lib/mono/gac/atk-sharp/2.12.0.0__35e10195dab3c99f/atk-sharp.dll 
config from: /usr/lib/mono/gac/atk-sharp/2.12.0.0__35e10195dab3c99f/atk-sharp.dll.config 
    embedding: /usr/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll 
Compiling: 
AS = as (default) 
as -o temp.o temp.s 
as -o temp.o temp.s 

Unhandled Exception: 
System.ComponentModel.Win32Exception: ApplicationName='cmd', CommandLine='/c "as -o temp.o temp.s "', CurrentDirectory='', Native error= Cannot find the specified file 
    at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) <0x40c2f420 + 0x00637> in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ComponentModel.Win32Exception: ApplicationName='cmd', CommandLine='/c "as -o temp.o temp.s "', CurrentDirectory='', Native error= Cannot find the specified file 
    at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) <0x40c2f420 + 0x00637> in <filename unknown>:0 

Etant donné que je suis reliant statiquement mono I J'ai dû installer mono-git de l'AUR pour m'assurer que j'avais les bibliothèques statiques. Je ne suis pas sûr pourquoi il a deux as -o temp.o temp.s énumérés.

Toute aide serait appréciée. J'ai juste confirmé à nouveau que as et cc ont été installés. La sortie de la version est située à: http://pastebin.com/ka25tjWZ

EDIT 24NOV: Comme expliqué dans la réponse acceptée; mon mono n'a pas été compilé correctement. J'ai reconstruit en utilisant ABS avec le PKGBUILD suivant et son fonctionnement maintenant comme prévu.

# $Id: PKGBUILD 246414 2015-09-16 21:25:15Z daniel $ 
# Maintainer: Daniel Isenmann <[email protected]> 
# Contributor: Brice Carpentier <[email protected]> 

pkgname=mono 
pkgver=4.0.4.1 
_pkgver=4.0.4 
pkgrel=1 
pkgdesc="Free implementation of the .NET platform including runtime and compiler" 
arch=(i686 x86_64) 
license=('GPL' 'LGPL2.1' 'MPL' 'custom:MITX11') 
url="http://www.mono-project.com/" 
depends=('zlib' 'libgdiplus>=3.8' 'sh' 'python' 'ca-certificates') 
options=('!makeflags' 'staticlibs') 
provides=('monodoc') 
conflicts=('monodoc') 
source=(http://download.mono-project.com/sources/mono/${pkgname}-${pkgver}.tar.bz2 
     mono.binfmt.d 
     sgen_fix.patch 
    build_fix.patch 
    Microsoft.Portable.Common.targets 
    fix-zlib-helper.patch) 
md5sums=('f598b60a664dfebb1a5eef3e66a9a178' 
     'b9ef8a65fea497acf176cca16c1e2402' 
     '8a700b94bff7a913f920e95890d2fb4c' 
     '30a5af1a4ff50b98f9e73cc2ae554115' 
     'acbffadb0ac233c494b40dd5e79209a5' 
     '62912ad289535bf841c140727e5c1165') 
install="${pkgname}.install" 

build() { 
    cd "${srcdir}"/${pkgname}-${_pkgver} 

    # build mono 
    ./configure --prefix=/usr \ 
    --sysconfdir=/etc \ 
    --bindir=/usr/bin \ 
    --sbindir=/usr/bin \ 
    --disable-quiet-build \ 
    --disable-system-aot \ 
    --enable-static \ 
    --with-static_mono=yes \ 
    --with-mcs-docs=no 
    make 

    # build jay 
    cd "${srcdir}"/${pkgname}-${_pkgver}/mcs/jay 
    make 
} 

package() { 
    cd "${srcdir}"/${pkgname}-${_pkgver} 
    make DESTDIR="${pkgdir}" install 

    # install jay 
    pushd "${srcdir}"/${pkgname}-${_pkgver}/mcs/jay 
    make DESTDIR="${pkgdir}" prefix=/usr INSTALL=../../install-sh install 
    popd 

    # install binfmt conf file and pathes 
    install -D -m644 "${srcdir}"/mono.binfmt.d "${pkgdir}"/usr/lib/binfmt.d/mono.conf 

    #install license 
    mkdir -p "${pkgdir}"/usr/share/licenses/${pkgname} 
    install -m644 mcs/MIT.X11 "${pkgdir}"/usr/share/licenses/${pkgname}/ 

    #fix .pc file to be able to request mono on what it depends, fixes #go-oo build 
    sed -i -e "s:#Requires:Requires:" "${pkgdir}"/usr/lib/pkgconfig/mono.pc 
} 

Répondre

0

Mise à jour:

Je ssh'd un ami ArchLinux et mkbundle fonctionne très bien là-bas, alors je suis retourné à votre erreur:

System.ComponentModel.Win32Exception: ApplicationName='cmd', CommandLine='/c "as -o temp.o temp.s "', CurrentDirectory='', Native error= Cannot find the specified file at System.Diagnostics.Process.Start_noshell

Au départ, je pensais que vous étiez Windows à cause de cette erreur, mais vous avez dit Linux, donc je l'ai ignoré. Je suis allé à la source de mkbundle et je peux voir que votre boîte ArchLinux et/ou l'installation Mono ne signale pas correctement le 'IsUnix' comme false et donc il n'exécute pas l'AS cmd via un appel system, mais essaie d'utiliser le Windows' cmd pour l'exécuter et est ainsi .... parviennent pas

static bool IsUnix { 
     get { 
      int p = (int) Environment.OSVersion.Platform; 
      return ((p == 4) || (p == 128) || (p == 6)); 
     } 
    } 

    static void Execute (string cmdLine) 
    { 
     if (IsUnix) { 
      Console.WriteLine (cmdLine); 
      int ret = system (cmdLine); 
      if (ret != 0) 
      { 

Encore une fois, le ArchLinux 4.2.5-1 que j'ai accès à Mono a 4.0.4.1 et fonctionne comme prévu .....

ce qui est retourné sur votre système pour chacune de ces lignes ?:

int p = (int) Environment.OSVersion.Platform; 
var islinux = ((p == 4) || (p == 128) || (p == 6)); 

Original:

ENVIRONMENT VARIABLES

AS  Assembler command. The default is "as". 

    CC  C compiler command. The default is "cc" under Linux and "gcc" under 
      Windows. 

Ref: man mkbundle

Ceci est la même exigence que vous auriez besoin si vous construisiez lui-même mono, en plus du code assembleur temp.s il sera également créer un fichier temp.c qui a besoin compilateur ac. C'est le code d'amorçage pour charger/exécuter votre code basé sur CIL.

S'il vous manque un assembleur sur votre système, il existe un certain nombre de packages, tels que binutils, qui satisfont aux exigences.

+0

Oui, je comprends cela. Je suis sur un système Linux Et j'ai construit mono à partir de la source, donc je sais que j'ai cc. –

+0

Opps, besoin de plus de café, vu le 'cmd', supposé Windows, va mettre à jour, mais vous avez toujours besoin d'un assembleur, devrait en avoir un si vous avez installé le paquet gcc dev, essayez le paquet binutils – SushiHangover

+0

Je vais devoir vérifier mon environnement variables (je sais que je n'en ai pas défini récemment pour CC ou AS.) –