Crash in (load-pagetree "../index.ptree") with "find-relative-path: contract violation" #78

Closed
opened 3 years ago by pmarinov · 4 comments
pmarinov commented 3 years ago (Migrated from github.com)

Hello,

My pollen.rkt is: https://github.com/pmarinov/bash-scripting-guide/blob/master/pollen.rkt

I get this error backtrace:

find-relative-path: contract violation
  expected: (and/c path-for-some-system? simple-form?)
  given: #<path:/home/peterm/work/bash-scripting-guide/pages/../index.ptree>
  context...:
   /usr/share/racket/collects/racket/path.rkt:118:2: for-loop
   /usr/share/racket/collects/racket/path.rkt:116:0: do-explode-path
   /usr/share/racket/collects/racket/path.rkt:126:0: find-relative-path9
   /home/peterm/.racket/7.2/pkgs/pollen/pollen/cache.rkt:50:9: convert-path-to-cache-record
   /home/peterm/.racket/7.2/pkgs/pollen/pollen/private/cache-utils.rkt:124:2: generate-dest-file
   /usr/share/racket/collects/file/cache.rkt:63:2: fetch-and-continue
   /usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt:430:3
   /home/peterm/.racket/7.2/pkgs/pollen/pollen/private/cache-utils.rkt:114:0: cache-ref!11
   /usr/share/racket/collects/racket/private/more-scheme.rkt:376:2: hash-ref!
   /home/peterm/.racket/7.2/pkgs/pollen/pollen/cache.rkt:39:4: cached-require-base
   /home/peterm/work/bash-scripting-guide/pollen.rkt:148:0: node-menu
   (submod "/home/peterm/work/bash-scripting-guide/pages/commands.poly.pm" pollen-module): [running body]
   temp37_0
   for-loop
   run-module-instance!125
   for-loop
   ...
make: *** [makefile:39: pages/command_substit.html] Error 1

Observations of strangeness, this error wouldn't show up if:

  • I manually do: raco pollen render -r html pages/commands.poly.pm OR
  • I re-order my index.ptree OR
  • If I remove subtree pages/commands.poly.pm from index.ptree OR
  • If in folder "pages" I do ln -s ../index.ptree index.ptree and in function node-menu I pass "index.ptree" not "../index.ptree"

I run raco pollen reset before each of the observations above. Any single step will make the problem not show up.

This code (pollen.rkt) has been working for a long time and I have been simply adding pages to the book (index.ptree), and now suddenly it complains.

What could be the problem? Thank you for taking the time to look into it.

Hello, My pollen.rkt is: https://github.com/pmarinov/bash-scripting-guide/blob/master/pollen.rkt I get this error backtrace: ``` find-relative-path: contract violation expected: (and/c path-for-some-system? simple-form?) given: #<path:/home/peterm/work/bash-scripting-guide/pages/../index.ptree> context...: /usr/share/racket/collects/racket/path.rkt:118:2: for-loop /usr/share/racket/collects/racket/path.rkt:116:0: do-explode-path /usr/share/racket/collects/racket/path.rkt:126:0: find-relative-path9 /home/peterm/.racket/7.2/pkgs/pollen/pollen/cache.rkt:50:9: convert-path-to-cache-record /home/peterm/.racket/7.2/pkgs/pollen/pollen/private/cache-utils.rkt:124:2: generate-dest-file /usr/share/racket/collects/file/cache.rkt:63:2: fetch-and-continue /usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt:430:3 /home/peterm/.racket/7.2/pkgs/pollen/pollen/private/cache-utils.rkt:114:0: cache-ref!11 /usr/share/racket/collects/racket/private/more-scheme.rkt:376:2: hash-ref! /home/peterm/.racket/7.2/pkgs/pollen/pollen/cache.rkt:39:4: cached-require-base /home/peterm/work/bash-scripting-guide/pollen.rkt:148:0: node-menu (submod "/home/peterm/work/bash-scripting-guide/pages/commands.poly.pm" pollen-module): [running body] temp37_0 for-loop run-module-instance!125 for-loop ... make: *** [makefile:39: pages/command_substit.html] Error 1 ``` Observations of strangeness, this error wouldn't show up if: * I manually do: `raco pollen render -r html pages/commands.poly.pm` OR * I re-order my index.ptree OR * If I remove subtree pages/commands.poly.pm from index.ptree OR * If in folder "pages" I do `ln -s ../index.ptree index.ptree` and in function node-menu I pass "index.ptree" not "../index.ptree" I run `raco pollen reset` before each of the observations above. Any single step will make the problem not show up. This code (pollen.rkt) has been **working for a long time** and I have been simply adding pages to the book (index.ptree), and now suddenly it complains. What could be the problem? Thank you for taking the time to look into it.
mbutterick commented 3 years ago (Migrated from github.com)

has been working for a long time and I have been simply adding pages to the book (index.ptree), and now suddenly it complains

What changed? Did you update Pollen or Racket or any other underlying pieces?

> has been working for a long time and I have been simply adding pages to the book (index.ptree), and now suddenly it complains What changed? Did you update Pollen or Racket or any other underlying pieces?
pmarinov commented 3 years ago (Migrated from github.com)

The new thing is that I had added this at the end of index.ptree:

◊pages/commands.poly.pm{
  pages/commands_internal.poly.pm
}

The function (node-menu) is invoked in many pages prior commands.poly.pm. If I remove the call to (node-menu) from this page specifically the project also compiles successfully.

The strange thing is if I add it to any other part of index.ptree the project compiles (I do "pollen reset" between these experiments)

Otherwise, I've updated the machine a few weeks ago, but I believe I did a "pollen reset" after that.

The new thing is that I had added this at the end of index.ptree: ``` ◊pages/commands.poly.pm{ pages/commands_internal.poly.pm } ``` The function (node-menu) is invoked in many pages prior commands.poly.pm. If I remove the call to (node-menu) from this page specifically the project also compiles successfully. The strange thing is if I add it to any other part of index.ptree the project compiles (I do "pollen reset" between these experiments) Otherwise, I've updated the machine a few weeks ago, but I believe I did a "pollen reset" after that.
mbutterick commented 3 years ago (Migrated from github.com)

OK, thanks for the report. I’ve pushed a fix for this issue.

OK, thanks for the report. I’ve pushed a fix for this issue.
pmarinov commented 3 years ago (Migrated from github.com)

It works.

I did:

$ raco pkg update pollen
$ raco pollen reset
$ make all

And my project compiled.

Thank you for the fix. Thank you for making Pollen.

It works. I did: ``` $ raco pkg update pollen $ raco pollen reset $ make all ``` And my project compiled. Thank you for the fix. Thank you for making Pollen.
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
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-users#78
Loading…
There is no content yet.