Skip to content
This repository has been archived by the owner on Jul 23, 2022. It is now read-only.

"unknown command pkg" from raco pollen render #4

Closed
soegaard opened this issue Apr 27, 2014 · 8 comments
Closed

"unknown command pkg" from raco pollen render #4

soegaard opened this issue Apr 27, 2014 · 8 comments

Comments

@soegaard
Copy link

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
Copy link
Author

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
Copy link
Owner

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

@soegaard
Copy link
Author

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
Copy link
Author

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

@mbutterick
Copy link
Owner

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
Copy link
Author

Odd indeed. Thanks for the explanation.

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

Closed #4 #4.


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

Jens Axel Søgaard

@mbutterick
Copy link
Owner

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
Copy link
Owner

And thanks for the bug report.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants