[racket] many permissions & other problems using packages in 5.3.6... workarounds?

From: John Clements (clements at brinckerhoff.org)
Date: Sun Oct 13 16:54:37 EDT 2013

On 10/13/2013 11:55 AM, Matthew Flatt wrote:
> At Sun, 13 Oct 2013 13:43:27 -0400, "David T. Pierson" wrote:
>> On Sun, Oct 13, 2013 at 08:00:11AM -0600, Matthew Flatt wrote:
>>> I imagine that we need to make `raco pkg` attempt to rename a directory
>>> to something like "trash" when the directory can't be deleted (and
>>> purge any found "trash" directories that can be deleted).
>> I might be misunderstanding the problem, but...
>>
>> If Racket on Windows can't delete the directory because a file
>> downstream of that directory is open, then Windows will not allow
>> renaming the directory either.
> Ah, that's probably often true.
>
> Windows seems to allow renaming in many cases when it wouldn't allow
> deleting. For example, if I load a DLL from Racket, then I'm not able
> to delete the DLL file, but I can rename its enclosing directory (and
> that's an experiment that I tried earlier). After I start Racket,
> however, I see that I cannot rename the directory that contains Racket.
>
> Maybe the solution is that the package manager should install a package
> to a directory "<name>+1" (and so on) if for any reason it can't
> replace the directory "<name>".
>
>
>> Is Racket opening some file in that directory and holding it open?
> In the case of "portaudio", maybe it's a DLL. I don't have a guess for
> "rsound".

Yes, rsound also has a dll, used for fast copying and overlaying of 
sounds in c sample buffers.

I've investigated a bit more, by firing up windows and doing things in 
the wrong order deliberately.  It appears to me that the most likely 
sequence of events is this:

1) The students try to update rsound, and windows gets upset because 
you're trying to delete a .dll that is currently attached to DrRacket.
2) The students then (sensibly) restart DrRacket, and try again.
3) This time, DrR believes that an update is already in progress, and is 
unhappy to discover that the package directory is still present.  Here's 
the backtrace I was able to obtain:

make-directory: cannot make directory
   path: 
C:\Users\clements\AppData\Roaming\Racket\5.3.6\pkgs\installed\rsound
   system error: File exists; errno=17
   context...:
    C:\Program Files\Racket\collects\racket\file.rkt:66:0: 
copy-directory/files
    C:\Program Files\Racket\collects\pkg\lib.rkt:959:7
    C:\Program Files\Racket\collects\pkg\lib.rkt:449:0: install-packages55
    C:\Program Files\Racket\collects\racket\file.rkt:295:8
    C:\Program Files\Racket\collects\racket\file.rkt:284:0: 
call-with-file-lock24
    C:\Program Files\Racket\collects\mrlib\terminal.rkt:150:7
    C:\Program Files\Racket\collects\mred\private\wx\common\queue.rkt:451:6
    C:\Program Files\Racket\collects\mred\private\wx\common\queue.rkt:502:32
    C:\Program 
Files\Racket\collects\racket\private\more-scheme.rkt:146:2: 
call-with-break-parameterization
    C:\Program 
Files\Racket\collects\mred\private\wx\common\queue.rkt:397:18: loop


Thanks for all the help!

John


>
> ____________________
>    Racket Users list:
>    http://lists.racket-lang.org/users


Posted on the users mailing list.