"unknown command pkg" from raco pollen render #4

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

I get the following error when I follow the example in the docs.
I can't figure out what went wrong.

mba-5:pollen-example soegaard$ cat hello-world.txt.pp

lang pollen

Goodbye Stranger
Breakfast in America
Take the Long Way Home

mba-5:pollen-example soegaard$ ~/racket-april-2014/racket/racket/bin/raco pollen render hello-world.txt.pp
unknown command pkg

I get the following error when I follow the example in the docs. I can't figure out what went wrong. mba-5:pollen-example soegaard$ cat hello-world.txt.pp # lang pollen Goodbye Stranger Breakfast in America Take the Long Way Home mba-5:pollen-example soegaard$ ~/racket-april-2014/racket/racket/bin/raco pollen render hello-world.txt.pp unknown command pkg
soegaard commented 11 years ago (Migrated from github.com)

More pieces for the puzzle below. The problem is not "render", but using pollen from raco.

mba-5:pollen-example soegaard$ ~/racket-april-2014/racket/racket/bin/raco pkg install pollen
Resolving "pollen" via http://pkgs.racket-lang.org
Using cached13985886651398588665234 for a68459c37d
raco pkg install: package is already installed
package: pollen

mba-5:pollen-example soegaard$ ~/racket-april-2014/racket/racket/bin/raco pollen help
unknown command pkg

More pieces for the puzzle below. The problem is not "render", but using pollen from raco. mba-5:pollen-example soegaard$ ~/racket-april-2014/racket/racket/bin/raco pkg install pollen Resolving "pollen" via http://pkgs.racket-lang.org Using cached13985886651398588665234 for https://github.com/mbutterick/pollen/tarball/a68459c37d5ea96c627a4447803717a230dd3ca9 raco pkg install: package is already installed package: pollen mba-5:pollen-example soegaard$ ~/racket-april-2014/racket/racket/bin/raco pollen help unknown command pkg
mbutterick commented 11 years ago (Migrated from github.com)

I've seen this bug a couple times. It has something to do with inconsistent .zo files. I'll take a closer look.

I've seen this bug a couple times. It has something to do with inconsistent .zo files. I'll take a closer look.
soegaard commented 11 years ago (Migrated from github.com)

Thanks for the hint. If it is related to .zo files, then the problem must be on my end.
Maybe it is due to the memoize package?

See http://bugs.racket-lang.org/query/?cmd=view&pr=14473

Thanks for the hint. If it is related to .zo files, then the problem must be on my end. Maybe it is due to the memoize package? See http://bugs.racket-lang.org/query/?cmd=view&pr=14473
soegaard commented 11 years ago (Migrated from github.com)

I fixed the problem with memoize, but it didn't help:

mba-5:pollen-example soegaard$ ~/racket-april-2014/racket/racket/bin/raco setup pollen
raco setup: version: 6.0.1.5 [3m]
raco setup: installation name: development
raco setup: variants: 3m
raco setup: main collects: /Users/soegaard/racket-april-2014/racket/racket/collects
raco setup: collects paths:
raco setup: /Users/soegaard/Library/Racket/development/collects
raco setup: /Users/soegaard/racket-april-2014/racket/racket/collects
raco setup: main pkgs: /Users/soegaard/racket-april-2014/racket/racket/share/pkgs
raco setup: pkgs paths:
raco setup: /Users/soegaard/racket-april-2014/racket/racket/share/pkgs
raco setup: /Users/soegaard/racket-april-2014/racket/racket/share/devel-pkgs
raco setup: /Users/soegaard/Library/Racket/development/pkgs
raco setup: links files:
raco setup: /Users/soegaard/racket-april-2014/racket/racket/share/links.rktd
raco setup: /Users/soegaard/racket-april-2014/racket/racket/share/devel-pkgs/links.rktd
raco setup: /Users/soegaard/Library/Racket/development/links.rktd
raco setup: main docs: /Users/soegaard/racket-april-2014/racket/racket/doc
raco setup: --- updating info-domain tables ---
raco setup: --- pre-installing collections ---
raco setup: --- installing foreign libraries ---
raco setup: --- installing shared files ---
raco setup: --- compiling collections ---
raco setup: --- parallel build using 4 jobs ---
raco setup: 3 making: /pollen
raco setup: 3 making: /pollen/scribblings
raco setup: 3 making: /pollen/server-extras
raco setup: 3 making: /pollen/tests
raco setup: 3 making: /pollen/tests/samples
raco setup: --- creating launchers ---
raco setup: --- installing man pages ---
raco setup: --- building documentation ---
raco setup: 3 skipping: /Users/soegaard/pdf-render/main.scrbl
raco setup: 1 skipping: /memoize/memoize/memoize.scrbl
raco setup: 0 skipping: /dherman/memoize.plt/3/1/memoize.scrbl
raco setup: 1 skipping: /soegaard/sicp.plt/2/1/sicp-manual.scrbl
raco setup: --- installing collections ---
raco setup: --- post-installing collections ---
mba-5:pollen-example soegaard$ ~/racket-april-2014/racket/racket/bin/raco pollen render hello-world.txt.pp
unknown command pkg

I fixed the problem with memoize, but it didn't help: mba-5:pollen-example soegaard$ ~/racket-april-2014/racket/racket/bin/raco setup pollen raco setup: version: 6.0.1.5 [3m] raco setup: installation name: development raco setup: variants: 3m raco setup: main collects: /Users/soegaard/racket-april-2014/racket/racket/collects raco setup: collects paths: raco setup: /Users/soegaard/Library/Racket/development/collects raco setup: /Users/soegaard/racket-april-2014/racket/racket/collects raco setup: main pkgs: /Users/soegaard/racket-april-2014/racket/racket/share/pkgs raco setup: pkgs paths: raco setup: /Users/soegaard/racket-april-2014/racket/racket/share/pkgs raco setup: /Users/soegaard/racket-april-2014/racket/racket/share/devel-pkgs raco setup: /Users/soegaard/Library/Racket/development/pkgs raco setup: links files: raco setup: /Users/soegaard/racket-april-2014/racket/racket/share/links.rktd raco setup: /Users/soegaard/racket-april-2014/racket/racket/share/devel-pkgs/links.rktd raco setup: /Users/soegaard/Library/Racket/development/links.rktd raco setup: main docs: /Users/soegaard/racket-april-2014/racket/racket/doc raco setup: --- updating info-domain tables --- raco setup: --- pre-installing collections --- raco setup: --- installing foreign libraries --- raco setup: --- installing shared files --- raco setup: --- compiling collections --- raco setup: --- parallel build using 4 jobs --- raco setup: 3 making: <pkgs>/pollen raco setup: 3 making: <pkgs>/pollen/scribblings raco setup: 3 making: <pkgs>/pollen/server-extras raco setup: 3 making: <pkgs>/pollen/tests raco setup: 3 making: <pkgs>/pollen/tests/samples raco setup: --- creating launchers --- raco setup: --- installing man pages --- raco setup: --- building documentation --- raco setup: 3 skipping: /Users/soegaard/pdf-render/main.scrbl raco setup: 1 skipping: <pkgs>/memoize/memoize/memoize.scrbl raco setup: 0 skipping: <planet>/dherman/memoize.plt/3/1/memoize.scrbl raco setup: 1 skipping: <planet>/soegaard/sicp.plt/2/1/sicp-manual.scrbl raco setup: --- installing collections --- raco setup: --- post-installing collections --- mba-5:pollen-example soegaard$ ~/racket-april-2014/racket/racket/bin/raco pollen render hello-world.txt.pp unknown command pkg
mbutterick commented 11 years ago (Migrated from github.com)

This problem was triggered by pollen/raco getting precompiled during raco setup. If it is left uncompiled, the problem seems to be fixed. (Though the reasons for this will have to remain mysterious to me.) I have updated info.rkt accordingly.

This problem was triggered by pollen/raco getting precompiled during raco setup. If it is left uncompiled, the problem seems to be fixed. (Though the reasons for this will have to remain mysterious to me.) I have updated info.rkt accordingly.
soegaard commented 11 years ago (Migrated from github.com)

Odd indeed. Thanks for the explanation.

2014-04-27 23:24 GMT+02:00 Matthew Butterick notifications@github.com:

Closed #4 https://github.com/mbutterick/pollen/issues/4.


Reply to this email directly or view it on GitHubhttps://github.com/mbutterick/pollen/issues/4
.

Jens Axel Søgaard

Odd indeed. Thanks for the explanation. 2014-04-27 23:24 GMT+02:00 Matthew Butterick notifications@github.com: > Closed #4 https://github.com/mbutterick/pollen/issues/4. > > — > Reply to this email directly or view it on GitHubhttps://github.com/mbutterick/pollen/issues/4 > . ## ## Jens Axel Søgaard
mbutterick commented 11 years ago (Migrated from github.com)

Actually, maybe it's not that mysterious.

When you do raco setup pollen, the compiler performs any macro expansion as part of making the bytecode files, meaning all macros happen at (pre)compile time.

Whereas my pollen/raco file, which handles the arguments that are passed to raco pollen, depends on macros that need to be evaluated at runtime. So precompiling this file defeats the intended behavior. (In fact, that's why you saw unknown command pkg, because "pkg" was the argument sitting in the command line when pollen/raco got precompiled during setup.)

Strictly speaking, I didn't need to do it this way. But the raco pollen start command invokes the Racket webserver, which takes a long time to load. So it's a lot snappier to move the argument parsing into the syntax layer so I can avoid loading unnecessary modules.

If pollen/raco is omitted from the precompiled source files, it has to be expanded at runtime. This is the right result.

Actually, maybe it's not that mysterious. When you do `raco setup pollen`, the compiler performs any macro expansion as part of making the bytecode files, meaning all macros happen at (pre)compile time. Whereas my `pollen/raco` file, which handles the arguments that are passed to `raco pollen`, depends on macros that need to be evaluated at runtime. So precompiling this file defeats the intended behavior. (In fact, that's why you saw `unknown command pkg`, because "pkg" was the argument sitting in the command line when pollen/raco got precompiled during setup.) Strictly speaking, I didn't need to do it this way. But the `raco pollen start` command invokes the Racket webserver, which takes a long time to load. So it's a lot snappier to move the argument parsing into the syntax layer so I can avoid loading unnecessary modules. If `pollen/raco` is omitted from the precompiled source files, it has to be expanded at runtime. This is the right result.
mbutterick commented 11 years ago (Migrated from github.com)

And thanks for the bug report.

And thanks for the bug report.
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#4
Loading…
There is no content yet.