将Yesod部署到Heroku,无法静态构建

将Yesod部署到Heroku,无法静态构建

我是Yesod的新手,我无法静态构建Yesod,因此我可以部署到Heroku。

我更改了默认的.cabal文件以反映静态编译

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

它不再构建。我得到了一大堆警告,然后是一大堆未定义的引用,如下所示:

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
慕无忌1623718
浏览 601回答 3
3回答
打开App,查看更多内容
随时随地看视频慕课网APP