[racket-dev] Can't change plot in DrRacket without getting link errors

From: Neil Toronto (neil.toronto at gmail.com)
Date: Sun Jan 5 17:31:52 EST 2014

Ah, I see. Now that I know that, I can duplicate the problem more 
easily: just having Plot's "draw.rkt" open in another tab gives me a 
link error. As soon as I close that tab, DrRacket uses the .zo files 
compiled by raco setup, and plotting works again.

Another workaround (besides closing a tab) is to choose "No debugging or 
profiling" from the language dialog. Apparently, that makes the .zo 
files DrRacket builds compatible with the output of raco setup. But I 
still have to wait for it to recompile everything the first time.

I think the current behavior would be fine with a small tweak. Is it 
possible for DrRacket to determine whether each .zo file in the 
"compiled" directory is up-to-date, and use those that are? Then I could 
either have DrRacket's on-demand compiler build Plot, or use raco setup.

(The former would be much easier if the "-c" flag could clean just one 
collection or package, though.)

Neil ⊥

On 01/03/2014 09:28 PM, Robby Findler wrote:
> Yes: as an experiment we decided to treat files that are open
> differently than other files for the purposes of recompiling them.
>
> Looks like that's probably a bad design decision. But it may just be a
> bug too, since I thought it was re-compiling more, not less, when you
> have the file open.
>
> Robby
>
>
> On Fri, Jan 3, 2014 at 7:22 PM, Jens Axel Søgaard <jensaxel at soegaard.net
> <mailto:jensaxel at soegaard.net>> wrote:
>
>     Try this:
>        - open the menu "Language" in DrRacket
>        - choose the menu item "Choose language..."
>        - click the button "Show details"
>        - remove the tick in "Populate 'compiled' directories (for faster
>     loading)
>
>     /Jens Axel
>
>
>
>     2014/1/4 Neil Toronto <neil.toronto at gmail.com
>     <mailto:neil.toronto at gmail.com>>:
>      > I do this:
>      >
>      >  * In DrRacket, open
>     "pkgs/plot-pkgs/plot-lib/plot/private/common/draw.rkt"
>      >
>      >  * Make a small change, save
>      >
>      >  * At the command line, "racket/bin/raco setup --no-docs -l plot"
>      >
>      >  * Run a test file in another tab in DrRacket that has (require plot)
>      >
>      >
>      > I wait a long time (I think it's recompiling) and get this error:
>      >
>      > link: bad variable linkage;
>      >  reference to a variable that has the wrong procedure or
>     structure-type
>      > shape
>      >   reference phase level: 0
>      >   variable module:
>      > "/home/neil/plt/pkgs/plot-pkgs/plot-lib/plot/private/common/draw.rkt"
>      >   variable phase: 0
>      >   reference in module:
>      >
>     "/home/neil/plt/pkgs/plot-pkgs/plot-gui-lib/plot/private/gui/plot2d.rkt"
>     in:
>      > draw-bitmap
>      >
>      >
>      > So I remove the "compiled" directory and try again. Same problem.
>      >
>      > Here's the kicker: I always get link errors *until I close
>     "draw.rkt" in
>      > DrRacket*. After that, I can remove the "compiled" directory,
>     rebuild, and
>      > run the program without errors.
>      >
>      > Does anybody know what's going on?
>      >
>      > Neil ⊥
>      > _________________________
>      >  Racket Developers list:
>      > http://lists.racket-lang.org/dev
>
>
>
>     --
>     --
>     Jens Axel Søgaard
>
>     _________________________
>        Racket Developers list:
>     http://lists.racket-lang.org/dev
>
>


Posted on the dev mailing list.