haskell / haskell/cabal

cabal fails to build preprocessors when used with ghcjs

Open
#5,632 3 comments 0 reactions 0 assignees View on GitHub
compiler: ghcjs
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

When building my [language-xats](https://github.com/vmchale/language-xats/issues) 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

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with `cabal new-build --ghcjs` and trace how Cabal handles the `alex` and `happy` preprocessors during the build. Done means a GHCJS build can locate and use these preprocessors without requiring separate `cabal new-install` commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.