spell-music / csound-expression

Haskell Framework for Electronic Music
323 stars 31 forks source link

Fails to build with ghc-9.0.2 and ghc-9.2.4 #76

Closed michaelmariaott closed 8 months ago

michaelmariaott commented 2 years ago

Hello,

I followed the Introduction, but cabal install csound-expression failed due to a build error. This is the build-log:

Warning: csound-expression-dynamic.cabal:3:23: Packages with 'cabal-version:
1.12' or later should specify a specific version of the Cabal spec of the form
'cabal-version: x.y'. Use 'cabal-version: 1.22'.
Configuring library for csound-expression-dynamic-0.3.9..
Preprocessing library for csound-expression-dynamic-0.3.9..
Building library for csound-expression-dynamic-0.3.9..
[ 1 of 15] Compiling Csound.Dynamic.Tfm.DeduceTypes ( src/Csound/Dynamic/Tfm/DeduceTypes.hs, dist/build/Csound/Dynamic/Tfm/DeduceTypes.o, dist/build/Csound/Dynamic/Tfm/DeduceTypes.dyn_o )
[ 2 of 15] Compiling Csound.Dynamic.Tfm.UnfoldMultiOuts ( src/Csound/Dynamic/Tfm/UnfoldMultiOuts.hs, dist/build/Csound/Dynamic/Tfm/UnfoldMultiOuts.o, dist/build/Csound/Dynamic/Tfm/UnfoldMultiOuts.dyn_o )
[ 3 of 15] Compiling Csound.Dynamic.Types.Exp ( src/Csound/Dynamic/Types/Exp.hs, dist/build/Csound/Dynamic/Types/Exp.o, dist/build/Csound/Dynamic/Types/Exp.dyn_o )

src/Csound/Dynamic/Types/Exp.hs:397:10: error:
    • Could not deduce (Data.Functor.Classes.Eq1 (PreInline a))
        arising from the superclasses of an instance declaration
      from the context: Hashable a
        bound by the instance declaration
        at src/Csound/Dynamic/Types/Exp.hs:397:10-46
    • In the instance declaration for ‘Hashable1 (PreInline a)’
    |
397 | instance Hashable a => Hashable1 (PreInline a)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Csound/Dynamic/Types/Exp.hs:398:10: error:
    • Could not deduce (Data.Functor.Classes.Eq1 (Inline a))
        arising from the superclasses of an instance declaration
      from the context: Hashable a
        bound by the instance declaration
        at src/Csound/Dynamic/Types/Exp.hs:398:10-43
    • In the instance declaration for ‘Hashable1 (Inline a)’
    |
398 | instance Hashable a => Hashable1 (Inline a)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Csound/Dynamic/Types/Exp.hs:399:10: error:
    • No instance for (Data.Functor.Classes.Eq1 RatedExp)
        arising from the superclasses of an instance declaration
    • In the instance declaration for ‘Hashable1 RatedExp’
    |
399 | instance Hashable1 RatedExp
    |          ^^^^^^^^^^^^^^^^^^

src/Csound/Dynamic/Types/Exp.hs:400:10: error:
    • No instance for (Data.Functor.Classes.Eq1 MainExp)
        arising from the superclasses of an instance declaration
    • In the instance declaration for ‘Hashable1 MainExp’
    |
400 | instance Hashable1 MainExp
    |          ^^^^^^^^^^^^^^^^^

src/Csound/Dynamic/Types/Exp.hs:401:10: error:
    • No instance for (Data.Functor.Classes.Eq1 PrimOr)
        arising from the superclasses of an instance declaration
    • In the instance declaration for ‘Hashable1 PrimOr’
    |
401 | instance Hashable1 PrimOr
    |          ^^^^^^^^^^^^^^^^
cabal: Failed to build csound-expression-dynamic-0.3.9 (which is required by
csound-expression-5.4.3). See the build log above for details.
jwaldmann commented 2 years ago

I confirm this happens when building with ghc-9.0.2 and ghc-9.2.4. I can build with ghc-8.10.7.

I recommend that this issue's title mentions the error message, and that the text (if not the title) mentions the compiler version. I think it's got nothing do to with a specific OS.

Anyway the issue seems to be known, and fixed: https://github.com/spell-music/csound-expression/pull/68 but it's not on hackage?

So, one way to build with ghc-9 is:

git clone https://github.com/spell-music/csound-expression/
cd csound-expression
cabal install --lib all
anton-k commented 1 year ago

Sorry for late reply, I've tried stackage LTS-20.5 with ghc 9.2.5 and it compiles

I've uploaded updated version to master. It needs no change in the code but the version of depndnecy data-fix had to be updated.

Also library can be built with stack by cloning the repo:

git clone https://github.com/spell-music/csound-expression/
cd csound-expression
make build
anton-k commented 1 year ago

I guess this issue is related: https://github.com/spell-music/csound-expression/issues/72

So the problim is caused by the hashable package

jwaldmann commented 1 year ago

I see. So the way to build (from hackage) currently is

cabal install --lib csound-expression  -w /opt/ghc/ghc-9.2.5/bin/ghc  --constraint "hashable<1.3.4"

This (old hashable) also pins text to a pre-2 version (and that can't be built with base of ghc-9.4) Ah well.

anton-k commented 1 year ago

I've updated the package on github repo. Fixed lots of bugs an updated it to the new GHC. I plan to remove hashable dependency.

But Ihavn't uploaded the new version to hackage yet. I will release when I fix one issue. So it can be installed that way for a while

georgefst commented 11 months ago

I guess you still haven't fixed that one issue?

Love this package, and would be great to see an up-to-date working version on Hackage again!

anton-k commented 11 months ago

ok, i'll give it a try

anton-k commented 8 months ago

Please use newer versions of the ghc. Fixed today to work for ghc 9.6.4 and 9.8