cabal fails to build preprocessors when used with ghcjs

Created on 21 Oct 2018  路  3Comments  路  Source: haskell/cabal

When building my language-xats library with GHCJS the following occurs:

vanessa@thinkpad ~/programming/haskell/current/language-xats 馃尭 cabal new-build --ghcjs
Warning: don't know how to find change monitoring files for the installed
package databases for ghcjs
Resolving dependencies...
Build profile: -w ghcjs-8.4.0.1 -O1
In order, the following will be built (use -v for more details):
 - alex-3.2.4 (exe:alex) (requires build)
 - happy-1.19.9 (exe:happy) (requires build)
 - prettyprinter-1.2.1 (lib) (requires build)
 - language-xats-0.1.0.0 (lib) (first run)
Starting     prettyprinter-1.2.1 (lib)
Starting     alex-3.2.4 (exe:alex)
Starting     happy-1.19.9 (all, legacy fallback)
Building     prettyprinter-1.2.1 (lib)
Building     alex-3.2.4 (exe:alex)
Installing   prettyprinter-1.2.1 (lib)
Completed    prettyprinter-1.2.1 (lib)
Installing   alex-3.2.4 (exe:alex)
Completed    alex-3.2.4 (exe:alex)
Building     happy-1.19.9 (all, legacy fallback)
Installing   happy-1.19.9 (all, legacy fallback)
Completed    happy-1.19.9 (all, legacy fallback)
Configuring library for language-xats-0.1.0.0..
cabal: The program 'alex' is required but it could not be found.

The build succeeds when I run cabal new-install alex ; cabal new-install happy.

I think that cabal should attempt to install happy and alex using GHC. I can't really see any reason that we'd want to use a node version of happy or a cross-compiled version of happy as they are preprocessors.

I believe this has been mentioned before: https://github.com/haskell/cabal/issues/4939

ghcjs

Most helpful comment

This is something that I would like (for what I can assume are similar reasons) and I鈥檒l admit that the Cabal contribution bug is itching.

I might start looking at a way to do this when I鈥檓 done with midterms this week.

All 3 comments

Yes, the fundamental issue here is that currently everything starting with cabal's solver only support a single compiler at a time. You can only pass it a single --with-compiler (and with a single compiler-type, e.g. --ghcjs/--ghc).

This is something that I would like (for what I can assume are similar reasons) and I鈥檒l admit that the Cabal contribution bug is itching.

I might start looking at a way to do this when I鈥檓 done with midterms this week.

@vmchale btw, this should work better now for alex (which doesn't have a custom Setup.hs) since 03becbdc3e326233ddf3aaed60edfa76ce642986

Was this page helpful?
0 / 5 - 0 ratings