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

Isssues with installing gi-gtk on Win10 #416

Open
liamzee opened this issue Aug 13, 2023 · 9 comments
Open

Isssues with installing gi-gtk on Win10 #416

liamzee opened this issue Aug 13, 2023 · 9 comments

Comments

@liamzee
Copy link

liamzee commented Aug 13, 2023

Failed to build gi-cairo-1.0.29. The failure occurred during the configure
step.
Build log (
C:\cabal\logs\ghc-9.4.6\gi-cairo-1.0.29-b473ad33fb8201efa4de21fcb2752f3bb22b760f.log
):
[1 of 2] Compiling Main ( C:\Users\Liam\AppData\Local\Temp\cabal-install.-22212\dist-newstyle\tmp\src-22214\gi-cairo-1.0.29\dist\setup\setup.hs, C:\Users\Liam\AppData\Local\Temp\cabal-install.-22212\dist-newstyle\tmp\src-22214\gi-cairo-1.0.29\dist\setup\Main.o )
[2 of 2] Linking C:\Users\Liam\AppData\Local\Temp\cabal-install.-22212\dist-newstyle\tmp\src-22214\gi-cairo-1.0.29\dist\setup\setup.exe
Did not find a GI repository for cairo-1.0 in ["C:\Program Files\gir-1.0","/opt/homebrew/share/gir-1.0"].
CallStack (from HasCallStack):
error, called at lib\Data\GI\GIR\Repository.hs:94:20 in haskell-gi-0.26.7-71a2dc1a182861674d63f91dc7741ab0d1fb55a3:Data.GI.GIR.Repository

Failed to build gi-freetype2-2.0.4. The failure occurred during the configure
step.
Build log (
C:\cabal\logs\ghc-9.4.6\gi-freetype2-2.0.4-1ae7101e78d2bc8469151bcdc35a027c341e8fb3.log
):
[1 of 2] Compiling Main ( C:\Users\Liam\AppData\Local\Temp\cabal-install.-22212\dist-newstyle\tmp\src-22213\gi-freetype2-2.0.4\dist\setup\setup.hs, C:\Users\Liam\AppData\Local\Temp\cabal-install.-22212\dist-newstyle\tmp\src-22213\gi-freetype2-2.0.4\dist\setup\Main.o )
[2 of 2] Linking C:\Users\Liam\AppData\Local\Temp\cabal-install.-22212\dist-newstyle\tmp\src-22213\gi-freetype2-2.0.4\dist\setup\setup.exe
Did not find a GI repository for freetype2-2.0 in ["C:\Program Files\gir-1.0","/opt/homebrew/share/gir-1.0"].
CallStack (from HasCallStack):
error, called at lib\Data\GI\GIR\Repository.hs:94:20 in haskell-gi-0.26.7-71a2dc1a182861674d63f91dc7741ab0d1fb55a3:Data.GI.GIR.Repository

Failed to build gi-glib-2.0.29. The failure occurred during the configure
step.
Build log (
C:\cabal\logs\ghc-9.4.6\gi-glib-2.0.29-d3153a9365770c5e2b29afbe2dcdfa828705cea2.log
):
Did not find a GI repository for GLib-2.0 in ["C:\Program Files\gir-1.0","/opt/homebrew/share/gir-1.0"].
CallStack (from HasCallStack):
error, called at lib\Data\GI\GIR\Repository.hs:94:20 in haskell-gi-0.26.7-71a2dc1a182861674d63f91dc7741ab0d1fb55a3:Data.GI.GIR.Repository
[1 of 2] Compiling Main ( C:\Users\Liam\AppData\Local\Temp\cabal-install.-22212\dist-newstyle\tmp\src-22212\gi-glib-2.0.29\dist\setup\setup.hs, C:\Users\Liam\AppData\Local\Temp\cabal-install.-22212\dist-newstyle\tmp\src-22212\gi-glib-2.0.29\dist\setup\Main.o )
[2 of 2] Linking C:\Users\Liam\AppData\Local\Temp\cabal-install.-22212\dist-newstyle\tmp\src-22212\gi-glib-2.0.29\dist\setup\setup.exe
Error: cabal-3.10.1.0.exe: Failed to build gi-cairo-1.0.29 (which is required
by gi-gtk-4.0.8). See the build log above for details.
Failed to build gi-freetype2-2.0.4 (which is required by gi-gtk-4.0.8). See
the build log above for details.
Failed to build gi-glib-2.0.29 (which is required by gi-gtk-4.0.8). See the
build log above for details.

Not sure if this is a current issue or if there's a known resolution for such.

@liamzee
Copy link
Author

liamzee commented Aug 13, 2023

Okay, followed these instructions precisely (with cmd), and the install into cabal package cache worked. But is there any way to get this to work for powershell, since many users have migrated to powershell / windows terminal from cmd?

https://github.com/haskell-gi/haskell-gi/wiki/Using-haskell-gi-in-Windows

@liamzee
Copy link
Author

liamzee commented Aug 13, 2023

Powershell examples:

$env:PATH += ";C:\ghcup\msys64\mingw64\bin;C:\ghcup\msys64\usr\bin;%PATH%"
$env:PKG_CONFIG_PATH ="C:\ghcup\msys64\mingw64\lib\pkgconfig"
$env:XDG_DATA_DIRS="C:\ghcup\msys64\mingw64\share"

@liamzee
Copy link
Author

liamzee commented Aug 13, 2023

This is still failing, tried a new install on 9.6.2,

Failed to build gi-gdk-4.0.7. The failure occurred during the configure step.
Build log (
C:\cabal\logs\ghc-9.6.2\gi-gdk-4.0.7-4b602f2f3c76a79b97f0c09d05b26b4249a9a7c5.log
):
[1 of 2] Compiling Main ( C:\Users\Liam\AppData\Local\Temp\cabal-install.-19792\dist-newstyle\tmp\src-19792\gi-gdk-4.0.7\dist\setup\setup.hs, C:\Users\Liam\AppData\Local\Temp\cabal-install.-19792\dist-newstyle\tmp\src-19792\gi-gdk-4.0.7\dist\setup\Main.o )
[2 of 2] Linking C:\Users\Liam\AppData\Local\Temp\cabal-install.-19792\dist-newstyle\tmp\src-19792\gi-gdk-4.0.7\dist\setup\setup.exe

** (process:9088): WARNING **: 15:47:14.861: Failed to load shared library 'libgtk-4-1.dll' referenced by the typelib: 'libgtk-4-1.dll': The specified procedure could not be found.
Could not resolve symbol "gdk_device_pad_get_type" in namespace "Gdk-4.0"
CallStack (from HasCallStack):
error, called at lib\Data\GI\CodeGen\LibGIRepository.hs:202:16 in haskell-gi-0.26.7-c7e98f2556a258cf0c6dcb97af4bee87264bdabe:Data.GI.CodeGen.LibGIRepository
Error: cabal-3.10.1.0.exe: Failed to build gi-gdk-4.0.7 (which is required by
gi-gtk-4.0.8). See the build log above for details.

I think the cmd version still works, not sure what's wrong with the powershell version.

@liamzee
Copy link
Author

liamzee commented Aug 13, 2023

might have been that I failed to set $env.PATH, as opposed to $env.Path, which was what I was using for a bit.

@liamzee
Copy link
Author

liamzee commented Aug 13, 2023

Still not working even with $env:PATH. So I guess this is an issue with powershell / my comprehension of powershell, might someone have a fix?

@liamzee
Copy link
Author

liamzee commented Aug 14, 2023

ghci> :set -package gi-gtk
package flags have changed, resetting and loading new packages...
ghc-9.6.2.exe: Could not load `libgobject-2.0-0.dll'. Reason: addDLL: libgobject-2.0-0.dll or dependencies not loaded. (Win32 error 126)

*** Exception: loadArchive "C:\ghcup\msys64\mingw64\lib\libgobject-2.0.dll.a": failed

Looks like this works fine on cmd.exe, terribly on powershell. Ugh.

@liamzee
Copy link
Author

liamzee commented Aug 14, 2023

powershell translation of:

$env:PATH="C:\ghcup\msys64\mingw64\bin;C:\ghcup\msys64\usr\bin;$env:PATH"
$env:PKG_CONFIG_PATH ="C:\ghcup\msys64\mingw64\lib\pkgconfig"
$env:XDG_DATA_DIRS="C:\ghcup\msys64\mingw64\share"

works. I'm busy trying to figure out how to get this to work via modifying system environment variables.

@garetxe
Copy link
Collaborator

garetxe commented Aug 19, 2023

Thanks for digging into this! I am afraid I know very little of Windows myself, so I cannot really help, but if you figure this out please do add your findings to the wiki. I am sure other Windows users will appreciate it!

@mpilgrem
Copy link

mpilgrem commented Sep 3, 2023

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

3 participants