Open emmanueltouzery opened 9 years ago
There is the cabal exec
feature. Have you tried (from in the project's toplevel directory) :
cabal exec ghcjs-pkg list
cabal exec ghcjs Main.hs
i think you may need a line compiler: ghcjs
in your cabal sandbox config to make cabal exec
set up the package paths for ghcjs, rather than the default ghc
No, none of these changes help.
$ cat cabal.config
compiler: ghcjs
and still cabal exec ghcjs-pkg list | grep query
returns nothing, and cabal exec ghcjs test/Hello.hs
complains that it cannot find the JavaScript.JQuery
module.
Interestingly though:
$ cabal install --ghcjs ./ghcjs-jquery
Resolving dependencies...
In order, the following will be installed:
ghcjs-jquery-0.1.0.0 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Notice: installing into a sandbox located at
/home/emmanuel/programs/ghcjs/.cabal-sandbox
Configuring ghcjs-jquery-0.1.0.0...
In other words, cabal
knows that the package is installed since it warns me that a reinstallation is dangerous...
btw, just in case:
$ cabal --version
cabal-install version 1.22.4.0
using version 1.22.3.0 of the Cabal library
Also export HASKELL_PACKAGE_SANDBOX=./.cabal-sandbox/x86_64-linux-ghcjs-0.1.0-ghc7_8_3-packages.conf.d/
and export HASKELL_PACKAGE_SANDBOX=./.cabal-sandbox/x86_64-linux-ghc-7.8.3-packages.conf.d/
don't help.
hmm, there also seems to be a problem with cabal sandbox hc-pkg list
, I'll investigate, I think this used to work correctly at some point.
It works ok if you build ghcjs with ghc 7.10, both cabal exec ghcjs-pkg list
and cabal sandbox hc-pkg list
work, but two things need to be done:
compiler: ghcjs
to cabal.config
package-db
field in the generated cabal.sandbox.config
to the location that ghcjs uses(I think this is a Cabal usability issue, sandboxes haven't been designed with multiple compilers in mind)
Ok looks like i got myself the homework of installing 7.10 then :-) On 30 May 2015 13:11, "Luite Stegeman" notifications@github.com wrote:
It works ok if you build ghcjs with ghc 7.10, both cabal exec ghcjs-pkg list and cabal sandbox hc-pkg list work, but two things need to be done:
- add compiler: ghcjs to cabal.config
- change the package-db field in the generated cabal.sandbox.config to the location that ghcjs uses
(I think this is a Cabal usability issue, sandboxes haven't been designed with multiple compilers in mind)
— Reply to this email directly or view it on GitHub https://github.com/ghcjs/ghcjs/issues/353#issuecomment-107023505.
GHCJS with 7.10 is still experimental due to some problems with 7.10.1, see the wiki page for 7.10 instructions.
I have ghcjs working in a sandbox. Now I want to install ghcjs-jquery. I cloned it from github in a directory under the one where I have the ghcjs cabal sandbox. And there I ran:
And it succeeded, and installed some files:
However,
ghcjs-pkg list | grep quer
shows that ghcjs is not aware of the ghcjs-jquery package, and also compilation of a file containingimport JavaScript.JQuery
says the module can not be found.So, can I install ghcjs packages in cabal sandboxes and if yes, how? Thank you!