[racket] raco exe difficutly with Release 5.3.1 & stateless web server
On 01/29/2013 12:00 PM, Galler wrote:
> *Preliminary Solution:*
>
> I will send more info in more detail when I've got a test case, also I
> need to test against 5.3.1 (works on 5.3) but:
>
> 1) The cause of the flomap exception was a user-code dependency on the
> racket library* stepper.rkt* in a *#lang web server module*, complied
> under *raco exe*
>
> 2) The dependency arose through a *(require macro-debugger/stepper)* in
> multiple *#lang racket *sub-modules, again within user-code
>
> 3) this particular dependency was completely unneccessary for production
> code, and was eliminated by the user.
>
> I believe my problem is of limited general interest and does not
> demonstrate any significant flaws in Racket 5.3.1.
Not significant, no. I'm curious about how this happened, though.
The module "macro-debugger/view/stepper.rkt" uses `images/flomap' only
at expansion time. It works like all the other Racket GUI programs that
use icons and logos from the `images' collection. It renders them at
expansion time as flomaps, converts the flomaps to bitmaps, encodes the
bitmaps as PNGs, and inlines the PNGs as bytes expressions. At runtime,
all it does is run the bytes through a PNG decoder.
Example code taken from "stepper.rkt":
#lang racket
(require images/compile-time
(for-syntax images/icons/arrow images/icons/style))
(define navigate-up-icon
(compiled-bitmap (up-arrow-icon #:color syntax-icon-color
#:height (toolbar-icon-height))))
The definition expands to (define navigate-up-icon (load-png
#"<some-bytes>")).
In your program, (require macro-debugger/stepper) should load a ".zo"
file, which has already been fully expanded and compiled. Anything that
had to do with flomaps should have already been done.
I know next to nothing about compiling executables for Racket code,
though. Can someone who knows more than I do explain what happened?
Neil ⊥