Rendering a file does not work #173

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

Hello,

I'm following the beginner's tutorial for Pollen and I'm getting the following error when attempting to render the 'hello world' exercise. I performed the standard installation, and ensured that Pollen was properly installed using raco pollen test.

This issue appears similar to https://github.com/mbutterick/pollen/issues/100

If I can provide any additional information, please let me know. Thank you.

~/Projects/pollen » raco pollen render ./hello.text.pp
rendering ./hello.text.pp
find-relative-path: contract violation
  expected: (and/c path-for-some-system? simple-form?)
  given: #<path:[REDACTED]/pollen/./hello.text.pp>
  context...:
   /usr/racket/collects/racket/path.rkt:118:2: for-loop
   /usr/racket/collects/racket/path.rkt:116:0: do-explode-path
   /usr/racket/collects/racket/path.rkt:126:0: find-relative-path7
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:135:0: render26
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:99:2: fetch-dest-file
   /usr/racket/collects/file/cache.rkt:63:2: fetch-and-continue
   /usr/racket/collects/racket/contract/private/arrow-val-first.rkt:428:3
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:90:0: cache-ref!14
   /usr/racket/collects/racket/private/more-scheme.rkt:373:13: hash-ref!
   render-to-file-if-needed
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:71:0: render-from-source-or-output-path
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:52:0: render-batch
   ...higher-order.rkt:361:33
   (submod /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/command.rkt raco): [running body]
   /usr/racket/collects/raco/raco.rkt: [running body]
   /usr/racket/collects/raco/main.rkt: [running body]
Hello, I'm following the beginner's tutorial for Pollen and I'm getting the following error when attempting to render the 'hello world' exercise. I performed the standard installation, and ensured that Pollen was properly installed using `raco pollen test`. This issue appears similar to https://github.com/mbutterick/pollen/issues/100 If I can provide any additional information, please let me know. Thank you. ``` ~/Projects/pollen » raco pollen render ./hello.text.pp rendering ./hello.text.pp find-relative-path: contract violation expected: (and/c path-for-some-system? simple-form?) given: #<path:[REDACTED]/pollen/./hello.text.pp> context...: /usr/racket/collects/racket/path.rkt:118:2: for-loop /usr/racket/collects/racket/path.rkt:116:0: do-explode-path /usr/racket/collects/racket/path.rkt:126:0: find-relative-path7 /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:135:0: render26 /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:99:2: fetch-dest-file /usr/racket/collects/file/cache.rkt:63:2: fetch-and-continue /usr/racket/collects/racket/contract/private/arrow-val-first.rkt:428:3 /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:90:0: cache-ref!14 /usr/racket/collects/racket/private/more-scheme.rkt:373:13: hash-ref! render-to-file-if-needed /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:71:0: render-from-source-or-output-path /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:52:0: render-batch ...higher-order.rkt:361:33 (submod /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/command.rkt raco): [running body] /usr/racket/collects/raco/raco.rkt: [running body] /usr/racket/collects/raco/main.rkt: [running body] ```
mbutterick commented 6 years ago (Migrated from github.com)

Strictly speaking the tutorial asks for the command

raco pollen render hello.text.pp

which did work. But I agree that your version:

raco pollen render ./hello.text.pp

should not be broken.

Strictly speaking the tutorial asks for the command `raco pollen render hello.text.pp` which did work. But I agree that your version: `raco pollen render ./hello.text.pp` should not be broken.
LorenzoFernando commented 6 years ago (Migrated from github.com)

I really appreciate your swift response, thank you.

I originally attempted it as-written, and I've included the output below. If I can provide any additional information, please let me know.

Best,
Lorenzo

~/Projects/pollen » raco pollen render hello.text.pp 
rendering hello.text.pp
rendering: /hello.text.pp as /hello.text
cached-doc: contract violation
  expected: path to existing file
  given: #<path:/home/[REDACTED]/Projects/pollen/hello.text.pp>
  context...:
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/cache.rkt:27:4: cached-require-base
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:204:0: render-preproc-source
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:135:0: render26
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:99:2: fetch-dest-file
   /usr/racket/collects/file/cache.rkt:63:2: fetch-and-continue
   /usr/racket/collects/racket/contract/private/arrow-val-first.rkt:428:3
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:90:0: cache-ref!14
   /usr/racket/collects/racket/private/more-scheme.rkt:373:13: hash-ref!
   render-to-file-if-needed
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:71:0: render-from-source-or-output-path
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:52:0: render-batch
   ...higher-order.rkt:361:33
   (submod /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/command.rkt raco): [running body]
   /usr/racket/collects/raco/raco.rkt: [running body]
   /usr/racket/collects/raco/main.rkt: [running body]
I really appreciate your swift response, thank you. I originally attempted it as-written, and I've included the output below. If I can provide any additional information, please let me know. Best, Lorenzo ``` ~/Projects/pollen » raco pollen render hello.text.pp rendering hello.text.pp rendering: /hello.text.pp as /hello.text cached-doc: contract violation expected: path to existing file given: #<path:/home/[REDACTED]/Projects/pollen/hello.text.pp> context...: /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/cache.rkt:27:4: cached-require-base /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:204:0: render-preproc-source /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:135:0: render26 /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:99:2: fetch-dest-file /usr/racket/collects/file/cache.rkt:63:2: fetch-and-continue /usr/racket/collects/racket/contract/private/arrow-val-first.rkt:428:3 /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:90:0: cache-ref!14 /usr/racket/collects/racket/private/more-scheme.rkt:373:13: hash-ref! render-to-file-if-needed /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:71:0: render-from-source-or-output-path /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:52:0: render-batch ...higher-order.rkt:361:33 (submod /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/command.rkt raco): [running body] /usr/racket/collects/raco/raco.rkt: [running body] /usr/racket/collects/raco/main.rkt: [running body] ```
LorenzoFernando commented 6 years ago (Migrated from github.com)

For completeness, here is the input file:

#lang pollen
Goodbye Stranger
Breakfast in America
Take the Long Way Home
For completeness, here is the input file: ``` #lang pollen Goodbye Stranger Breakfast in America Take the Long Way Home ```
mbutterick commented 6 years ago (Migrated from github.com)

I’m afraid I can’t reproduce this error. Is there anything unusual about how your home directory is set up? The fact that similar errors happened in two different functions suggests that Racket is getting confused about how to resolve the ~ in the path (though usually it doesn’t, hence my question)

I’m afraid I can’t reproduce this error. Is there anything unusual about how your home directory is set up? The fact that similar errors happened in two different functions suggests that Racket is getting confused about how to resolve the `~` in the path (though usually it doesn’t, hence my question)
LorenzoFernando commented 6 years ago (Migrated from github.com)

Using the absolute path I get the same error, which I've included below. I'll try to troubleshoot this later and open a PR/Issue if appropriate.

Thank you

~/Projects/pollen » raco pollen render /home/[REDACTED]/Projects/pollen/hello.text.pp 
rendering /home/[REDACTED]/Projects/pollen/hello.text.pp
rendering: /hello.text.pp as /hello.text
cached-doc: contract violation
  expected: path to existing file
  given: #<path:/home/[REDACTED]/Projects/pollen/hello.text.pp>
  context...:
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/cache.rkt:27:4: cached-require-base
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:204:0: render-preproc-source
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:135:0: render26
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:99:2: fetch-dest-file
   /usr/racket/collects/file/cache.rkt:63:2: fetch-and-continue
   /usr/racket/collects/racket/contract/private/arrow-val-first.rkt:428:3
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:90:0: cache-ref!14
   /usr/racket/collects/racket/private/more-scheme.rkt:373:13: hash-ref!
   render-to-file-if-needed
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:71:0: render-from-source-or-output-path
   /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:52:0: render-batch
   ...higher-order.rkt:361:33
   (submod /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/command.rkt raco): [running body]
   /usr/racket/collects/raco/raco.rkt: [running body]
   /usr/racket/collects/raco/main.rkt: [running body]
Using the absolute path I get the same error, which I've included below. I'll try to troubleshoot this later and open a PR/Issue if appropriate. Thank you ``` ~/Projects/pollen » raco pollen render /home/[REDACTED]/Projects/pollen/hello.text.pp rendering /home/[REDACTED]/Projects/pollen/hello.text.pp rendering: /hello.text.pp as /hello.text cached-doc: contract violation expected: path to existing file given: #<path:/home/[REDACTED]/Projects/pollen/hello.text.pp> context...: /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/cache.rkt:27:4: cached-require-base /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:204:0: render-preproc-source /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:135:0: render26 /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:99:2: fetch-dest-file /usr/racket/collects/file/cache.rkt:63:2: fetch-and-continue /usr/racket/collects/racket/contract/private/arrow-val-first.rkt:428:3 /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/cache-utils.rkt:90:0: cache-ref!14 /usr/racket/collects/racket/private/more-scheme.rkt:373:13: hash-ref! render-to-file-if-needed /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:71:0: render-from-source-or-output-path /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/render.rkt:52:0: render-batch ...higher-order.rkt:361:33 (submod /home/[REDACTED]/.racket/6.12/pkgs/pollen/pollen/private/command.rkt raco): [running body] /usr/racket/collects/raco/raco.rkt: [running body] /usr/racket/collects/raco/main.rkt: [running body] ```
mbutterick commented 6 years ago (Migrated from github.com)

Using the absolute path I get the same error

Now I’m more confused. What OS is this? Nothing unusual in the /home/ directory path, like symlinks or funny mount points, etc? (Those should work, but I’m trying to identify some combination of factors that would let me reproduce the error)

> Using the absolute path I get the same error Now I’m more confused. What OS is this? Nothing unusual in the `/home/` directory path, like symlinks or funny mount points, etc? (Those should work, but I’m trying to identify some combination of factors that would let me reproduce the error)
mbutterick commented 6 years ago (Migrated from github.com)

Closed as inactive

Closed as inactive
LorenzoFernando commented 6 years ago (Migrated from github.com)

Thanks for your assistance with this. I recently reinstalled everything and it appears to be functioning as expected.

Take care,
Lorenzo

Thanks for your assistance with this. I recently reinstalled everything and it appears to be functioning as expected. Take care, Lorenzo
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#173
Loading…
There is no content yet.