-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange stack.yaml behavior: extra-deps, aeson and GHCJS #2556
Comments
It looks like only when you add certain packages to the This works fine: extra-deps:
- prelude-extras-0.4.0.3 This breaks (but works if you switch the compiler to ghc): extra-deps:
- aeson-0.8.0.2 |
More details: If you add a version of |
I think I've found the issue, ghcjs-base version in the compiler I am using is not compatible with
but you wouldn't be able to tell that from the stack error. I wonder if there is a better way to show that in stack. Edit: this is issue is somewhat orthogonal to this issue. Even if you put a compatible version of aeson in extra-deps, you still get the ghcjs-base issue. |
You are using a very old Just to add, stack had a fixed list of packages (from ghcjs-boot) it will not touch: ghcjs-base, or aeson is in that list EDIT: it is still possible to do what you want, but without stack... you will need to put your desired new |
@tolysz I guess it is not really clear where I should be looking for the latest stable version of ghcjs for stack. I was assuming https://s3.amazonaws.com/ghcjs since that where the stack documentation points to. |
I need to apologize @mchaver . I provide only a "community" builds based on the ghcjs snapshot with packages + ghc versions matching given lts or nightly. The nightly version is quite close to luite's ghcjs80 version so I can build it via I have scripts I use to build them in my github (somewhere), but they are like moving a target, and they need to be adapted from time to time to match both stackage and ghcjs changes. Until My packages are only a proof of concept - showing that ;) I do not want to make such big commitment and add http://tolysz.org/ghcjs/untested link to the how to install page, as my solution needs a CI building it via multiple One other point is the naming convention, I try to use EDIT: the reason I needed to start playing with this was to include "my" modified version of |
The answer is here: ghcjs/ghcjs#513 This isn't really a stack issue. You must compile ghcjs with the version of aeson that you, then with that build you can only use that one version of aeson. In stack you should leave any reference to aeson out. |
Looks like What precisely is the condition that |
Closing in favor of @tolysz's more detailed comment: #1530 (comment) |
When you build the ghcjs compiler, it assumes a number of packages (for example, attoparse, bytestring, text, aeson, etc.). Once the compiler is built, you cannot change the version number of those packages and they are treated sort of like native libraries. Stack needs to know that you are compiling with ghcjs, figure out what packages/versions the compiler depends on, and if you are using extra-deps, don't break if you are pointing to the correct version, and grab it from ~/.ghcjs. That way you can support both ghc and ghcjs with one stack.yaml. |
:P @sjakobi There are dozens of issues around installing via stack! Could we focus more effort on that? |
@mchaver :) I can use |
(Moved this over from ghcjs github issues because I thought it was more appropriate here)
If you want to compile with ghcjs and stack, you can put declare the compiler in
stack.yaml
This works pretty well. However,
once you add anythingif you add certain packages toextra-deps
likeaeson-0.8.0.2
(see my comment below), stack will complain that it is missingghcjs-base
, and most likelyghcjs-prim
as well, depending on what you import.So you have to manually add these packages:
However, the commits I have here don't seem to match up with the compiler version because once I add
ghcjs-base
andghcjs-prim
as extra-deps and usetoJSVal
in some code, I get:If I remove the
extra-deps
,ghcjs-base
andghcjs-prim
, that error goes away, but I am prevented from using packages outside of the stack declaration.Run into the same issue if you do
stack --compiler ghcjs-0.2.0.20160414_ghc-7.10.3
and have extra-deps.Related issue:
#2436
The text was updated successfully, but these errors were encountered: