Skip to content
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

ema without nix #12

Closed
juhp opened this issue Nov 5, 2021 · 7 comments
Closed

ema without nix #12

juhp opened this issue Nov 5, 2021 · 7 comments

Comments

@juhp
Copy link

juhp commented Nov 5, 2021

I managed to build ema-template using stack, or specifically this stack.yaml:

resolver: lts-18.15
extra-deps:
  - git: https://github.com/srid/ema.git
    commit: 5357aabbace86ab7e30dcb640248f56a233d75ba
  - lvar-0.1.0.0
  - shower-0.2.0.2
  - monad-logger-extras-0.1.1.1

However when I run it and connect I get:

$ stack run
[Info] Launching Ema under: /var/home/petersen/haskell/ema-template
[Info] Waiting for initial model ...
[Info#Emanote.Source.Mount] Traversing /var/home/petersen/haskell/ema-template for files matching ["**/*.md"], ignoring [".*"]
[Debug#ema-template] Reading README.md
[Debug#ema-template] Reading content/dir1.md
[Debug#ema-template] Reading content/dir1/foo.md
[Debug#ema-template] Reading content/dir2.md
[Debug#ema-template] Reading content/dir2/bar.md
[Debug#ema-template] Reading content/index.md
[Info] ... initial model is now available.
[Info] ============================================
[Info] Running live server at http://localhost:8000
[Info] ============================================
[Info#Emanote.Source.Mount] Monitoring /var/home/petersen/haskell/ema-template for changes
[Info#HTTP] [] as Just (Right (MarkdownRoute {unMarkdownRoute = Slug {unSlug = "index"} :| []}))
BadRoute (MarkdownRoute {unMarkdownRoute = Slug {unSlug = "index"} :| []})
:
BadRoute (MarkdownRoute {unMarkdownRoute = Slug {unSlug = "index"} :| []})
[Debug#Emanote.Source.Mount] �[92mAdded "/var/home/petersen/haskell/ema-template/.git/index.lock" 2021-11-05 12:01:02.923956264 UTC False�[0m
[Debug#Emanote.Source.Mount] �[92mAdded "/var/home/petersen/haskell/ema-template/.git/index" 2021-11-05 12:01:02.924405248 UTC False�[0m
[Debug#Emanote.Source.Mount] �[92mAdded "/var/home/petersen/haskell/ema-template/.git/index.lock" 2021-11-05 12:01:07.228558268 UTC False�[0m
@juhp
Copy link
Author

juhp commented Nov 5, 2021

On the other handing build with cabal and running, leads so some aeson errors:

$ cat cabal.project
packages: .

source-repository-package
    type: git
    location: https://github.com/srid/ema.git
    tag: 5357aabbace86ab7e30dcb640248f56a233d75ba
$ cabal run
HEAD is now at 5357aab mountOnLVar: pass the actual file, ignoring layers
Up to date
[Info] Launching Ema under: /var/home/petersen/haskell/ema-template
[Info] Waiting for initial model ...
[Info#Emanote.Source.Mount] Traversing /var/home/petersen/haskell/ema-template for files matching ["**/*.md"], ignoring [".*"]
[Debug#ema-template] Reading README.md
[Debug#ema-template] Reading content/dir1.md
[Debug#ema-template] Reading content/dir1/foo.md
[Debug#ema-template] Reading content/dir2.md
[Debug#ema-template] Reading content/dir2/bar.md
[Debug#ema-template] Reading content/index.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/.github/ISSUE_TEMPLATE/bug_report.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/CHANGELOG.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/README.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/concepts.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/concepts/cli.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/concepts/hot-reload.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/concepts/logging.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/concepts/lvar.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/concepts/slug.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/guide.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/guide/class.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/guide/helpers.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/guide/helpers/filesystem.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/guide/helpers/markdown.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/guide/helpers/tailwind.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/guide/model.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/guide/render.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/guide/routes.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/index.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/showcase.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/start.md
[Debug#ema-template] Reading dist-newstyle/src/ema-a7865a663bb4adc0/docs/start/tutorial.md
[Info] ... initial model is now available.
[Info] ============================================
[Info] Running live server at http://localhost:8000
[Info] ============================================
[Info#Emanote.Source.Mount] Monitoring /var/home/petersen/haskell/ema-template for changes
[Info#HTTP] [] as Just (Right (MarkdownRoute {unMarkdownRoute = Slug {unSlug = "index"} :| []}))
BadMarkdown "AesonException \"Error in $: parsing Main.Meta(Meta) failed, key \\\"order\\\" not found\""
[Info#HTTP] [] as Just (Right (MarkdownRoute {unMarkdownRoute = Slug {unSlug = "index"} :| []}))
BadMarkdown "AesonException \"Error in $: parsing Main.Meta(Meta) failed, key \\\"order\\\" not found\""
[Info#HTTP] [] as Just (Right (MarkdownRoute {unMarkdownRoute = Slug {unSlug = "index"} :| []}))
BadMarkdown "AesonException \"Error in $: parsing Main.Meta(Meta) failed, key \\\"order\\\" not found\""
[Info#HTTP] [] as Just (Right (MarkdownRoute {unMarkdownRoute = Slug {unSlug = "index"} :| []}))
BadMarkdown "AesonException \"Error in $: parsing Main.Meta(Meta) failed, key \\\"order\\\" not found\""
[Info#HTTP] [] as Just (Right (MarkdownRoute {unMarkdownRoute = Slug {unSlug = "index"} :| []}))
BadMarkdown "AesonException \"Error in $: parsing Main.Meta(Meta) failed, key \\\"order\\\" not found\""
[Info#HTTP] [] as Just (Right (MarkdownRoute {unMarkdownRoute = Slug {unSlug = "index"} :| []}))
BadMarkdown "AesonException \"Error in $: parsing Main.Meta(Meta) failed, key \\\"order\\\" not found\""
[Info#HTTP] [] as Just (Right (MarkdownRoute {unMarkdownRoute = Slug {unSlug = "index"} :| []}))
BadMarkdown "AesonException \"Error in $: parsing Main.Meta(Meta) failed, key \\\"order\\\" not found\""
[Info#HTTP] [] as Just (Right (MarkdownRoute {unMarkdownRoute = Slug {unSlug = "index"} :| []}))
BadMarkdown "AesonException \"Error in $: parsing Main.Meta(Meta) failed, key \\\"order\\\" not found\""
[Info#HTTP] [] as Just (Right (MarkdownRoute {unMarkdownRoute = Slug {unSlug = "index"} :| []}))
BadMarkdown "AesonException \"Error in $: parsing Main.Meta(Meta) failed, key \\\"order\\\" not found\""
[Info#HTTP] [] as Just (Right (MarkdownRoute {unMarkdownRoute = Slug {unSlug = "index"} :| []}))
BadMarkdown "AesonException \"Error in $: parsing Main.Meta(Meta) failed, key \\\"order\\\" not found\""
[Debug#Emanote.Source.Mount] �[92mAdded "/var/home/petersen/haskell/ema-template/.git/index.lock" 2021-11-05 12:46:29.085869502 UTC False�[0m

@srid
Copy link
Owner

srid commented Nov 5, 2021

Quick response without looking into this deeply.

You can try pinning versions of key packages in the cabal file:

build-depends:
, aeson
, async
, base
, blaze-html
, blaze-markup
, containers
, data-default
, directory
, ema >=0.2
, filepath
, lvar
, monad-logger
, neat-interpolation
, pandoc-types
, relude
, shower
, tagged
, text
, time
, unliftio

Maybe try to use the version used by nix-shell.

@srid
Copy link
Owner

srid commented Nov 5, 2021

This might be handy:

❯ nix-shell --run 'ghc-pkg list | grep aeson'
    aeson-1.5.6.0

Full list: https://gist.github.com/srid/1b0176b111ba443dfe73acea3e9ee79f

Try using these versions of the relevant packages.

@juhp
Copy link
Author

juhp commented Nov 5, 2021

Thanks, I will try harder...

Also btw it seems ema-template does not build with the latest ema HEAD btw.

@srid
Copy link
Owner

srid commented Nov 5, 2021

Also btw it seems ema-template does not build with the latest ema HEAD btw.

Yea, it needs to be ported. The main change is in the unionMount stuff. I am just waiting to finalize API of https://github.com/srid/ema/blob/master/src/Ema/Helper/FileSystem.hs and release that as a separate library on hackage.

@srid
Copy link
Owner

srid commented Nov 5, 2021

Thanks, I will try harder...

If you are on Matrix, you can ping me here; would be happy to help ...

@juhp
Copy link
Author

juhp commented Nov 5, 2021

Okay, thanks for helping :)

I managed to get it working now with ghcid --command "cabal repl" for now.
Unfortunately stack repl doesn't support package mixins yet,
but @srid suggested the mixins usage could be dropped: let me open a PR.

juhp added a commit to juhp/ema-template that referenced this issue Nov 5, 2021
- add cabal.project and stack.yaml

- ghcid in the topdir will now run successfully with stack repl
- ./run-cabal will start ghcid with cabal reply
@juhp juhp mentioned this issue Nov 5, 2021
@srid srid closed this as completed in 0a54032 Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants