Windows에서 작은 haskell 프로젝트 (예 : which you can find here if you want to try to compile it)를 빌드하는 데 다소 번거로운 버그가 있습니다. cygwin64에 있습니다.스택이 창 아래에서 컴파일되지 않습니다.
조언을 given on this post으로 빌드 도우미로 스택을 사용하고 있습니다. 이제 빌드가 끝날 무렵에 실패합니다 (몇 시간 동안 그렇게 해본 후 오히려 실망합니다).
setup.exe:
'C:\Users\Julien\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc-pkg.EXE'
exited with an error:
cairo-0.13.4.2: Warning: haddock-interfaces:
C:\cygwin64\tmp\stack11608\cairo-0.13.4.2\.stack-work\dist\ca59d0ab\doc\html\cairo\cairo.haddock
doesn't exist or isn't a file
cairo-0.13.4.2: Warning: haddock-html:
C:\cygwin64\tmp\stack11608\cairo-0.13.4.2\.stack-work\dist\ca59d0ab\doc\html\cairo
doesn't exist or isn't a directory
cairo-0.13.4.2: include-dirs: /usr/include/cairo is a relative path which
makes no sense (as there is nothing for it to be relative to). You can make
paths relative to the package database itself by using ${pkgroot}. (use
--force to override)
cairo-0.13.4.2: include-dirs: /usr/include/glib-2.0 is a relative path which
makes no sense (as there is nothing for it to be relative to). You can make
paths relative to the package database itself by using ${pkgroot}. (use
--force to override)
cairo-0.13.4.2: include-dirs: /usr/lib/glib-2.0/include is a relative path
which makes no sense (as there is nothing for it to be relative to). You can
make paths relative to the package database itself by using ${pkgroot}. (use
--force to override)
cairo-0.13.4.2: include-dirs: /usr/include/pixman-1 is a relative path which
makes no sense (as there is nothing for it to be relative to). You can make
paths relative to the package database itself by using ${pkgroot}. (use
--force to override)
cairo-0.13.4.2: include-dirs: /usr/include/freetype2 is a relative path which
makes no sense (as there is nothing for it to be relative to). You can make
paths relative to the package database itself by using ${pkgroot}. (use
--force to override)
cairo-0.13.4.2: include-dirs: /usr/include/libpng16 is a relative path which
makes no sense (as there is nothing for it to be relative to). You can make
paths relative to the package database itself by using ${pkgroot}. (use
--force to override)
-- While building custom Setup.hs for package glib-0.13.5.0 using:
C:\cygwin64\tmp\stack11608\glib-0.13.5.0\.stack-work\dist\ca59d0ab\setup\setup --builddir=.stack-work\dist\ca59d0ab build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: C:\cygwin64\home\Julien\syme-master\.stack-work\logs\glib-0.13.5.0.log
[1 of 2] Compiling Main (C:\cygwin64\tmp\stack11608\glib-0.13.5.0\Setup.hs, C:\cygwin64\tmp\stack11608\glib-0.13.5.0\.stack-work\dist\ca59d0ab\setup\Main.o)
[2 of 2] Compiling StackSetupShim (C:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs, C:\cygwin64\tmp\stack11608\glib-0.13.5.0\.stack-work\dist\ca59d0ab\setup\StackSetupShim.o)
Linking C:\cygwin64\tmp\stack11608\glib-0.13.5.0\.stack-work\dist\ca59d0ab\setup\setup.exe ...
Configuring glib-0.13.5.0...
Building glib-0.13.5.0...
In file included from C:/cygwin64/usr/include/glib/gtypes.h:34:0,
from C:/cygwin64/usr/include/glib/galloca.h:32,
from C:/cygwin64/usr/include/glib.h:30,
from C:/cygwin64/usr/include/gobject/gbinding.h:28,
from C:\cygwin64\home\Julien\syme-master\../../../usr/include\glib-object.h:23:
C:/cygwin64/usr/include/glib/gversionmacros.h:257:2: error: #error "GLIB_VERSION_MIN_REQUIRED must be >= GLIB_VERSION_2_26"
#error "GLIB_VERSION_MIN_REQUIRED must be >= GLIB_VERSION_2_26"
^
Preprocessing library glib-0.13.5.0...
setup.exe: Error during preprocessing
점은 Cygwin에서 설치 프로그램에 따라, 나는 libglib2.0-(STABLE) 버전 2.52.3-1이 설치되어 있다는 것입니다 :
오류 메시지는 다음과 같습니다. 그것은 glib2의 잘못된 버전입니까? 다른 glib 버전간에 충돌이 있습니까? 그렇다면 어떻게 스택을 이해하여 의 올바른 버전을 확인할 수 있습니까?
나는 stack.yaml 파일 내부에 상대 경로를 추가하여 다소 엉망이되었다고 말해야한다. 성가신 것인지 아닌지는 잘 모른다.
도움을 주시면 감사하겠습니다.
UDPATE : 코멘트가 제안한 것처럼, 나는 follwing을 추가 내 프로젝트 지역 stack.yaml을 변경 사람들의 내부
extra-include-dirs: [c;\\cygwin64\\usr\\include]
extra-lib-dirs: [c;\\cygwin64\\lib]
을 (나에게 창에 경로를 작성하는 방법을 알아 내기 위해 잠시했다) , 나는 코멘트에 제공된 링크 user2407038에 의해 제공되는 libs의 압축을 풉니 다. 이제 오류 메시지는 다음과 같습니다.
-- While building custom Setup.hs for package cairo-0.13.4.2 using:
C:\cygwin64\tmp\stack10676\cairo-0.13.4.2\.stack-work\dist\ca59d0ab\setup\setup --builddir=.stack-work\dist\ca59d0ab build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: C:\cygwin64\home\Julien\syme-master\.stack-work\logs\cairo-0.13.4.2.log
[1 of 2] Compiling Main (C:\cygwin64\tmp\stack10676\cairo-0.13.4.2\Setup.hs, C:\cygwin64\tmp\stack10676\cairo-0.13.4.2\.stack-work\dist\ca59d0ab\setup\Main.o)
[2 of 2] Compiling StackSetupShim (C:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs, C:\cygwin64\tmp\stack10676\cairo-0.13.4.2\.stack-work\dist\ca59d0ab\setup\StackSetupShim.o)
Linking C:\cygwin64\tmp\stack10676\cairo-0.13.4.2\.stack-work\dist\ca59d0ab\setup\setup.exe ...
Configuring cairo-0.13.4.2...
Building cairo-0.13.4.2...
C:\cygwin64\tmp\stack10676\cairo-0.13.4.2\cairo-gtk2hs.h:1:18: fatal error: cairo.h: No such file or directory
compilation terminated.
Preprocessing library cairo-0.13.4.2...
setup.exe: Error during preprocessing
-- While building custom Setup.hs for package glib-0.13.5.0 using:
C:\cygwin64\tmp\stack10676\glib-0.13.5.0\.stack-work\dist\ca59d0ab\setup\setup --builddir=.stack-work\dist\ca59d0ab build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: C:\cygwin64\home\Julien\syme-master\.stack-work\logs\glib-0.13.5.0.log
[1 of 2] Compiling Main (C:\cygwin64\tmp\stack10676\glib-0.13.5.0\Setup.hs, C:\cygwin64\tmp\stack10676\glib-0.13.5.0\.stack-work\dist\ca59d0ab\setup\Main.o)
[2 of 2] Compiling StackSetupShim (C:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs, C:\cygwin64\tmp\stack10676\glib-0.13.5.0\.stack-work\dist\ca59d0ab\setup\StackSetupShim.o)
Linking C:\cygwin64\tmp\stack10676\glib-0.13.5.0\.stack-work\dist\ca59d0ab\setup\setup.exe ...
Configuring glib-0.13.5.0...
Building glib-0.13.5.0...
Preprocessing library glib-0.13.5.0...
setup.exe: glib-object.h: File does not exist
어디에서이 헤더를 찾을 수 있습니까?
이들은 (afaik) 상대 경로가 아니라 유닉스/리눅스 경로이며, 분명히 컴파일러는 이것들을 이해할 수 없습니다. –
Windows GHC에서 Windows 환경에 있기를 기대하기 때문에 실제로 cygwin을 GHC와 함께 사용할 수 없습니다. 특히, GHC가'/ usr/include/cairo' 경로를 유효한 Windows 경로로 인식하도록하기 위해 할 수있는 일은 아무것도 없습니다 (그렇지 않기 때문에). glib의 네이티브 버전을 설치해야하고 (다른 의존성에 대해서도 마찬가지 임) GHC가 cygwin gcc를 사용하지 않도록해야한다. (스택은 일반적으로 잘 수행된다.) 또한 빌드가 끝날 무렵 실패하지 않는다는 점에 유의하십시오. 시작시 기본적으로 그렇게합니다 (종속성을 빌드 할 때 패키지가 아니라). – user2407038
@ user2407038 네이티브 패키지는 Windows 패키지를 의미합니까? Windows 용 glib의 사용 가능한 버전을 찾았으므로 아무 것도 찾지 못했습니다. –