"unknown command pkg" from raco pollen render
#4
Closed
opened 11 years ago by soegaard
·
8 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
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
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
I've seen this bug a couple times. It has something to do with inconsistent .zo files. I'll take a closer look.
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
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
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.
Odd indeed. Thanks for the explanation.
2014-04-27 23:24 GMT+02:00 Matthew Butterick notifications@github.com:
Jens Axel Søgaard
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 toraco 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 sawunknown 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.And thanks for the bug report.