ku-fpg / sunroof-compiler

Monadic Javascript Compiler
BSD 3-Clause "New" or "Revised" License
73 stars 6 forks source link

Can't compile with cabal install #37

Closed lucabrunox closed 11 years ago

lucabrunox commented 11 years ago

Hello, I'm on debian unstable. The Glorious Glasgow Haskell Compilation System, version 7.4.1 cabal-install version 1.16.0.2 using version 1.16.0.3 of the Cabal library

$ cabal install sunroof-compiler Resolving dependencies... Configuring sunroof-compiler-0.2... Building sunroof-compiler-0.2... Preprocessing library sunroof-compiler-0.2... [ 1 of 23] Compiling Language.Sunroof.Internal ( Language/Sunroof/Internal.hs, dist/build/Language/Sunroof/Internal.o ) [ 2 of 23] Compiling Language.Sunroof.JavaScript ( Language/Sunroof/JavaScript.hs, dist/build/Language/Sunroof/JavaScript.o ) [ 3 of 23] Compiling Language.Sunroof.Classes ( Language/Sunroof/Classes.hs, dist/build/Language/Sunroof/Classes.o ) [ 4 of 23] Compiling Language.Sunroof.JS.Bool ( Language/Sunroof/JS/Bool.hs, dist/build/Language/Sunroof/JS/Bool.o ) [ 5 of 23] Compiling Language.Sunroof.JS.Object ( Language/Sunroof/JS/Object.hs, dist/build/Language/Sunroof/JS/Object.o ) [ 6 of 23] Compiling Language.Sunroof.JS.Number ( Language/Sunroof/JS/Number.hs, dist/build/Language/Sunroof/JS/Number.o ) [ 7 of 23] Compiling Language.Sunroof.JS.String ( Language/Sunroof/JS/String.hs, dist/build/Language/Sunroof/JS/String.o ) [ 8 of 23] Compiling Language.Sunroof.Selector ( Language/Sunroof/Selector.hs, dist/build/Language/Sunroof/Selector.o ) [ 9 of 23] Compiling Language.Sunroof.Types ( Language/Sunroof/Types.hs, dist/build/Language/Sunroof/Types.o )

Language/Sunroof/Types.hs:297:10: Ambiguous constraint Sunroof r' At least one of the forall'd type variables mentioned by the constraint must be reachable from the type after the '=>' In the instance declaration forIfB (JSContinuation a)' Failed to install sunroof-compiler-0.2 cabal: Error: some packages failed to install: sunroof-compiler-0.2 failed during the building phase. The exception was: ExitFailure 1

jbracker commented 11 years ago

Thank you for reporting this problem. It should be fixed by the commit: e75a226ca537c71c76fcff684d95261638200435

Can you try to download and install the current HEAD to see if it works? I only have GHC 7.6 installed.

lucabrunox commented 11 years ago

I've cloned the repository, issued cabal install and this is the result:

Resolving dependencies... Configuring sunroof-compiler-0.2.1... Building sunroof-compiler-0.2.1... Preprocessing library sunroof-compiler-0.2.1... [ 1 of 24] Compiling Language.Sunroof.Internal ( Language/Sunroof/Internal.hs, dist/build/Language/Sunroof/Internal.o ) [ 2 of 24] Compiling Language.Sunroof.JavaScript ( Language/Sunroof/JavaScript.hs, dist/build/Language/Sunroof/JavaScript.o ) [ 3 of 24] Compiling Language.Sunroof.Classes ( Language/Sunroof/Classes.hs, dist/build/Language/Sunroof/Classes.o ) [ 4 of 24] Compiling Language.Sunroof.JS.Bool ( Language/Sunroof/JS/Bool.hs, dist/build/Language/Sunroof/JS/Bool.o ) [ 5 of 24] Compiling Language.Sunroof.JS.Object ( Language/Sunroof/JS/Object.hs, dist/build/Language/Sunroof/JS/Object.o ) [ 6 of 24] Compiling Language.Sunroof.JS.Number ( Language/Sunroof/JS/Number.hs, dist/build/Language/Sunroof/JS/Number.o ) [ 7 of 24] Compiling Language.Sunroof.JS.String ( Language/Sunroof/JS/String.hs, dist/build/Language/Sunroof/JS/String.o ) [ 8 of 24] Compiling Language.Sunroof.Selector ( Language/Sunroof/Selector.hs, dist/build/Language/Sunroof/Selector.o ) [ 9 of 24] Compiling Language.Sunroof.Types ( Language/Sunroof/Types.hs, dist/build/Language/Sunroof/Types.o ) [10 of 24] Compiling Language.Sunroof.TH ( Language/Sunroof/TH.hs, dist/build/Language/Sunroof/TH.o ) [11 of 24] Compiling Language.Sunroof.Compiler ( Language/Sunroof/Compiler.hs, dist/build/Language/Sunroof/Compiler.o )

Language/Sunroof/Compiler.hs:231:1: Warning: Defined but not used: `assignments' [12 of 24] Compiling Language.Sunroof.JS.Ref ( Language/Sunroof/JS/Ref.hs, dist/build/Language/Sunroof/JS/Ref.o ) [13 of 24] Compiling Language.Sunroof.Utils ( Language/Sunroof/Utils.hs, dist/build/Language/Sunroof/Utils.o ) [14 of 24] Compiling Language.Sunroof.JS.Browser ( Language/Sunroof/JS/Browser.hs, dist/build/Language/Sunroof/JS/Browser.o ) [15 of 24] Compiling Language.Sunroof.Concurrent ( Language/Sunroof/Concurrent.hs, dist/build/Language/Sunroof/Concurrent.o ) [16 of 24] Compiling Language.Sunroof.JS.Date ( Language/Sunroof/JS/Date.hs, dist/build/Language/Sunroof/JS/Date.o ) [17 of 24] Compiling Language.Sunroof.JS.Canvas ( Language/Sunroof/JS/Canvas.hs, dist/build/Language/Sunroof/JS/Canvas.o ) [18 of 24] Compiling Language.Sunroof.JS.JQuery ( Language/Sunroof/JS/JQuery.hs, dist/build/Language/Sunroof/JS/JQuery.o ) [19 of 24] Compiling Language.Sunroof.JS.Array ( Language/Sunroof/JS/Array.hs, dist/build/Language/Sunroof/JS/Array.o ) [20 of 24] Compiling Language.Sunroof.JS.Chan ( Language/Sunroof/JS/Chan.hs, dist/build/Language/Sunroof/JS/Chan.o ) Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package Boolean-0.2 ... linking ... done. Loading package bytestring-0.9.2.1 ... linking ... done. Loading package array-0.4.0.0 ... linking ... done. Loading package deepseq-1.3.0.0 ... linking ... done. Loading package text-0.11.2.3 ... linking ... done. Loading package hashable-1.2.0.6 ... linking ... done. Loading package containers-0.4.2.1 ... linking ... done. Loading package nats-0.1 ... linking ... done. Loading package semigroups-0.9.1 ... linking ... done. Loading package void-0.6 ... linking ... done. Loading package MemoTrie-0.6.1 ... linking ... done. Loading package NumInstances-1.3 ... linking ... done. Loading package vector-space-0.8.6 ... linking ... done. Loading package pretty-1.1.1.0 ... linking ... done. Loading package template-haskell ... linking ... done. Loading package tagged-0.6 ... linking ... done. Loading package transformers-0.3.0.0 ... linking ... done. Loading package mtl-2.1.2 ... linking ... done. Loading package old-locale-1.0.0.4 ... linking ... done. Loading package time-1.4 ... linking ... done. Loading package random-1.0.1.1 ... linking ... done. Loading package operational-0.2.2.1 ... linking ... done. Loading package data-reify-0.6 ... linking ... done. Loading package data-default-class-0.0.1 ... linking ... done. Loading package data-default-instances-base-0.0.1 ... linking ... done. Loading package data-default-instances-containers-0.0.1 ... linking ... done. Loading package dlist-0.5 ... linking ... done. Loading package data-default-instances-dlist-0.0.1 ... linking ... done. Loading package data-default-instances-old-locale-0.0.1 ... linking ... done. Loading package data-default-0.5.3 ... linking ... done.

Language/Sunroof/JS/Chan.hs:1:1:Failed to install sunroof-compiler-0.2.1 cabal: Error: some packages failed to install: sunroof-compiler-0.2.1 failed during the building phase. The exception was: ExitFailure 11

andygill commented 11 years ago

Curious. Can you try again with

cabal install -v

(I just tried this, with ghc-7.6.1, and it worked fine for me.)

andygill commented 11 years ago

% cabal install -w ghc-7.4.1

fails in the way you talked about above. It may be that you need ghc-7.6.X. We'll look into it.

lucabrunox commented 11 years ago

Thanks for you answers, let me know. I'd like to stick with debian ghc :-)

andygill commented 11 years ago

This seems to be a Template Haskell bug in 7.4. Which leaves us with

igraves commented 11 years ago

Hi Andy and Jan,

Thanks for your work looking into this issue. I ran into it myself on Ubuntu. Ubuntu up to the latest version still packages 7.4 in the apt repositories...so Ubuntu users will have some issues if they're not building/bundling their own GHC. Just wanted to throw it out there that there's a big swath of Linux users who aren't keeping up on the latest GHC builds. I got around this by switching to Arch Linux though building GHC 7.6 on an apt-Linux and installing using checkinstall is a viable alternative if you want to keep the build indexed in your local apt.

Thanks!

xich commented 11 years ago

FWIW, most distros still have 7.4 because that is what the platform bundles. The new platform with 7.6.3 should be out in ~month. On Apr 27, 2013 3:31 PM, "igraves" notifications@github.com wrote:

Hi Andy and Jan,

Thanks for your work looking into this issue. I ran into it myself on Ubuntu. Ubuntu up to the latest version still packages 7.4 in the apt repositories...so Ubuntu users will have some issues if they're not building/bundling their own GHC. Just wanted to throw it out there that there's a big swath of Linux users who aren't keeping up on the latest GHC builds. I got around this by switching to Arch Linux though building GHC 7.6 on an apt-Linux and installing using checkinstall is a viable alternative if you want to keep the build indexed in your local apt.

Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/ku-fpg/sunroof-compiler/issues/37#issuecomment-17122870 .[image: Web Bug from https://github.com/notifications/beacon/rsUqfXy0kuDFF3m6LcsWOmJY6UaRqI5R0C4mW2re-VwHTSTKoQAofkz1kvp-5iGR.gif]

ocharles commented 11 years ago

GHC 7.4 is also what's in Ubuntu LTS - so for those of who need to target that 7.4 support is a must.

jbracker commented 11 years ago

Only the JSMVar and JSChan are implemented using template Haskell. Rewriting their code is easy.

Does anybody have an Idea how soon these major distributions and the plattform will shift to GHC 7.6.*?

Is there a work around for the template Haskell issue? Maybe it might be a good Idea to move this dependency to another package sunroof-utils?

xich commented 11 years ago

Well the platform is going to 7.6.3 this month. The first RC should be out any day now.

How long it will take distros to pick up the new platform... I don't know.

ocharles commented 11 years ago

Even if distributions pick up new versions of GHC, these won't make long term support versions - which is why I think 7.4 is a must.

jbracker commented 11 years ago

I think externalizing the dependency would be a good step. We could create a package sunroof-templates that offers all of the auto-generation stuff. Andy what do you think about this? Sunroof should not be unusable, because of some random TH bug, unless somebody knows how to fix the template Haskell issues?

jbracker commented 11 years ago

I have now removed the dependency to template haskell from the sunroof-compiler package. There is a separate package sunroof-th for that. Everything is checked in to the current HEAD. Can someone see if it compiles under 7.4 now?

lucabrunox commented 11 years ago

Successfully compiles, thanks.