commercialhaskell / commercialhaskell/stack

Depending on a modified Happy or Alex package requires non-trivial patching

Open
#2,767 2 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

Today even with `Stack 1.2.0`, it is not possible to depend on modified tools such as Alex and Happy - without patching them, and referring to them in a rather odd way that I'd explain shortly

The use case I am trying to deal with depending on an unreleased version of [Happy](https://github.com/simonmar/happy).

We'll start by having the following in the `stack.yaml` of the project in which we add the dependency:

```
packages:
- location: https://github.com/simonmar/happy/archive/4aff81fc89a74fd57e3494d026e569e247919d99.zip
extra-dep: true
- .
```

However, even though Stack builds the new version of Happy, it does not make use of it when generating the parser code. Instead the older version of Happy is used and we get an error. See example in branch `explist-broken` in my project [happy-alex-example](https://github.com/da-x/happy-alex-example/tree/explist-broken).

**NOTE: doing `git clean -x -d -f` when moving between the branches mentioned here is crucial to see the problem reproduces**.

Now, it seems that if I do [this patch](https://github.com/da-x/happy/commit/65c2494c77bd1bb321c1eb29b5117a975b1723a0) to Happy, adding an empty Haskell library and also make adjustments so that `happy` is added to `build-depends` - it seems to work. See the other branch `explist` in my project [happy-alex-example](https://github.com/da-x/happy-alex-example/tree/explist).

I sense that this workaround is not the optimal solution to this problem, therefore I opened this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.