-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Install via stack by specifying GitHub url fails due to not finding jquery.js #148
Comments
Yup, looks like an issue with stack to me. It's a tricky corner case: During the Template Haskell phase, an IO action is executed which relies on the current directory. |
If you want an easy way to get jQuery, the Haskell libary js-jquery provides it - and it has the advantages of complying with all the license requirements of upstream distributors like Debian. |
@ndmitchell The |
If you use the file-embed library with js-jquery library that should give you everything you need. I have a ticket to write an example in the js-jquery docs. |
Concretely you can get jQuery with: import Data.FileEmbed
import qualified Data.ByteString as BS
import qualified Language.Javascript.JQuery as JQuery
import Language.Haskell.TH.Syntax
main = print $ BS.take 100 jQueryContents
jQueryContents :: BS.ByteString
jQueryContents = $(embedFile =<< runIO JQuery.file) |
The use of `makeRelativeToProject` might make the library easier to install with stack in some cases. Do not use QuasiQuotes, but ordinary TemplateHaskell.
Thanks, @ndmitchell , the |
The use of `makeRelativeToProject` might make the library easier to install with stack in some cases. Do not use QuasiQuotes, but ordinary TemplateHaskell.
The use of `makeRelativeToProject` might make the library easier to install with stack in some cases. Do not use QuasiQuotes, but ordinary TemplateHaskell.
While I was trying to try out the fix mentioned in #145 via haskell-stack like so:
This error run into me:
For some reason
./js/lib/jquery.js
may be searched for in the wrong working directory.I was able to work around it by manually downloading:
and changing my stack.yaml to include:
Now that I've written all that out it occurred to me that this may be a bug in
stack
, since I would think that specifying a remote git repo or a local git repo should build rather identically. Or maybe they mostly do except in some edge cases, whichthreepenny-gui
may be exercising here.At any rate, I've decided to report/document this here in case someone else stumbles into a similar issue, or in case it is rather easy to fix upstream. But it is not pressing for me at the moment since I can just
cd
into the directory to pull threepenny should I want to.The text was updated successfully, but these errors were encountered: