Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cairo (and things it depends on) fails to install on MSYS2 #139

Closed
RyanGlScott opened this issue Oct 30, 2015 · 1 comment
Closed

cairo (and things it depends on) fails to install on MSYS2 #139

RyanGlScott opened this issue Oct 30, 2015 · 1 comment

Comments

@RyanGlScott
Copy link
Contributor

I'm using MSYS2-x86_64-20150916 on Windows 8.1. I noticed that cairo and, by extension, anything that depends on cairo (i.e., all gtk-related packages) fails to install without some gross hacks. Here's some output to show you what's going on:

$ cabal get cairo
$ cd cairo-0.13.1.0/
$ cabal sandbox init
$ cabal install --only-dependencies
$ cabal install -j1
...
In-place registering cairo-0.13.1.0...
setup.exe:
'C:\Users\ryanscot\Documents\Software\Haskell\ghc-7.10.2\bin\ghc-pkg.exe'
exited with an error:
cairo-0.13.1.0: Warning: haddock-interfaces:
C:\Users\ryanscot\Documents\Hacking\Haskell\cairo-0.13.1.0\dist/dist-sandbox-e81b42b6\doc\html\cairo\cairo.haddock
doesn't exist or isn't a file
cairo-0.13.1.0: Warning: haddock-html:
C:\Users\ryanscot\Documents\Hacking\Haskell\cairo-0.13.1.0\dist/dist-sandbox-e81b42b6\doc\html\cairo
doesn't exist or isn't a directory
cairo-0.13.1.0: include-dirs: /mingw64/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.1.0: include-dirs: /mingw64/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)
cairo-0.13.1.0: include-dirs: /mingw64/include/harfbuzz 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.1.0: include-dirs: /mingw64/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.1.0: include-dirs: /mingw64/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)
Failed to install cairo-0.13.1.0
cabal.exe: Error: some packages failed to install:
cairo-0.13.1.0 failed during the building phase. The exception was:
ExitFailure 1

As the error suggests, you can fix this by running cabal install --ghc-pkg-options="--force", but that's not a very satisfying solution. Trying to install cairo with stack also yields the same error, so cabal-install isn't the culprit.

The culprit here might be MSYS2, to some degree. I installed mingw-w64-x86_64-cairo via pacman in MSYS2, and I noticed something suspicious from pkg-config:

$ pkg-config --cflags cairo
-mms-bitfields -IC:/msys64/mingw64/include/cairo -IC:/msys64/mingw64/include/pixman-1 -IC:/msys64/mingw64/include -I/mingw64/include/freetype2 -I/mingw64/include/libpng16 -I/mingw64/include/harfbuzz -I/mingw64/include/glib-2.0 -I/mingw64/lib/glib-2.0/include -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/freetype2 -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/harfbuzz -IC:/msys64/mingw64/include/glib-2.0 -IC:/msys64/mingw64/lib/glib-2.0/include -IC:/msys64/mingw64/include/libpng16

In particular, note how it passes flags like -I/mingw64/include/freetype2, since the build output was complaining about /mingw64/include/freetype2 being a relative path! (On Windows it is, anyway.) We clearly have some bad path-related interaction going on here, but I'm not sure where would be the best place to fix it.

@RyanGlScott
Copy link
Contributor Author

It turns out this was a MSYS2 issue, not a gtk2hs one. And that MSYS2 issue now fixed! You now no longer have to use the --ghc-pkg-options="--force" hack to get cairo to install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant