-
Notifications
You must be signed in to change notification settings - Fork 374
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
Problem interfacing yesod devel
with the new hsenv
#480
Comments
An additional note:
It seems that a step is taken or not taken when the configuration does not happen:
|
Silly me, there is a difference between the two rebuildings. The rebuild failing is from |
Here's a little more detail on hsenv and the recent changes made to it. The gist of how it works is probably not too different from the other sandboxing mechanisms that are out there. It creates an alternative storage location for Cabal packages and then instructs the various tools that depend on those packages (e.g. GHC, GHCi, ghc-pkg, cabal-install, etc.) where to find them. It used to accomplish this by setting the The new approach is a bit more involved. We now wrap the common Haskell tools on the user's So the crux of the matter is: how can we best inform |
Actually, I have made one more test and it is not related to Cabal 1.16. I have the same problem with Cabal 1.14. So the problem shows up with ghc 7.4 and Cabal 1.14 or 1.16 equally. |
That's not surprising. hsenv is now using the wrapper scripts instead of the environment variable regardless of which versions of GHC and Cabal you're using. So the previous point stands: we need a way to pass the necessary options through |
Does If it is using a wrapper script, this means that |
The
I don't quite understand what you mean by this. Neither the By the way, from a cursory glance around the source code, I found that |
I meant that the cabal part is handled without a problem by yesod devel and only the ghc part seems to be a problem Whatever is done in I do not have a deep understanding of how everything works at a deeper level though. Thank you for your comments and the workaround. |
@dudebout I think --disable-api forces rebuildCabal. @tmhedberg do you know how we can use the GHC API in a way that is compatible with hsenv? |
@gregwebs I confirm that this is what happens. |
The line throwing the exception in
There is no mention of the User Package DB which might be why it crashes. (I am not sure that line is actually throwing an exception but I was printing dflags before and after each modification and I cannot putStrLn anything after that line) |
This is indeed the problem. I could fix it by adding |
This information is exported in a global variable by hsenv. It has the following form:
I just put the part after the equal sign in |
Yesod could look for that environment variable and modify its GHC API calls appropriately. However, I'm not sure it is really appropriate for Yesod to have to "know" about hsenv or how it operates. A better solution would probably be to add a command-line argument to the |
It's already possible to add extra cabal arguments with It's probably easiest if |
This is corret. hsenv used to set GHC_PACKAGE_PATH and was working fine. Now that we need to use |
One way to fix the problem would be to run |
The simplest/cleanest solution might be to do what was done in the following two pull-requests:
GHC_PACKAGE_PATH is still a valid option to tell ghc what we want. We could set it when activating hsenv and unset it only in the cabal wrapper. This way, yesod and hsenv would not have to know about each other. |
Yes, that's probably worth a shot. I am a bit reluctant to go back to using |
As @tmhedberg mentionned in tmhedberg/hsenv#9 (comment) it will not be viable to put back GHC_PACKAGE_PATH as any program using the Cabal library (for example through Distribution) without using the |
|
hsenv from https://github.com/Paczesiowa/hsenv has always been working flawlessly with yesod devel. However, @Paczesiowa stopped development and @tmhedberg took over. One major change was to work with Cabal 1.16. @tmhedberg recently released the current version of hsenv (0.3) to Hackage which will make it even easier to use with
yesod
.I suspect however that somewhere between
yesod devel
andhsenv
there is a slight problem. Installing from hackage hsenv and then a yesod scaffold inside a new hsenv I get the following strang behavior:cabal install
worksyesod devel
starts the server correctly and serves the app properlyI find puzzling that it is doing twice
Rebuilding application... (using Cabal library)
but only failing the second time. I tried to doyesod devel -v
but would not get more information. I do not even know what command fails.The text was updated successfully, but these errors were encountered: