无法在 CentOS 服务器上安装和使用 Cabal (Haskell) - zlib-0.5.4.1 在构建阶段失败

人气:1,002 发布:2022-10-16 标签: zlib centos haskell cabal cabal-install

问题描述

我正在尝试在我的服务器上安装在 Cabal 中运行的 Haskell 服务器.当我正常配置服务器以运行它时,我会按照我们改进的这些说明进行操作 - 它们每次都在空白机架空间云服务器上运行 100%.

I'm trying to install a Haskell server which runs in Cabal on my server. When I configure a server normally to run this, I follow these instructions which we've refined - they work 100% every time on a blank rackspace cloud server.

yum update
yum install git
yum install vim
yum install ghc-zlib-devel.x86_64
wget http://www.haskell.org/ghc/dist/7.8.2/ghc-7.8.2-x86_64-unknown-linux-centos65.tar.xz
wget http://www.haskell.org/cabal/release/cabal-install-1.20.0.1/cabal-x86_64-unknown-linux.tar.gz
tar xvfJ ghc-7.8.2-x86_64-unknown-linux-centos65.tar.xz
tar -zxvf cabal-x86_64-unknown-linux.tar.gz
cd ghc-7.8.2
./configure
yum install gcc
./configure
make install
cd ../
git clone https://github.com/samheather/DSA-WAW.git
cd DSA-WAW/server
cp -r ../../cabal cabal
./cabal update
./cabal install cabal-install
./cabal sandbox init
cabal install

然后我可以简单地导航到输出文件夹并运行服务器.

I can then simply navigate to the output folder and run the server.

但是,在我的带有 iWeb 的专用服务器上,这不起作用.最初的大多数步骤都很好,直到它到达'./cabal install cabal-install',它会抛出以下错误:

However, on my dedicated server with iWeb, this does not work. The first majority of steps are fine, until it gets to './cabal install cabal-install', where it throws the following errors:

./cabal install cabal-install
Resolving dependencies...
Configuring network-2.5.0.0...
Configuring zlib-0.5.4.1...
Configuring Cabal-1.20.0.1...
Building zlib-0.5.4.1...
Failed to install zlib-0.5.4.1
Last 10 lines of the build log ( /root/.cabal/logs/zlib-0.5.4.1.log ):
Configuring zlib-0.5.4.1...
Building zlib-0.5.4.1...
Preprocessing library zlib-0.5.4.1...
hsc2hs: dist/build/Codec/Compression/Zlib/Stream_hsc_make: runProcess: runInteractiveProcess: exec: permission denied (Permission denied)
Failed to install network-2.5.0.0
Last 10 lines of the build log ( /root/.cabal/logs/network-2.5.0.0.log ):
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/tmp/network-2.5.0.0-4813/network-2.5.0.0':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Failed to install Cabal-1.20.0.1
Last 10 lines of the build log ( /root/.cabal/logs/Cabal-1.20.0.1.log ):
[68 of 76] Compiling Distribution.Simple.Build ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/Build.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/Build.o )
[69 of 76] Compiling Distribution.Simple.Haddock ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/Haddock.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/Haddock.o )
[70 of 76] Compiling Distribution.Simple.SrcDist ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/SrcDist.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/SrcDist.o )
[71 of 76] Compiling Distribution.Simple.UserHooks ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/UserHooks.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/UserHooks.o )
[72 of 76] Compiling Distribution.Simple.Bench ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/Bench.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/Bench.o )
[73 of 76] Compiling Distribution.Simple.Test.ExeV10 ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/Test/ExeV10.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/Test/ExeV10.o )
[74 of 76] Compiling Distribution.Simple.Test ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/Test.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/Test.o )
[75 of 76] Compiling Distribution.Simple ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple.o )
[76 of 76] Compiling Main             ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/setup.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Main.o )
Linking /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/setup ...
cabal: Error: some packages failed to install:
Cabal-1.20.0.1 failed during the configure step. The exception was:
ExitFailure 127
HTTP-4000.2.17 depends on network-2.5.0.0 which failed to install.
cabal-install-1.20.0.3 depends on Cabal-1.20.0.1 which failed to install.
network-2.5.0.0 failed during the configure step. The exception was:
ExitFailure 1
zlib-0.5.4.1 failed during the building phase. The exception was:
ExitFailure 1

有人知道这是怎么回事吗?

Does anyone have an idea what is going wrong with this?

谢谢,

山姆

更新:我应该提一下,因为服务器已经有 gcc 我们跳过这两个步骤:yum install gcc; ./configure"

Update: I should mention since the server already has gcc we skip these two steps: "yum install gcc; ./configure"

推荐答案

我刚刚想通了 - 我的/tmp 没有 exec 权限.由于服务器运行 WHM/cPanel,我只运行 /scripts/securetmp,对两者都回答 n.

I just figured this out - my /tmp did not have exec permissions. Since the server runs WHM/cPanel, I just ran /scripts/securetmp, answering n to both.

640