2014-02-08 5 views
0

소스에서 haskell ghc를 컴파일하려고합니다./usr /이 아닌 다른 폴더에서 cabal 구성을 구성하려고합니다. 처음부터 모든 패키지를 성공적으로 빌드 할 수 있습니다.ghc-pkg의 라이브러리 디렉토리를 변경하는 방법

어떤 시점에서 (cabal-install 패키지를 설치 한 후), cabal이 다른 "library-dirs"를 포함하도록 구성을 변경합니다. 그러면 뭔가 잘못된 것이 발생합니다 (아마도 cabal 구성의 "library-dirs"필드에 잘못된 문자열이 삽입되기 때문일 수 있습니다). 그래서, 나는 다시 설정 파일을 다시 구성하려고합니다 (심지어 구성 파일을 삭제하고 ghc 패키지 캐시를 정리하려고 시도합니다). 그리고 "library-dirs"필드에 주석을 달았지만 여전히 실패합니다. 또한 cabal 패키지 디렉토리 (cabal이 패키지에 대한 캐시를 저장하는 디렉토리)를 제거하려고 이미 시도했습니다. "GHC-PKG 검사"를 사용하는 경우

이 출력입니다 :

sudo -E cabal --config-file=/opt/haskell/config/config install hashable -O2 --global --flags="-fllvm" --prefix=/opt/haskell 2>error --upgrade-dependencies --reinstall 
Resolving dependencies... 
Configuring hashable-1.2.1.0... 
Building hashable-1.2.1.0... 
Failed to install hashable-1.2.1.0 
Last 10 lines of the build log (/{stripped}/hashable-1.2.1.0.log): 

Data/Hashable/Class.hs:100:15: Warning: 
    Literal 15868100553162883236 is out of the Int range -9223372036854775808..9223372036854775807 
[2 of 3] Compiling Data.Hashable.Generic (Data/Hashable/Generic.hs, dist/build/Data/Hashable/Generic.o) 

Data/Hashable/Generic.hs:20:1: Warning: 
    The import of ‛Bits’ from module ‛Data.Bits’ is redundant 
[3 of 3] Compiling Data.Hashable (Data/Hashable.hs, dist/build/Data/Hashable.o) 
/usr/bin/ld: cannot find {stripped}: No such file or directory 
collect2: error: ld returned 1 exit status 

: 나는 Setup.hs에서 수동 음모 또는를 사용하여 패키지를 만들 때

Warning: library-dirs: {stripped} doesn't exist or isn't a directory 

이 지금의 출력입니다 이것은 cabal 구성 파일입니다 (기본값은 제거됩니다) (기본값은 제거됩니다)

remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive 
remote-repo-cache: /opt/haskell/cabal 
world-file: /opt/haskell/cabal/world 
extra-prog-path: /opt/haskell/cabal/bin 
build-summary: /opt/haskell/cabal/logs/build.log 
remote-build-reporting: anonymous 
jobs: $ncpus 

install-dirs global 
    prefix: /opt/haskell/ 

누구든지 나를 도울 수 있습니다. r 가이드? 또는 적어도 ghc가 실제로 제거 된 패키지의 "library-dirs"구성 정보를 저장하는 위치를 알려주십시오.

cabal -V 
cabal-install version 1.18.0.2 
using version 1.18.1.3 of the Cabal library 

ghc -v 
The Glorious Glasgow Haskell Compilation System, version 7.9.20140206 

감사합니다.

답변

0

나는 이것이 처음 생성되었을 때 각 패키지에 위치의 전체 경로가 포함되어 있기 때문일 수 있다고 생각합니다. 들여다보다. .ghc/YOUR_PLATFORM/package.conf.d (나를 위해, 그것은 .ghc/x86_64-darwin-7.6.3/package.conf.d입니다.) 당신은 .conf 많은 파일을 볼 수 있습니다, 각각은 하드 코딩 된 경로가 포함됩니다 : 내용이 올바른 위치를 가리 키거나 당신을 위해 그것을 할 것입니다 스크립트를 작성하는

[...] 
import-dirs: /Users/pejvan/Library/Haskell/ghc-7.6.3/lib/pandoc-types-1.12.3.3/lib 
library-dirs: /Users/pejvan/Library/Haskell/ghc-7.6.3/lib/pandoc-types-1.12.3.3/lib 
[...] 
haddock-interfaces: /Users/pejvan/Library/Haskell/ghc-7.6.3/lib/pandoc-types-1.12.3.3/doc/html/pandoc-types.haddock 
haddock-html: /Users/pejvan/Library/Haskell/ghc-7.6.3/lib/pandoc-types-1.12.3.3/doc/html 

당신은 수동으로 파일을 업데이트 할 수 있습니다 . 지금은 괜찮

pejvan$ ghc-pkg recache

pejvan$ ghc-pkg recache --user

를 마지막으로 그 모든 것을 확인하십시오 : pejvan$ ghc-pkg check

그런 다음 당신은 (여기 저기에 sudo를 필요할 수 있습니다)에 package.cache 파일을 업데이트해야