I am trying to build gi-gtk-4.0.8 on Windows10 through stack. But the latest LTS version is only 3.0.41. which I am able to build. I see for example that for ArchLinux version 4.0.8 is available, looking at the hackage website. I have installed the 22.18 LTS version, along with the 3.0.41 gi-gtk package.
Could you point me in the right direction? I’m somewhat new to programming and I don’t know what I’m doing wrong. Thank you
I uploaded a picture of the listed versions of gi-gtk found on Hackage.enter image description here
My GHC version is 9.6.4, using Stack 2.13.1
I am trying to code with the Haskell language.
At first I tried modifying the package.yaml file, in the dependencies I specified to use – gi-gtk >= 4.0 && <5 (https://i.stack.imgur.com/tj25w.png)
But it threw the error:
stack build
Error: [S-4804]
Stack failed to construct a build plan.
While constructing the build plan, Stack encountered the following errors. The 'Stack
configuration' refers to the set of package versions specified by the snapshot (after any
dropped packages, or pruned GHC boot packages; if a boot package is replaced, Stack prunes
all other such packages that depend on it) and any extra-deps:
In the dependencies for gtk-intro-seven-0.1.0.0:
* gi-gtk must match >=4.0 && <5, but gi-gtk-3.0.41 is in the Stack configuration (latest
matching version is 4.0.8).
needed since gtk-intro-seven is a build target.
Some different approaches to resolving some or all of this:
* To ignore all version constraints and build anyway, in
C:UsersbuAppDataRoamingstackconfig.yaml (global configuration) or
D:stack-projectsgtk-intro-sevenstack.yaml (project-level configuration), set
allow-newer: true.
* To ignore certain version constraints and build anyway, also add these package names
under allow-newer-deps: gtk-intro-seven.
* Recommended action: try adding the following to your extra-deps in
D:stack-projectsgtk-intro-sevenstack.yaml (project-level configuration):
- gi-gtk-4.0.8@sha256:6011c2d7880c6f9b1a319a593db6b76e5175b3f020fc4b3ca86707ee70c3a1d8,35759
Compilation exited abnormally with code 1 at Wed Apr 24 15:14:13
I then tried modifying the extra-deps in stack.yaml adding the suggested – gi-gtk-4.0.8@sha256:6011c2d7880c6f9b1a319a593db6b76e5175b3f020fc4b3ca86707ee70c3a1d8,35759
But it threw the error:
stack build
Error: [S-4804]
Stack failed to construct a build plan.
While constructing the build plan, Stack encountered the following errors. The 'Stack
configuration' refers to the set of package versions specified by the snapshot (after any
dropped packages, or pruned GHC boot packages; if a boot package is replaced, Stack prunes
all other such packages that depend on it) and any extra-deps:
In the dependencies for gi-gtk-4.0.8:
* gi-gdk must match >=4.0 && <4.1, but gi-gdk-3.0.28 is in the Stack configuration (latest
matching version is 4.0.7).
* gi-gsk must match >=4.0 && <4.1, but no version is in the Stack configuration (latest
matching version is 4.0.7).
needed due to gtk-intro-seven-0.1.0.0 -> gi-gtk-4.0.8
Some different approaches to resolving some or all of this:
* To ignore certain version constraints and build anyway, in
C:UsersbuAppDataRoamingstackconfig.yaml (global configuration) or
D:stack-projectsgtk-intro-sevenstack.yaml (project-level configuration), set
allow-newer: true and add these package names under allow-newer-deps: gi-gtk.
* Recommended action: try adding the following to your extra-deps in
D:stack-projectsgtk-intro-sevenstack.yaml (project-level configuration):
- gi-gdk-4.0.7@sha256:e1915be39e2eebaf445584986dea7b750aef57c00894d1a218a54811da27b381,9025
- gi-gsk-4.0.7@sha256:1c96f0d0fdc39b1dfa3314cb00e57cb39931bd7f1a125fb0890435fcae624952,7393
Compilation exited abnormally with code 1 at Wed Apr 24 14:56:30
Again I modified, as suggested, the stack.yaml setting allow-newer: true and allow-newer-deps: gi-gtk
But it threw the error
stack build
Warning: Ignoring gi-gtk's bounds on gi-gdk (>=4.0 && <4.1) and using gi-gdk-3.0.28.
Reason: gi-gtk is an allow-newer-dep and allow-newer enabled.
Error: [S-4804]
Stack failed to construct a build plan.
While constructing the build plan, Stack encountered the following errors. The 'Stack
configuration' refers to the set of package versions specified by the snapshot (after any
dropped packages, or pruned GHC boot packages; if a boot package is replaced, Stack prunes
all other such packages that depend on it) and any extra-deps:
In the dependencies for gi-gtk-4.0.8:
* gi-gsk must match >=4.0 && <4.1, but no version is in the Stack configuration (latest
matching version is 4.0.7).
needed due to gtk-intro-seven-0.1.0.0 -> gi-gtk-4.0.8
Some different approaches to resolving some or all of this:
* Recommended action: try adding the following to your extra-deps in
D:stack-projectsgtk-intro-sevenstack.yaml (project-level configuration):
- gi-gsk-4.0.7@sha256:1c96f0d0fdc39b1dfa3314cb00e57cb39931bd7f1a125fb0890435fcae624952,7393
Compilation exited abnormally with code 1 at Wed Apr 24 15:02:06
At this point it feels as if it is going in circles as even after trying to add the suggested – gi-gsk-4.0.7@sha256:1c96f0d0fdc39b1dfa3314cb00e57cb39931bd7f1a125fb0890435fcae624952 to stack.yaml it throws the error
stack build
Warning: Ignoring gi-gtk's bounds on gi-gdk (>=4.0 && <4.1) and using gi-gdk-3.0.28.
Reason: gi-gtk is an allow-newer-dep and allow-newer enabled.
Warning: Not ignoring gi-gsk's bounds on gi-gdk (>=4.0 && <4.1) and using gi-gdk-3.0.28.
Reason: gi-gsk is not an allow-newer-dep although allow-newer enabled.
Error: [S-4804]
Stack failed to construct a build plan.
While constructing the build plan, Stack encountered the following errors. The 'Stack
configuration' refers to the set of package versions specified by the snapshot (after any
dropped packages, or pruned GHC boot packages; if a boot package is replaced, Stack prunes
all other such packages that depend on it) and any extra-deps:
In the dependencies for gi-gsk-4.0.7:
* gi-gdk must match >=4.0 && <4.1, but gi-gdk-3.0.28 is in the Stack configuration (latest
matching version is 4.0.7).
needed due to gtk-intro-seven-0.1.0.0 -> gi-gsk-4.0.7
Some different approaches to resolving some or all of this:
* To ignore all version constraints and build anyway, in
C:UsersbuAppDataRoamingstackconfig.yaml (global configuration) or
D:stack-projectsgtk-intro-sevenstack.yaml (project-level configuration), set
allow-newer: true.
* To ignore certain version constraints and build anyway, also add these package names
under allow-newer-deps: gi-gsk.
* Recommended action: try adding the following to your extra-deps in
D:stack-projectsgtk-intro-sevenstack.yaml (project-level configuration):
- gi-gdk-4.0.7@sha256:e1915be39e2eebaf445584986dea7b750aef57c00894d1a218a54811da27b381,9025
Compilation exited abnormally with code 1 at Wed Apr 24 15:04:43
I tried adding gi-gsk in the allow-newer-deps, it did start compiling but I got an error saying > [3 of 3] Linking C:Users(myusername)AppDataLocalTempstack-a9e044207bc0d717gi-graphene-1.0.7.stack-workdistab060f89setupsetup.exe
gi-graphene > Did not find a GI repository for Graphene-1.0 in [“C:Program Filesgir-1.0″,”/opt/homebrew/share/gir-1.0”].
Although it is compiling and it is saying it’s ignoring the bounds on gi-gdk, it still falls back on the gi-gdk-3.0.28 version. 🙁
Here’s the full message
stack build
Warning: Ignoring gi-gtk's bounds on gi-gdk (>=4.0 && <4.1) and using gi-gdk-3.0.28.
Reason: gi-gtk is an allow-newer-dep and allow-newer enabled.
Warning: Ignoring gi-gsk's bounds on gi-gdk (>=4.0 && <4.1) and using gi-gdk-3.0.28.
Reason: gi-gsk is an allow-newer-dep and allow-newer enabled.
blaze-builder > using precompiled package
cabal-doctest > using precompiled package
colour > using precompiled package
data-default-class > using precompiled package
haskell-gi-base > using precompiled package
haskell-gi-overloading> using precompiled package
haskell-lexer > using precompiled package
integer-logarithms > using precompiled package
os-string > using precompiled package
primitive > using precompiled package
regex-base > using precompiled package
happy > configure
happy > Configuring happy-1.20.1.1...
blaze-markup > using precompiled package
safe > using precompiled package
ansi-terminal-types > using precompiled package
split > using precompiled package
splitmix > using precompiled package
unliftio-core > using precompiled package
vector-stream > using precompiled package
xdg-basedir > using precompiled package
happy > build
hashable > using precompiled package
happy > Preprocessing executable 'happy' for happy-1.20.1.1..
happy > Building executable 'happy' for happy-1.20.1.1..
xml-types > using precompiled package
regex-tdfa > using precompiled package
blaze-html > using precompiled package
zlib > using precompiled package
ansi-terminal > using precompiled package
random > using precompiled package
resourcet > using precompiled package
vector > using precompiled package
async > using precompiled package
scientific > using precompiled package
unordered-containers > using precompiled package
happy > [ 1 of 19] Compiling AbsSyn
happy > [ 2 of 19] Compiling GenUtils
happy > [ 3 of 19] Compiling NameSet
happy > [ 4 of 19] Compiling ParamRules
temporary > using precompiled package
happy > [ 5 of 19] Compiling ParseMonad
happy > [ 6 of 19] Compiling Lexer
bitvec > using precompiled package
typed-process > using precompiled package
attoparsec > using precompiled package
network > using precompiled package
happy > [ 7 of 19] Compiling AttrGrammar
vector-algorithms > using precompiled package
happy > [ 8 of 19] Compiling AttrGrammarParser
happy > [ 9 of 19] Compiling Grammar
streaming-commons > using precompiled package
mono-traversable > using precompiled package
conduit > using precompiled package
happy > [10 of 19] Compiling LALR
conduit-extra > using precompiled package
xml-conduit > using precompiled package
happy > [11 of 19] Compiling First
happy > [12 of 19] Compiling Parser
happy > [13 of 19] Compiling Paths_happy
happy > [14 of 19] Compiling Info
happy > [15 of 19] Compiling PrettyGrammar
happy > [16 of 19] Compiling ProduceGLRCode
happy > [17 of 19] Compiling Target
happy > [18 of 19] Compiling ProduceCode
happy > [19 of 19] Compiling Main
happy >
happy > C:UsersbuAppDataLocalTempstack-a9e044207bc0d717happy-1.20.1.1srcMain.lhs:35:3: warning: [-Wunused-imports]
happy > The import of `Foreign.Marshal.Array' is redundant
happy > except perhaps to import instances from `Foreign.Marshal.Array'
happy > To import instances alone, use: import Foreign.Marshal.Array()
happy > |
happy > 35 | > import Foreign.Marshal.Array
happy > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
happy >
happy > C:UsersbuAppDataLocalTempstack-a9e044207bc0d717happy-1.20.1.1srcMain.lhs:36:3: warning: [-Wunused-imports]
happy > The import of `Foreign' is redundant
happy > except perhaps to import instances from `Foreign'
happy > To import instances alone, use: import Foreign()
happy > |
happy > 36 | > import Foreign
happy > | ^^^^^^^^^^^^^^
happy >
happy > C:UsersbuAppDataLocalTempstack-a9e044207bc0d717happy-1.20.1.1srcMain.lhs:37:3: warning: [-Wunused-imports]
happy > The import of `Foreign.C' is redundant
happy > except perhaps to import instances from `Foreign.C'
happy > To import instances alone, use: import Foreign.C()
happy > |
happy > 37 | > import Foreign.C
happy > | ^^^^^^^^^^^^^^^^
happy > [20 of 20] Linking .stack-workdistab060f89buildhappyhappy.exe
happy > copy/register
happy > Installing executable happy in C:UsersbuAppDataRoamingstacksnapshots9d56189bbin
pretty-show > configure
pretty-show > Configuring pretty-show-1.10...
pretty-show > build
pretty-show > Preprocessing library for pretty-show-1.10..
pretty-show > Building library for pretty-show-1.10..
pretty-show > [1 of 6] Compiling Paths_pretty_show
pretty-show > [2 of 6] Compiling Text.Show.Value
pretty-show >
pretty-show > C:UsersbuAppDataLocalTempstack-a9e044207bc0d717pretty-show-1.10TextShowValue.hs:84:27: warning: [GHC-62161] [-Wincomplete-uni-patterns]
pretty-show > Pattern match(es) are non-exhaustive
pretty-show > In a pattern binding: Patterns of type `[Value]' not matched: []
pretty-show > |
pretty-show > 84 | | otherwise -> do ~(v1:vs1) <- delMany (v:vs)
pretty-show > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
pretty-show >
pretty-show > C:UsersbuAppDataLocalTempstack-a9e044207bc0d717pretty-show-1.10TextShowValue.hs:93:25: warning: [GHC-62161] [-Wincomplete-uni-patterns]
pretty-show > Pattern match(es) are non-exhaustive
pretty-show > In a pattern binding:
pretty-show > Patterns of type `[Value]' not matched:
pretty-show > []
pretty-show > [_]
pretty-show > (_:_:_:_)
pretty-show > |
pretty-show > 93 | Ratio v1 v2 -> do ~[a,b] <- delMany [v1,v2]
pretty-show > | ^^^^^^^^^^^^^^^^^^^^^^^^^
pretty-show > [3 of 6] Compiling Text.Show.PrettyVal
pretty-show > [4 of 6] Compiling Text.Show.Parser
pretty-show > [5 of 6] Compiling Text.Show.Html
pretty-show >
pretty-show > C:UsersbuAppDataLocalTempstack-a9e044207bc0d717pretty-show-1.10TextShowHtml.hs:112:1: warning: [-Wunused-top-binds]
pretty-show > Defined but not used: `tallTuple'
pretty-show > |
pretty-show > 112 | tallTuple els = table "tallTuple" $ map (tr . return . td) els
pretty-show > | ^^^^^^^^^
pretty-show > [6 of 6] Compiling Text.Show.Pretty
pretty-show >
pretty-show > C:UsersbuAppDataLocalTempstack-a9e044207bc0d717pretty-show-1.10TextShowPretty.hs:52:22: warning: [-Wunused-imports]
pretty-show > The import of `Foldable' from module `Data.Foldable' is redundant
pretty-show > |
pretty-show > 52 | import Data.Foldable(Foldable,toList)
pretty-show > | ^^^^^^^^
pretty-show > Preprocessing executable 'ppsh' for pretty-show-1.10..
pretty-show > Building executable 'ppsh' for pretty-show-1.10..
pretty-show > [1 of 2] Compiling Main
pretty-show > [2 of 2] Compiling Paths_pretty_show
pretty-show > [3 of 3] Linking .stack-workdistab060f89buildppshppsh.exe
pretty-show > copy/register
pretty-show > Installing library in C:UsersbuAppDataRoamingstacksnapshots9d56189blibx86_64-windows-ghc-9.6.4pretty-show-1.10-7QJQR28ntpqAaVVCcnieFO
pretty-show > Installing executable ppsh in C:UsersbuAppDataRoamingstacksnapshots9d56189bbin
pretty-show > Registering library for pretty-show-1.10..
haskell-gi > using precompiled package
gi-cairo > using precompiled package
gi-freetype2 > using precompiled package
gi-glib > using precompiled package
gi-gmodule > using precompiled package
gi-gobject > using precompiled package
gi-gio > using precompiled package
gi-harfbuzz > using precompiled package
gi-atk > using precompiled package
gi-gdkpixbuf > using precompiled package
gi-pango > using precompiled package
gi-gdk > using precompiled package
gi-graphene > configure
gi-graphene > [1 of 3] Compiling Main ( C:UsersbuAppDataLocalTempstack-a9e044207bc0d717gi-graphene-1.0.7Setup.hs, C:UsersbuAppDataLocalTempstack-a9e044207bc0d717gi-graphene-1.0.7.stack-workdistab060f89setupMain.o )
gi-graphene > [2 of 3] Compiling StackSetupShim ( C:UsersbuAppDataRoamingstacksetup-exe-srcsetup-shim-9p6GVs8J.hs, C:UsersbuAppDataLocalTempstack-a9e044207bc0d717gi-graphene-1.0.7.stack-workdistab060f89setupStackSetupShim.o )
gi-graphene > [3 of 3] Linking C:UsersbuAppDataLocalTempstack-a9e044207bc0d717gi-graphene-1.0.7.stack-workdistab060f89setupsetup.exe
gi-graphene > Did not find a GI repository for Graphene-1.0 in ["C:\Program Files\gir-1.0","/opt/homebrew/share/gir-1.0"].
gi-graphene > CallStack (from HasCallStack):
gi-graphene > error, called at libDataGIGIRRepository.hs:94:20 in haskell-gi-0.26.8-BZLvOUaH1kP82JAb00n5xq:Data.GI.GIR.Repository
Error: [S-7282]
Stack failed to execute the build plan.
While executing the build plan, Stack encountered the error:
[S-7011]
While building package gi-graphene-1.0.7 (scroll up to its section to see the error) using:
C:UsersbuAppDataLocalTempstack-a9e044207bc0d717gi-graphene-1.0.7.stack-workdistab060f89setupsetup --verbose=1 --builddir=.stack-workdistab060f89 configure --with-ghc=C:UsersbuAppDataLocalProgramsstackx86_64-windowsghc-9.6.4binghc-9.6.4.exe --with-ghc-pkg=C:UsersbuAppDataLocalProgramsstackx86_64-windowsghc-9.6.4binghc-pkg-9.6.4.exe --user --package-db=clear --package-db=global --package-db=C:UsersbuAppDataRoamingstacksnapshots9d56189bpkgdb --libdir=C:UsersbuAppDataRoamingstacksnapshots9d56189blib --bindir=C:UsersbuAppDataRoamingstacksnapshots9d56189bbin --datadir=C:UsersbuAppDataRoamingstacksnapshots9d56189bshare --libexecdir=C:UsersbuAppDataRoamingstacksnapshots9d56189blibexec --sysconfdir=C:UsersbuAppDataRoamingstacksnapshots9d56189betc --docdir=C:UsersbuAppDataRoamingstacksnapshots9d56189bdocgi-graphene-1.0.7 --htmldir=C:UsersbuAppDataRoamingstacksnapshots9d56189bdocgi-graphene-1.0.7 --haddockdir=C:UsersbuAppDataRoamingstacksnapshots9d56189bdocgi-graphene-1.0.7 --dependency=Cabal=Cabal-3.10.1.0 --dependency=base=base-4.18.2.0 --dependency=bytestring=bytestring-0.11.5.3 --dependency=containers=containers-0.6.7 --dependency=gi-glib=gi-glib-2.0.29-LSlYN00ugpvDuZbItzaRkx --dependency=gi-gobject=gi-gobject-2.0.30-Jg9NCcBQUdtHGMnuLld8Lp --dependency=haskell-gi=haskell-gi-0.26.8-BZLvOUaH1kP82JAb00n5xq --dependency=haskell-gi-base=haskell-gi-base-0.26.4-KnYJdEEMlhpJUcSA5ahpRO --dependency=haskell-gi-overloading=haskell-gi-overloading-1.0-6w3IXGDooXgu3RA2LfTuf --dependency=text=text-2.0.2 --dependency=transformers=transformers-0.6.1.0 --extra-include-dirs=C:UsersbuAppDataLocalProgramsstackx86_64-windowsmsys2-20230526mingw64include --extra-lib-dirs=C:UsersbuAppDataLocalProgramsstackx86_64-windowsmsys2-20230526mingw64lib --extra-lib-dirs=C:UsersbuAppDataLocalProgramsstackx86_64-windowsmsys2-20230526mingw64bin --exact-configuration --ghc-option=-fhide-source-paths
Process exited with code: ExitFailure 1
Compilation exited abnormally with code 1 at Wed Apr 24 15:29:16
Ciuppo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.