You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
We'll start by having the following in the stack.yaml of the project in which we add the dependency:
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.
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 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.
I sense that this workaround is not the optimal solution to this problem, therefore I opened this issue.
The text was updated successfully, but these errors were encountered:
Looks like when happy is installed locally, it is indeed properly used with the build. So all that seems to be required is stack build happy before running stack build.
Given that having a library dep solves the issue, the issue is that we don't know that we need to build a new happy when it's overridden. Conceptually, this is related to #595
it seems that in order for my solution to work, stack build happy --resolver=... needs to happen outside of the project, and its resolver need to match the one of the stack.yaml of the project. I.e., we need to have the unmodified happy executable of the same snapshot installed before everything else.
These are the steps for a working build (explist branch):
Build Happy outside project: cd / && stack build happy --resolver=<to match project's>
Build the project: cd ~/project && stack build
(For reproducability I'd throw in "Ensure no happy in $PATH (i.e. clean environment), and in the Stack root" as step (0).)
Also, if I were unfortunate enough to perform stack build happy inside the project before building the unpatched version outside it (i.e. cd ~/project && stack build happy as first step), then I wind up with an inoperable .stack-work, and must erase it for stack build to work further on, even after the (1) is done unrelated (the error is setup: The program 'happy' is required but it could not be found, but I can send more details).
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 shortlyThe use case I am trying to deal with depending on an unreleased version of Happy.
We'll start by having the following in the
stack.yaml
of the project in which we add the dependency: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.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 to Happy, adding an empty Haskell library and also make adjustments so that
happy
is added tobuild-depends
- it seems to work. See the other branchexplist
in my project happy-alex-example.I sense that this workaround is not the optimal solution to this problem, therefore I opened this issue.
The text was updated successfully, but these errors were encountered: