Incorrect render behaviour #205

Closed
opened 6 years ago by Eugleo · 9 comments
Eugleo commented 6 years ago (Migrated from github.com)

After the render update, raco pollen render has been behaving strange; in version 2.0.2134.450 I still experience the following problem.

I have several .poly files in my project (exporting into markdown, tex, pdf and html), all of which work perfectly when I load the respective files on a pollen server. When I run render, though, some of the files compile, while others throw the following error:

doc/biopolymery/compiled/pollen/notes.poly.pm.rktd::15: read: bad syntax `#<'
  context...:
   /Applications/Racket v6.12/collects/racket/private/more-scheme.rkt:373:13: hash-ref!
   /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/cache.rkt:39:4: cached-require-base
   .../more-scheme.rkt:261:28
   get-template-for44
   /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/render.rkt:251:0: render-markup-or-markdown-source38
   /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/render.rkt:172:25: render31
   /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:100:2: generate-dest-file
   /Applications/Racket v6.12/collects/file/cache.rkt:63:2: fetch-and-continue
   /Applications/Racket v6.12/collects/racket/contract/private/arrow-val-first.rkt:428:3
   /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:91:0: cache-ref!14
   render-to-file-if-needed
   /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/render.rkt:105:25: render-from-source-or-output-path
   /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/render.rkt:49:25: render-batch4
   /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/render.rkt:105:25: render-from-source-or-output-path
   /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/render.rkt:49:25: render-batch4
   /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/private/command.rkt:106:9: render-one-dir
   ...

This could seem rather cryptic, but the real problem is in the .poly.rktd file, which looks like this:

#hasheq((doc . #<void>) ...)

Together with the faulty .poly.rktd file there are two fully functioning files (it seems) in the same directory, namely .html.rktd and .pdf.rktd.

Running render -p doesn't throw any errors, some of my articles don't seem to be compiled, though.

After the `render` update, `raco pollen render` has been behaving strange; in version 2.0.2134.450 I still experience the following problem. I have several `.poly` files in my project (exporting into markdown, tex, pdf and html), all of which work perfectly when I load the respective files on a pollen server. When I run `render`, though, some of the files compile, while others throw the following error: ``` doc/biopolymery/compiled/pollen/notes.poly.pm.rktd::15: read: bad syntax `#<' context...: /Applications/Racket v6.12/collects/racket/private/more-scheme.rkt:373:13: hash-ref! /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/cache.rkt:39:4: cached-require-base .../more-scheme.rkt:261:28 get-template-for44 /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/render.rkt:251:0: render-markup-or-markdown-source38 /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/render.rkt:172:25: render31 /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:100:2: generate-dest-file /Applications/Racket v6.12/collects/file/cache.rkt:63:2: fetch-and-continue /Applications/Racket v6.12/collects/racket/contract/private/arrow-val-first.rkt:428:3 /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:91:0: cache-ref!14 render-to-file-if-needed /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/render.rkt:105:25: render-from-source-or-output-path /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/render.rkt:49:25: render-batch4 /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/render.rkt:105:25: render-from-source-or-output-path /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/render.rkt:49:25: render-batch4 /Users/eugen/Library/Racket/6.12/pkgs/pollen/pollen/private/command.rkt:106:9: render-one-dir ... ``` This could seem rather cryptic, but the real problem is in the `.poly.rktd` file, which looks like this: ``` #hasheq((doc . #<void>) ...) ``` Together with the faulty `.poly.rktd` file there are two fully functioning files (it seems) in the same directory, namely `.html.rktd` and `.pdf.rktd`. Running `render -p` doesn't throw any errors, some of my articles don't seem to be compiled, though.
mbutterick commented 6 years ago (Migrated from github.com)

And you have done a raco pollen reset, of course?

And you have done a `raco pollen reset`, of course?
Eugleo commented 6 years ago (Migrated from github.com)

I did indeed, to no avail.

I did indeed, to no avail.
mbutterick commented 6 years ago (Migrated from github.com)

The rktd files are written as part of the caching system. Have you tried deactivating the caches in a setup module? (I’m not suggesting this as a permanent workaround, but it will help me refine where the problem is occurring.)

The `rktd` files are written as part of the caching system. Have you tried deactivating the caches in a `setup` module? (I’m not suggesting this as a permanent workaround, but it will help me refine where the problem is occurring.)
mbutterick commented 6 years ago (Migrated from github.com)

The problem seems to be that notes.poly.pmis exporting <#void> as the value for doc. I can’t see your source, so it’s hard for me to really test this. If you could post an example, it would be helpful.

The problem seems to be that `notes.poly.pm`is exporting `<#void>` as the value for `doc`. I can’t see your source, so it’s hard for me to really test this. If you could post an example, it would be helpful.
Eugleo commented 6 years ago (Migrated from github.com)

I did just now. After disabling the compile cache, the error changes to:

render-markup-or-markdown-source: contract violation
expected: valid template path
given: #f
…

Which is weird, given that I have a template.md.p file in the project root directory (which reads simply ◊doc). EDIT: And given that .md files show just fine when accessing them via pollen server.

I did just now. After disabling the compile cache, the error changes to: ``` render-markup-or-markdown-source: contract violation expected: valid template path given: #f … ``` Which is weird, given that I have a `template.md.p` file in the project root directory (which reads simply `◊doc`). EDIT: And given that `.md` files show just fine when accessing them via pollen server.
mbutterick commented 6 years ago (Migrated from github.com)

Yes, sounds weird. Well, if you want to give me access to the project repo, I will clone it & try to reproduce the problem.

Yes, sounds weird. Well, if you want to give me access to the project repo, I will clone it & try to reproduce the problem.
Eugleo commented 6 years ago (Migrated from github.com)

The repo is private. I've added you as a collaborator. Thanks for help.

The repo is private. I've added you as a collaborator. Thanks for help.
mbutterick commented 6 years ago (Migrated from github.com)

Problems:

  1. You have nodes in your pagetree with a poly extension. Pagetrees contain output filenames, so Pollen is trying to render in poly format (which doesn’t exist).

  2. Your root function in "pollen.rkt" has no else case for (current-poly-target), so when Pollen tries to render the poly file, it gets (void).

  3. Pollen’s caching system doesn’t handle void values properly, though it should, so I’ve fixed that.

  4. The error messages could’ve given better clues that there was a problem with the chosen output format, so I’ve fixed that too.

But for this to work correctly, you should fix problems 1 & 2.

Problems: 1. You have nodes in your pagetree with a `poly` extension. Pagetrees contain **output** filenames, so Pollen is trying to render in `poly` format (which doesn’t exist). 2. Your `root` function in `"pollen.rkt"` has no `else` case for `(current-poly-target)`, so when Pollen tries to render the `poly` file, it gets `(void)`. 3. Pollen’s caching system doesn’t handle void values properly, though it should, so I’ve fixed that. 4. The error messages could’ve given better clues that there was a problem with the chosen output format, so I’ve fixed that too. But for this to work correctly, you should fix problems 1 & 2.
Eugleo commented 6 years ago (Migrated from github.com)

Thanks for the help! And for the fixes, too.

Thanks for the help! And for the fixes, too.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen#205
Loading…
There is no content yet.