Not in scope Map.unionWithKey

15 views
Skip to first unread message

Lukas

unread,
Feb 13, 2018, 4:41:18 AM2/13/18
to Shake build system
I just ran cabal install Shake to install the latest release.

What I get is:

> cabal install Shake
Resolving dependencies...
Configuring shake-0.16.1...
Building shake-0.16.1...
Failed to install shake-0.16.1
Build log ( /home/xxx/.cabal/logs/shake-0.16.1.log ):
Configuring shake-0.16.1...
Preprocessing executable 'shake' for shake-0.16.1..
Building executable 'shake' for shake-0.16.1..
Warning: Enabling workaround for Main module 'Run' listed in 'other-modules'
illegaly!
[ 1 of 56] Compiling General.Bilist ( src/General/Bilist.hs, dist/build/shake/shake-tmp/General/Bilist.o )
[ 2 of 56] Compiling General.Template ( src/General/Template.hs, dist/build/shake/shake-tmp/General/Template.o )
[ 3 of 56] Compiling General.Concurrent ( src/General/Concurrent.hs, dist/build/shake/shake-tmp/General/Concurrent.o )
[ 4 of 56] Compiling General.ListBuilder ( src/General/ListBuilder.hs, dist/build/shake/shake-tmp/General/ListBuilder.o )
[ 5 of 56] Compiling General.Bag ( src/General/Bag.hs, dist/build/shake/shake-tmp/General/Bag.o )
[ 6 of 56] Compiling General.Binary ( src/General/Binary.hs, dist/build/shake/shake-tmp/General/Binary.o )
[ 7 of 56] Compiling General.Cleanup ( src/General/Cleanup.hs, dist/build/shake/shake-tmp/General/Cleanup.o )
[ 8 of 56] Compiling Development.Shake.Internal.Core.Monad ( src/Development/Shake/Internal/Core/Monad.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/Core/Monad.o )
[ 9 of 56] Compiling General.GetOpt ( src/General/GetOpt.hs, dist/build/shake/shake-tmp/General/GetOpt.o )
[10 of 56] Compiling Paths_shake ( dist/build/shake/autogen/Paths_shake.hs, dist/build/shake/shake-tmp/Paths_shake.o )
[11 of 56] Compiling Development.Shake.FilePath ( src/Development/Shake/FilePath.hs, dist/build/shake/shake-tmp/Development/Shake/FilePath.o )
[12 of 56] Compiling Development.Shake.Internal.CmdOption ( src/Development/Shake/Internal/CmdOption.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/CmdOption.o )
[13 of 56] Compiling Development.Shake.Classes ( src/Development/Shake/Classes.hs, dist/build/shake/shake-tmp/Development/Shake/Classes.o )
[14 of 56] Compiling General.Intern ( src/General/Intern.hs, dist/build/shake/shake-tmp/General/Intern.o )
[15 of 56] Compiling General.Ids ( src/General/Ids.hs, dist/build/shake/shake-tmp/General/Ids.o )
[16 of 56] Compiling Development.Shake.Internal.Progress ( src/Development/Shake/Internal/Progress.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/Progress.o )
[17 of 56] Compiling Development.Shake.Internal.Errors ( src/Development/Shake/Internal/Errors.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/Errors.o )
[18 of 56] Compiling Development.Shake.Internal.Value ( src/Development/Shake/Internal/Value.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/Value.o )
[19 of 56] Compiling Development.Shake.Internal.FilePattern ( src/Development/Shake/Internal/FilePattern.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/FilePattern.o )
[20 of 56] Compiling Development.Shake.Internal.Options ( src/Development/Shake/Internal/Options.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/Options.o )
[21 of 56] Compiling Development.Shake.Internal.Core.Rendezvous ( src/Development/Shake/Internal/Core/Rendezvous.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/Core/Rendezvous.o )
[22 of 56] Compiling Development.Shake.Internal.FileName ( src/Development/Shake/Internal/FileName.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/FileName.o )
[23 of 56] Compiling Development.Shake.Internal.FileInfo ( src/Development/Shake/Internal/FileInfo.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/FileInfo.o )
[24 of 56] Compiling General.Makefile ( src/General/Makefile.hs, dist/build/shake/shake-tmp/General/Makefile.o )
[25 of 56] Compiling General.Timing ( src/General/Timing.hs, dist/build/shake/shake-tmp/General/Timing.o )
[26 of 56] Compiling General.Extra ( src/General/Extra.hs, dist/build/shake/shake-tmp/General/Extra.o )
[27 of 56] Compiling General.Process ( src/General/Process.hs, dist/build/shake/shake-tmp/General/Process.o )
[28 of 56] Compiling Development.Shake.Internal.Core.Pool ( src/Development/Shake/Internal/Core/Pool.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/Core/Pool.o )
[29 of 56] Compiling Development.Shake.Internal.Resource ( src/Development/Shake/Internal/Resource.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/Resource.o )
[30 of 56] Compiling Development.Shake.Internal.Profile ( src/Development/Shake/Internal/Profile.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/Profile.o )
[31 of 56] Compiling General.Chunks ( src/General/Chunks.hs, dist/build/shake/shake-tmp/General/Chunks.o )
[32 of 56] Compiling General.FileLock ( src/General/FileLock.hs, dist/build/shake/shake-tmp/General/FileLock.o )
[33 of 56] Compiling Development.Shake.Internal.Core.Storage ( src/Development/Shake/Internal/Core/Storage.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/Core/Storage.o )
[34 of 56] Compiling Development.Shake.Internal.Core.Database ( src/Development/Shake/Internal/Core/Database.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/Core/Database.o )
[35 of 56] Compiling Development.Shake.Internal.Core.Types ( src/Development/Shake/Internal/Core/Types.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/Core/Types.o )
[36 of 56] Compiling Development.Shake.Internal.Core.Rules ( src/Development/Shake/Internal/Core/Rules.hs, dist/build/shake/shake-tmp/Development/Shake/Internal/Core/Rules.o )

src/Development/Shake/Internal/Core/Rules.hs:107:70:
Not in scope: `Map.unionWithKey'
Perhaps you meant `Map.unionWith' (imported from Data.HashMap.Strict)
cabal: Error: some packages failed to install:
shake-0.16.1 failed during the building phase. The exception was:
ExitFailure 1


Does anyone has an Idea?

Kind regards

Lukas

unread,
Feb 13, 2018, 5:01:56 AM2/13/18
to Shake build system

I had to install a newer version of ghc in order to update unordered-containers to 0.2.9 (0.2.8 was not enogh)

Neil Mitchell

unread,
Feb 13, 2018, 5:04:58 AM2/13/18
to Lukas, Shake build system
Hi Lukas,

Sorry for the issue!

Which version of GHC were you previously on? What was the failure when
building with 0.2.8? I just checked the dependency information and
came to the conclusion that 0.2.7 should be sufficient.

Thanks, Neil

Neil Mitchell

unread,
Feb 13, 2018, 6:54:06 AM2/13/18
to Lukas, Shake build system
Hi Lukas,

I was able to build with 0.2.7, so I'm pretty sure that's the minimum
lower bound. I have revised shake-0.16.1, and also pushed out
shake-0.16.2 with the fix properly committed.

Thanks for letting me know, most appreciated!

Thanks, Neil

Lukas

unread,
Feb 14, 2018, 2:16:51 AM2/14/18
to Shake build system
Sorry accidentally I did not answer to the mailing list first.

Yes you are right, at that time I had two versions and I took an incorrect version 0.2.8-version. I was first using a pretty old pre-installed version (I think it was a 7.6.3 version). Thanks a lot for the update.


I have now tested shake with my project (using build.ninja as a start). Unfortunately it did not work with those targets generated with CMAKE_AUTORCC. For all those targets, I get the following error:

> shake -VV
# Project
# CMakeFiles/Project.dir/CMakeFiles/Project.dir/qrc_resources.cpp.o
# CMakeFiles/Project.dir/qrc_resources.cpp
# CMakeFiles/Project_automoc CMakeFiles/Project.dir/qrc_resources.cpp
Automatic rcc for target Project
cd /home/... && /opt/kcmake34/bin/cmake -E cmake_autogen /home/...CMakeFiles/Project_automoc.dir/ ""
shake: Error when running Shake build system:
* Project
* CMakeFiles/Project.dir/CMakeFiles/Project.dir/qrc_resources.cpp.o
* CMakeFiles/Project.dir/qrc_resources.cpp
Prelude.!!: index too large

I have reduced the problem to the following simple standalone build.ninja:

ninja_required_version = 1.5
build test : phony a b
rule CUSTOM_COMMAND
command = $COMMAND
build a b : CUSTOM_COMMAND
COMMAND = cd

With ninja, this works without an error. With shake I get:

# cd (for a b)
shake: Error when running Shake build system:
* b
Prelude.!!: index too large

This is caused by Internal/Rules/Files.hs, Line 187. I have no idea what to change.

Best, Lukas

Neil Mitchell

unread,
Feb 14, 2018, 4:24:52 AM2/14/18
to Lukas, Shake build system
Hi Lukas,

Thanks for the test case - that's awesome! I'll take a closer look.
I've raised a bug at https://github.com/ndmitchell/shake/issues/565,
partly so that any updates etc as a result are recorded in one central
place.

Thanks, Neil

Neil Mitchell

unread,
Feb 16, 2018, 4:38:19 PM2/16/18
to Lukas, Shake build system
Hi Lukas,

The issue is now solved, and I've updated the ticket. The problem is
that Ninja rules don't have to create their contents - so even though
build a b says it creates a and b, it actually doesn't. Shake on the
other hand demands that files are created. There is a flag for Shake
to have Ninja compatible behaviour, but I had messed it up in relation
to multi-file rules, and since it's only used through the Ninja
pieces, I hadn't noticed.

Given you are using Shake for the Ninja stuff, would it be convenient
if I uploaded shake.exe binaries to github? Then you could avoid
compiling Shake yourself.

Thanks, Neil

Lukas Mosimann

unread,
Feb 18, 2018, 11:30:29 AM2/18/18
to Neil Mitchell, Shake build system
Hi Neil,

Thanks for solving the issue! I also detected this such my horrible but quick workaround was to just create these files (CMake generates a ninja-rule CUSTOM_COMMAND with "command = $command", which I then extended to command = touch $out; $command). I will try the new version tomorrow, but I am quite certain that everything works great by now.

I think given that many people will not have a preinstalled ghc, providing the executables would lower the hurden a lot to just give shake a try. Additionally, your ninja-backend has the benefit of quite useful report that is generated, which is a great argument for your build system.

Therefore, I think there is nothing against uploading a compiled version for the common operating systems.

Best, Lukas
Reply all
Reply to author
Forward
0 new messages