The bounds for compatible versions of hslua are stated as being
hslua >= 1.0 && < 1.2
but this is not correct - in fact, hslua-aeson 1.0.2 fails to build with hslua 1.1.1.
Reproducing
Unpack hslua-aeson 1.0.2 from hackage, cd in
$ cabal v2-configure --constraint 'hslua ==1.1.1'
$ cabal v2-build
Expected result
The package should build without error.
Actual result
The build fails with the following error:
[1 of 1] Compiling Foreign.Lua.Aeson ( src/Foreign/Lua/Aeson.hs, /mnt/data/dev/uwa-marking-scripts/hs-marker-database-hint/XXX/hslua-aeson-1.0.2/dist-newstyle/build/x86_64-linux/ghc-8.6.5/hslua-aeson-1.0.2/build/Foreign/Lua/Aeson.o )
src/Foreign/Lua/Aeson.hs:131:3: error:
• Couldn't match expected type ‘Lua a1’
with actual type ‘[a0] -> Lua ()’
• In a stmt of a 'do' block: pushList . toList $ v
In the expression:
do pushList . toList $ v
push (fromIntegral (Vector.length v) :: Lua.Integer)
rawseti (- 2) 0
In an equation for ‘pushvector’:
pushvector v
= do pushList . toList $ v
push (fromIntegral (Vector.length v) :: Lua.Integer)
rawseti (- 2) 0
|
131 | pushList . toList $ v
| ^^^^^^^^^^^^^^^^^^^^^
src/Foreign/Lua/Aeson.hs:131:14: error:
• Couldn't match type ‘[a]’ with ‘a0 -> Lua ()’
Expected type: Vector a -> Foreign.Lua.Push.Pusher a0
Actual type: Vector a -> [a]
• In the second argument of ‘(.)’, namely ‘toList’
In the expression: pushList . toList
In a stmt of a 'do' block: pushList . toList $ v
• Relevant bindings include
v :: Vector a (bound at src/Foreign/Lua/Aeson.hs:130:12)
pushvector :: Vector a -> Lua ()
(bound at src/Foreign/Lua/Aeson.hs:130:1)
|
131 | pushList . toList $ v
| ^^^^^^
The bounds for compatible versions of hslua are stated as being
but this is not correct - in fact, hslua-aeson 1.0.2 fails to build with hslua 1.1.1.
Reproducing
cd
in$ cabal v2-configure --constraint 'hslua ==1.1.1'
$ cabal v2-build
Expected result
The package should build without error.
Actual result
The build fails with the following error:
Gist of the failing build is here.
Cause
This is because hslua 1.1.1 introduces breaking changes - the signature of
Foreign.Lua.pushList
has changed (see https://github.com/hslua/hslua/issues/83).A fix is to apply the following patch:
If you like, I can submit a pull request of the change from here.