Le déploiement de Yessod de Heroku, ne peut pas construire de façon statique

Je suis très nouveau à Yesod et je vais avoir du mal à constituer Yessod de manière statique
donc, je peux déployer sur Heroku.

J'ai changé la valeur par défaut .cabale fichier pour prendre en compte la compilation statique

if flag(production)
   cpp-options:   -DPRODUCTION
   ghc-options:   -Wall -threaded -O2 -static -optl-static
else
   ghc-options:   -Wall -threaded -O0

Et il n'est plus construit. Je reçois tout un tas de mises en garde et puis un
flopée de indéfinie des références comme ceci:

Linking dist/build/personal-website/personal-website ...
/usr/lib/ghc-7.0.3/libHSrts_thr.a(Linker.thr_o): In function
`internal_dlopen':
Linker.c:(.text+0x407): warning: Using 'dlopen' in statically linked
applications requires at runtime the shared libraries from the glibc
version used for linking
/usr/lib/ghc-7.0.3/unix-2.4.2.0/libHSunix-2.4.2.0.a(HsUnix.o): In
function `__hsunix_getpwent':
HsUnix.c:(.text+0xa1): warning: Using 'getpwent' in statically linked
applications requires at runtime the shared libraries from the glibc
version used for linking
/usr/lib/ghc-7.0.3/unix-2.4.2.0/libHSunix-2.4.2.0.a(HsUnix.o): In
function `__hsunix_getpwnam_r':
HsUnix.c:(.text+0xb1): warning: Using 'getpwnam_r' in statically
linked applications requires at runtime the shared libraries from the
glibc version used for linking
/usr/lib/libpq.a(thread.o): In function `pqGetpwuid':
(.text+0x15): warning: Using 'getpwuid_r' in statically linked
applications requires at runtime the shared libraries from the glibc
version used for linking
/usr/lib/libpq.a(ip.o): In function `pg_getaddrinfo_all':
(.text+0x31): warning: Using 'getaddrinfo' in statically linked
applications requires at runtime the shared libraries from the glibc
version used for linking
/usr/lib/ghc-7.0.3/site-local/network-2.3.0.2/
libHSnetwork-2.3.0.2.a(BSD__63.o): In function `sD3z_info':
(.text+0xe4): warning: Using 'gethostbyname' in statically linked
applications requires at runtime the shared libraries from the glibc
version used for linking
/usr/lib/ghc-7.0.3/site-local/network-2.3.0.2/
libHSnetwork-2.3.0.2.a(BSD__164.o): In function `sFKc_info':
(.text+0x12d): warning: Using 'getprotobyname' in statically linked
applications requires at runtime the shared libraries from the glibc
version used for linking
/usr/lib/ghc-7.0.3/site-local/network-2.3.0.2/
libHSnetwork-2.3.0.2.a(BSD__155.o): In function `sFDs_info':
(.text+0x4c): warning: Using 'getservbyname' in statically linked
applications requires at runtime the shared libraries from the glibc
version used for linking
/usr/lib/libpq.a(fe-misc.o): In function `pqSocketCheck':
(.text+0xa2d): undefined reference to `SSL_pending'
/usr/lib/libpq.a(fe-secure.o): In function `SSLerrmessage':
(.text+0x31): undefined reference to `ERR_get_error'
/usr/lib/libpq.a(fe-secure.o): In function `SSLerrmessage':
(.text+0x41): undefined reference to `ERR_reason_error_string'
/usr/lib/libpq.a(fe-secure.o): In function `initialize_SSL':
(.text+0x2f8): undefined reference to `SSL_check_private_key'
/usr/lib/libpq.a(fe-secure.o): In function `initialize_SSL':
(.text+0x3c0): undefined reference to `SSL_CTX_load_verify_locations'
(... snip ...)

Si je viens de le compiler avec juste -static et sans -optl-static
tout s'appuie bien, mais l'application se bloque lorsqu'il essaie de
démarrer sur Heroku.

2011-12-28T01:20:51+00:00 heroku[web.1]: Starting process with command
`./dist/build/personal-website/personal-website -p 41083`
2011-12-28T01:20:51+00:00 app[web.1]: ./dist/build/personal-website/
personal-website: error while loading shared libraries: libgmp.so.10:
cannot open shared object file: No such file or directory
2011-12-28T01:20:52+00:00 heroku[web.1]: State changed from starting
to crashed

J'ai essayé d'ajouter libgmp.donc.10 à la LD_LIBRARY_PATH comme suggéré dans ici
et puis a obtenu l'erreur suivante:

2011-12-28T01:31:23+00:00 app[web.1]: ./dist/build/personal-website/
personal-website: /lib/libc.so.6: version `GLIBC_2.14' not found
(required by ./dist/build/personal-website/personal-website)
2011-12-28T01:31:23+00:00 app[web.1]: ./dist/build/personal-website/
personal-website: /lib/libc.so.6: version `GLIBC_2.14' not found
(required by /app/dist/build/personal-website/libgmp.so.10)
2011-12-28T01:31:25+00:00 heroku[web.1]: State changed from starting
to crashed
2011-12-28T01:31:25+00:00 heroku[web.1]: Process exited

Il semble que la version de la libc que je compile contre est
différentes. J'ai essayé aussi d'ajouter de la libc pour le lot des bibliothèques de l'
même que j'ai fait, pour libgmp mais cela entraîne une erreur de segmentation
lorsque l'application démarre sur le Heroku côté.

Tout fonctionne bien sur mon PC. Je suis sous archlinux 64 bits avec ghc
7.0.3. Le billet de blog sur le site officiel Yesod blog avait l'air assez facile
mais je suis perplexe à ce point. N'importe qui ont des idées? Si il y a un moyen pour obtenir cette chose de travail sans bâtiment statiquement je suis ouvert à ça aussi.

MODIFIER

Par Employed Russians réponse j'ai fait les opérations suivantes pour résoudre ce problème.

D'abord créé un nouveau répertoire lib sous le répertoire de projet et copié le manque des bibliothèques partagées en elle. Vous pouvez obtenir cette information en cours d'exécution ldd path/to/executable et heroku run ldd path/to/executable et en comparant la sortie.

Puis j'ai fait un heroku config:add LD_LIBRARY_PATH=./lib ainsi, lorsque l'application est démarrée à l'éditeur de liens dynamique va chercher les bibliothèques dans le nouveau répertoire lib.

Enfin, j'ai créé un ubuntu 11.10 de la machine virtuelle et construit et déployé sur Heroku à partir de là, ce qui a un assez vieux glibc qu'il fonctionne sur le Heroku hôte.

Edit:
Depuis, j'ai écrit un tutoriel sur la Yesod wiki

InformationsquelleAutor asm | 2011-12-28