[racket] Symlinking Racket programs
In article <1362029952.21030%dtp at mindstory.com>,
"David T. Pierson" <dtp at mindstory.com>
wrote:
> On Tue, Feb 26, 2013 at 06:40:23PM -0600, Brian Mastenbrook wrote:
> > What is the expected behavior of module resolution when symlinking a
> > Racket program, particularly one executed as a script using a shebang
>
> I think Racket is doing the right thing here. If it did what you seem
> to be expecting, then a working setup would break when replacing a
> non-symlinked file with a symlink to a file with the same contents in
> another directory. I don't think Racket should be trying to defeat the
> abstraction mechanism that symlinks provide.
That's a good point; I think the difference in mental model I have here
is that I naturally expected linking a top-level executable file to a
different directory to work. I wouldn't necessarily expect it to work
that way for ordinary modules.
> I'd like to offer an alternative solution for you but I'm not sure I
> understand your requirements exactly. Can't you just use a shell
> script? Something like:
>
> #!/bin/sh
> exec racket /path/to/foo/foo.rkt "$@"
That's pretty much what "raco exe -l" does now. It works, as do a
variety of other solutions (including just regular "raco exe"), but I
was still somewhat surprised in this case. Perhaps my intuitions led me
astray.
--
Brian Mastenbrook
brian at mastenbrook.net
http://brian.mastenbrook.net/