dyoo / whalesong

Whalesong: Racket to JavaScript compiler
http://hashcollision.org/whalesong
250 stars 30 forks source link

dynamic-require for relaying out-of-band information is just breaking on me #56

Open dyoo opened 13 years ago

dyoo commented 13 years ago

It appears that the mechanism we're using to detect whether or not a module is javascript-implemented is breaking severely when the compiled program doesn't exist within the Whalesong directory.

This makes absolutely no sense to me. I'm trying to figure out what's wrong. But this is a critical problem, as it basically makes Whalesong unusable at the moment.

dyoo commented 13 years ago

This is much more bizarre than I thought. If we run Whalesong through the launcher, it behaves differently than if we run it through racket:

kui ~/tmp/tmp2 $ racket ~/work/whalesong/whalesong.rkt build hello.rkt
Writing program #<path:/gpfs/main/home/dyoo/tmp/tmp2/hello.js>
ERROR: The file #<path:/gpfs/main/home/dyoo/work/whalesong/lang/js/js.rkt> is a Racket module, but is written in the language scheme/base [#<path:/gpfs/main/sys/shared/psfu/local/projects/racket/releases/5.1.3/collects/scheme/base.rkt>], which Whalesong does not know how to compile.
Aborting compilation.

kui ~/tmp/tmp2 $ ~/work/whalesong/whalesong build hello.rkt
Writing program #<path:/gpfs/main/home/dyoo/tmp/tmp2/hello.js>
Skipping writing resource #<path:/gpfs/main/home/dyoo/tmp/tmp2/excanvas.js>; already exists
Skipping writing resource #<path:/gpfs/main/home/dyoo/tmp/tmp2/canvas.text.js>; already exists
Skipping writing resource #<path:/gpfs/main/home/dyoo/tmp/tmp2/optimer-normal-normal.js>; already exists
Writing html #<path:/gpfs/main/home/dyoo/tmp/tmp2/hello.html>
Writing manifest #<path:/gpfs/main/home/dyoo/tmp/tmp2/hello.appcache>
dyoo commented 13 years ago

More craziness:

kui ~/tmp/tmp2 $ racket /gpfs/main/home/dyoo/work/whalesong/whalesong.rkt build hello.rkt
Writing program #<path:/gpfs/main/home/dyoo/tmp/tmp2/hello.js>
Skipping writing resource #<path:/gpfs/main/home/dyoo/tmp/tmp2/excanvas.js>; already exists
Skipping writing resource #<path:/gpfs/main/home/dyoo/tmp/tmp2/canvas.text.js>; already exists
Skipping writing resource #<path:/gpfs/main/home/dyoo/tmp/tmp2/optimer-normal-normal.js>; already exists
Writing html #<path:/gpfs/main/home/dyoo/tmp/tmp2/hello.html>
Writing manifest #<path:/gpfs/main/home/dyoo/tmp/tmp2/hello.appcache>

kui ~/tmp/tmp2 $ racket ~/work/whalesong/whalesong.rkt build hello.rkt
Writing program #<path:/gpfs/main/home/dyoo/tmp/tmp2/hello.js>
ERROR: The file #<path:/gpfs/main/home/dyoo/work/whalesong/lang/js/js.rkt> is a Racket module, but is written in the language scheme/base [#<path:/gpfs/main/sys/shared/psfu/local/projects/racket/releases/5.1.3/collects/scheme/base.rkt>], which Whalesong does not know how to compile.
Aborting compilation.
dyoo commented 13 years ago

In 45e7ab60981b7c18a469366dc86e5a24e2348d3e, I'm forcing the toplevel launcher to run through a dynamic-require, and that seems to dodge whatever weirdness is breaking the internal use of dynamic-require. I'm very unhappy with this, as I don't quite understand the base cause of the problem yet.

dyoo commented 13 years ago

I'll need to chase this down when I have more time. Made a separate branch weird-path-dynamic-require.

Conditions for replicating the error: the whalesong directory needs to be in a symlinked directory. If you call into the launcher using the real name vs the symlinked name, you get different behavior.