ucsd-progsys / liquidhaskell-tutorial

Tutorial for LiquidHaskell
https://ucsd-progsys.github.io/liquidhaskell-tutorial/
MIT License
74 stars 27 forks source link

How to workaround using Stack for building html #103

Closed hafizhmakmur closed 4 years ago

hafizhmakmur commented 4 years ago

When I execute "make html" the log outputs

stack run filters-toc src/ templates/pagemeta.template templates/index.template dist/page.template dist/index.lhs dist/links.txt
Cabal file info not found for Diff-0.3.4, updating
Selected mirrot https://s3.amazonaws.com/hackage.fpcomplete.com/
Downloading timestamp
Downloading snapshot
Downloading mirrors
Cannot update index (no local copy)
Downloading index

and it stucks here.

And when I try to cancel it, it says

make: *** [Makefile:84: dist/index.lhs] Interrupt

Any steps that I have missed?

hafizhmakmur commented 4 years ago

After searching for the solution I found that it looks like it's a stack problem https://github.com/commercialhaskell/stack/issues/2240 https://github.com/commercialhaskell/stack/issues/1223

It looks like I won't be able to use stack because every command will be too slow. Henceforth I'd like to ask whether there is any way to build the project without stack? I have a working ghc and cabal so is there a way to maybe modify the makefile to use them instead?

ranjitjhala commented 4 years ago

Dear Hafizh,

Yes all of this is only to build the webpage is there a reason you are trying to do that locally? In principle it should be straightforward to use the new cabal to do everything as LH builds just fine with it. But in practice I will have to see when I can find the time. (It should be an easy application of the stack2cabal script I saw online...)

Ranjit.

On Wed, Aug 12, 2020 at 11:45 PM Hafizh Afkar Makmur < notifications@github.com> wrote:

After searching for the solution I found that it looks like it's a stack problem commercialhaskell/stack#2240 https://urldefense.com/v3/__https://github.com/commercialhaskell/stack/issues/2240__;!!Mih3wA!W4D-oukHzpXE0be-hwg7DTUZR7aanCPPbtDns5AtkyoP-VPWZSBu1AshWO-yyF2n$ commercialhaskell/stack#1223 https://urldefense.com/v3/__https://github.com/commercialhaskell/stack/issues/1223__;!!Mih3wA!W4D-oukHzpXE0be-hwg7DTUZR7aanCPPbtDns5AtkyoP-VPWZSBu1AshWGR4puSp$

It looks like I won't be able to use stack because every command will be too slow. Henceforth I'd like to ask whether there is any way to build the project without stack? I have a working ghc and cabal so is there a way to maybe modify the makefile to use them instead?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/ucsd-progsys/liquidhaskell-tutorial/issues/103*issuecomment-673294787__;Iw!!Mih3wA!W4D-oukHzpXE0be-hwg7DTUZR7aanCPPbtDns5AtkyoP-VPWZSBu1AshWC-FbphJ$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAMS4OFLAZPUZEPRVUM3PHDSAODZZANCNFSM4P4ZRNUQ__;!!Mih3wA!W4D-oukHzpXE0be-hwg7DTUZR7aanCPPbtDns5AtkyoP-VPWZSBu1AshWETyPd55$ .

hafizhmakmur commented 4 years ago

Dear @ranjitjhala ,

Inspired by https://liquid.kosmikus.org/ I'm trying to make my own web page that will be similar to the tutorials. So far I'm trying to just change the commands in the makefile, specifically

# bin
## INDEXER=stack exec -- runghc filters/Toc.hs
## PANDOC=pandoc
INDEXER=stack run filters-toc
PANDOC=stack exec -- pandoc

to

# bin
INDEXER=runghc filters/Toc.hs
PANDOC=pandoc

Do you think it will work? So far the latest hurdle I found with this is my difficulty in installing the Pandoc Hackage (https://github.com/jgm/pandoc/issues/6612) which I think is an independent problem from this but I'm afraid after I solved that problem I'll still found a new problem that will block me.

Thank you for your attention!

ranjitjhala commented 4 years ago

Hi yes that should work!

On Thu, Aug 13, 2020 at 7:03 AM Hafizh Afkar Makmur < notifications@github.com> wrote:

Dear @ranjitjhala https://urldefense.com/v3/__https://github.com/ranjitjhala__;!!Mih3wA!V9N4xP7q5M58CBY3oVd2EV0ShWWPPLrJTVZl6oYJvh14HhZJhQCaz943K_3u0ziu$ ,

Inspired by https://liquid.kosmikus.org/ https://urldefense.com/v3/__https://liquid.kosmikus.org/__;!!Mih3wA!V9N4xP7q5M58CBY3oVd2EV0ShWWPPLrJTVZl6oYJvh14HhZJhQCaz943Kypjyd-2$ I'm trying to make my own web page that will be similar to the tutorials. So far I'm trying to just change the commands in the makefile, specifically

bin

INDEXER=stack exec -- runghc filters/Toc.hs

PANDOC=pandoc

INDEXER=stack run filters-toc

PANDOC=stack exec -- pandoc

to

bin

INDEXER=runghc filters/Toc.hs

PANDOC=pandoc

Do you think it will work? So far the latest hurdle I found with this is my difficulty in installing the Pandoc Hackage (jgm/pandoc#6612 https://urldefense.com/v3/__https://github.com/jgm/pandoc/issues/6612__;!!Mih3wA!V9N4xP7q5M58CBY3oVd2EV0ShWWPPLrJTVZl6oYJvh14HhZJhQCaz943K3lSwZLR$) which I think is an independent problem from this but I'm afraid after I solved that problem I'll still found a new problem that will block me.

Thank you for your attention!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/ucsd-progsys/liquidhaskell-tutorial/issues/103*issuecomment-673497810__;Iw!!Mih3wA!V9N4xP7q5M58CBY3oVd2EV0ShWWPPLrJTVZl6oYJvh14HhZJhQCaz943K_oXjNLN$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAMS4OCJYBG2NLMIQQNJ3ODSAPXB3ANCNFSM4P4ZRNUQ__;!!Mih3wA!V9N4xP7q5M58CBY3oVd2EV0ShWWPPLrJTVZl6oYJvh14HhZJhQCaz943K0jnwFby$ .

hafizhmakmur commented 4 years ago

Thank you very much! I'll tell you whether it works after I solve this pandoc issue.

hafizhmakmur commented 4 years ago

Dear @ranjitjhala,

I have a 4GB device so I'm having difficulty to install the latest pandoc. So I'm forced to install pandoc-2.7.3 and along with it downgrade my ghc to 8.6.5 . After that, I also need to fix some conversions from String to T.Text in the filters code but finally it works! Now I'm able to make the articles with your generator. Thank you very much for your assistance. :D

ranjitjhala commented 4 years ago

Wow excellent, if you have a PR to help simplify that would be great (or even a branch for building on ghc 8.6.5)

On Mon, Aug 24, 2020 at 6:27 AM Hafizh Afkar Makmur < notifications@github.com> wrote:

Dear @ranjitjhala https://urldefense.com/v3/__https://github.com/ranjitjhala__;!!Mih3wA!WgHXehFBOj9mr31PmzBKiqBiYoWPc00WtWUcYO7AKn79fc65lEajoLA_D-fZ_P9a$ ,

I have a 4GB device so I'm having difficulty to install the latest pandoc. So I'm forced to install pandoc-2.7.3 and along with it downgrade my ghc to 8.6.5 . After that, I also need to fix some conversions from String to T.Text in the filters code but finally it works! Now I'm able to make the articles with your generator. Thank you very much for your assistance. :D

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/ucsd-progsys/liquidhaskell-tutorial/issues/103*issuecomment-679125329__;Iw!!Mih3wA!WgHXehFBOj9mr31PmzBKiqBiYoWPc00WtWUcYO7AKn79fc65lEajoLA_Dxrhlnuh$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAMS4OBVVOVCDBUI46JVBWLSCJTCXANCNFSM4P4ZRNUQ__;!!Mih3wA!WgHXehFBOj9mr31PmzBKiqBiYoWPc00WtWUcYO7AKn79fc65lEajoLA_DzjQTTi9$ .