Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

raco setup: directory does not exist for collection

Tags:

racket

When I try to install a package through raco, I get a strange error message:

raco setup: directory: #<path:/Users/ben/code/racket/benchmark/tr-pfds/pfds> does not exist for collection: "pfds"

Even stranger, running raco pkg show doesn't show anything about this "pfds" collection:

Installation-wide:
 Package              Checksum                                     Source
 main-distribution    f07e2d4bf2708c1085be38eca18aa9eb6755e547    (catalog main-distribution)
 racket-lib           41c7b3221006758c5a840a18dcc0d265632f14c2    (catalog racket-lib)
 [178 auto-installed packages not shown]
User-specific for installation "6.1":
 Package            Checksum                                    Source
 benchmark          1237b50804bb42bd242ba7b3eb6e2b98794b40ee    (catalog benchmark)
 feature-profile    109e89701839a6d2fed9d1713aef8d21cc8b54d4    (catalog feature-profile)
 quickcheck         1afac87825c5da8b35b327f5df3f1f9e1bf3cb9d    (catalog quickcheck)
 rackunit-chk       9c6e9c346c0e83bd3bb8dd16e321a2fa3e02b42e    (catalog rackunit-chk)

Another thing I tried was just removing the "pfds" collection, but that didn't go well either:

raco6.1 pkg remove pfds
Removing pfds
raco6.1 pkg remove: package not currently installed
  package: pfds
  current scope: user

But in retrospect this error makes sense to me, because the directory /Users/ben/code/racket/benchmark/tr-pfds/pfds doesn't exist on my machine. I deleted it a few weeks ago.

Does anyone know what's going on?

like image 430
Ben Greenman Avatar asked Sep 27 '22 21:09

Ben Greenman


1 Answers

Have you used raco link in the past? You can sometimes see this error message if you have raco linked a directory that you have since deleted.

There are three things you can try:

  1. Run raco link --repair. This should ideally repair your installation by removing all dead links.

  2. Run raco link -r pkfds, this should remove your pfds link.

  3. Check your links.rktd file, which can be found in:

    • (Linux) ~/.racket/<version>/links.rktd
    • (OS X) ~/Library/Racket/<version>/links.rktd
    • (Windows) C:\Users\<username>\AppData\Roaming\Racket\<version>\links.rktd

In the file, you may see a link to pfds, which is causing the issue.

Once the link is removed, raco setup should work normally again.

(As an addendum, it might be interesting to note that raco link has an API call from within Racket.)

like image 65
Leif Andersen Avatar answered Oct 03 '22 13:10

Leif Andersen