Package dependency problem

Hi,

as an exercise I developed a data structure, a double linked ring.
I create a github repository and I put it in the Racket catalog.
I took Ring Buffer and Priority Queues as examples.
Everything is fine except the package dependencies.

I installed the package through raco pkg install double-linked-ring and it
installed the data/double-linked-ring collection.
Then I tryed raco setup --check-pkg-deps double-linked-ring and
raco setup --check-pkg-deps data/double-linked-ring but they didn't work.
The error message was collection-path: collection not found.

Then tried raco setup --check-pkg-deps data and it worked, but
I can't understand the dependency messages:

raco setup: --- checking package dependencies ---
raco setup: found undeclared dependency:
raco setup:   mode: run
raco setup:   for package: "double-linked-ring"
raco setup:   on package: "rackunit-lib"
raco setup:   dependent source: C:\Users\scacco matto\AppData\Roaming\Racket\8.10\pkgs\double-linked-ring\data\compiled\test_rkt.zo
raco setup:   used module: (lib "rackunit/main.rkt")
raco setup: found undeclared dependency:
raco setup:   mode: run
raco setup:   for package: "double-linked-ring"
raco setup:   on package: "rackunit-lib"
raco setup:   dependent source: C:\Users\scacco matto\AppData\Roaming\Racket\8.10\pkgs\double-linked-ring\data\compiled\test_rkt.zo
raco setup:   used module: (lib "rackunit/text-ui.rkt")
raco setup: --- summary of package problems ---
raco setup: undeclared dependency detected
raco setup:   for package: "double-linked-ring"
raco setup:   on package:
raco setup:    "rackunit-lib"

Can you help me?

  1. Your package depends on rackunit-lib at runtime, not just at build time.
  2. raco setup in the default mode takes a collection as an argument. data is a collection, but data/double-linked-ring is not (it's a module path for a specific module) and double-linked-ring is also not (it's a package name). Probably you want raco setup --pkgs double-linked-ring or maybe raco setup data.
  3. You can use raco setup --fix-pkg-deps --pkgs double-linked-ring to fix the problem automatically.
2 Likes

It appears you have a test file that depends on rackunit, so you need to add rackunit-lib to your info.rkt.

N.B. raco setup typically accepts a collection name (such as data); if you want to use a package name, you use --pkgs.

1 Like

Thank you, where can I find it in the documentation?

Matteo

  1. Documentation about dependencies is here: 4 Package Metadata
  2. Documentation about raco setup command line use is here: 6.1 Running raco setup
  3. Documentation about dependency checking is here: 6.5 Package Dependency Checking
2 Likes

Thanks for your help.

I’m starting to understand the package system, especially the relationship between packages and collections. It’s very sofisticated and very interesting.

The easiest solution I found is to move the test.rkt module outside the data collection directory. This was the problem. Now the package works correctly.

I put the test module in the data directory on purpose, I wanted to see what would happen.

If you need a double linked ring you can use my package. The documentation is under the Data Structure section.

If you have suggestions on how to improve it you are welcome.

Matteo