ghcjs / ghcjs-dom

Make Document Object Model (DOM) apps that run in any browser and natively using WebKitGtk
74 stars 41 forks source link

Fails under GHCJS 8.4.0.1 with "unknown package: ghcjs-base" #84

Closed Mikolaj closed 6 years ago

Mikolaj commented 6 years ago

The log:

~/r/ghcjs-dom/ghcjs-dom-jsffi$ cabal install --ghcjs
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: ghcjs-dom-jsffi-0.9.2.0 (user goal)
unknown package: ghcjs-base (dependency of ghcjs-dom-jsffi-0.9.2.0)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: ghcjs-dom-jsffi, ghcjs-base
Mikolaj commented 6 years ago

Actually, after removing the dep from .cabal file, it seems, a ton of other changes would be required. How can I help?

Mikolaj commented 6 years ago

In particular, if I read it right, there is no more JSString (one may use JSVal instead, if really needed) and many operations are moved to https://github.com/ghcjs/ghcjs/blob/ghc-8.4/lib/ghcjs-prim/GHCJS/Prim.hs and/or to patches of the standard base package.

luite commented 6 years ago

ghcjs-base has not really been removed, it's just not installed by ghcjs-boot anymore, and it's not on hackage yet. It's intended to be a regular package now.

The reason was that ghcjs-base has quite a few dependencies. Picking/shipping a single version of those would often clash with stackage lts or nixos package versions. As a normal package it's more flexible.

luite commented 6 years ago

Some of the ghcjs-base functionality is now implemented in ghcjs-prim. These are typically low level operations, more likely to change between GHCJS versions. The ghcjs-prim package will continue to ship with the compiler.

Hopefully this will make it easier to maintain compatibility with multiple compiler versions in ghcjs-base

Mikolaj commented 6 years ago

Oh, I panicked too soon. Indeed, after installing ghcjs-base from github, ghcjs-dom compiles fine. Closing.

BTW, I wonder if ghcjs-dom-jsffi automatically takes advantage from the recent optimizations (IIRC) around (constant?) JS strings and properties?