6.5 Package Dependency Checking

► |  | raco: Racket Command-Line Tools

1 | raco make: Compiling Source to Bytecode
2 | raco exe: Creating Stand-Alone Executables
3 | raco distribute: Sharing Stand-Alone Executables
4 | raco planet: Automatic Package Distribution
5 | raco pkg: Package Management
6 | raco setup: Installation Management
7 | raco decompile: Decompiling Bytecode
8 | raco demod: Demodularizing Programs
9 | raco link: Library Collection Links
10 | raco pack: Packing Library Collections
11 | raco unpack: Unpacking Library Collections
12 | raco ctool: Working with C Code
13 | raco test: Run tests
14 | raco docs: Documentation Search
15 | raco expand: Macro Expansion
16 | raco read: Reading and Pretty-Printing
17 | raco scribble: Building Documentation
18 | Adding a raco Command
19 | Installation Configuration and Search Paths

▼ | 6 | raco setup: Installation Management

6.1 | Running raco setup
6.2 | Installing ".plt" Archives
6.3 | Controlling raco setup with "info.rkt" Files
6.4 | "info.rkt" File Format
6.5 | Package Dependency Checking
6.6 | API for Setup
6.7 | API for Installing ".plt" Archives
6.8 | API for Finding Installation Directories
6.9 | API for Reading "info.rkt" Files
6.10 | API for Relative Paths
6.11 | API for Collection Names
6.12 | API for Collection Searches
6.13 | API for Platform Specifications
6.14 | API for Cross-Platform Configuration
6.15 | API for Cross-References for Installed Manuals
6.16 | API for Materializing User-Specific Documentation
6.17 | Layered Installations
6.18 | Tethered Installations

► | 6.5 | Package Dependency Checking

6.5.1 | Declaring Build-Time Dependencies
6.5.2 | How Dependency Checking Works

On this page:

6.5.1 Declaring Build-Time Dependencies
6.5.2 How Dependency Checking Works

Racket
top contents ← prev up next →

### 6.5 Package Dependency Checking🔗ℹ

When raco setup is run with no arguments,Unless --check-pkg-deps is specified, dependency checking is disabled if any collection is specified for raco setup. after building all collections and documentation, raco setup checks package dependencies. Specifically, it inspects compiled files and documentation to check that references across package boundaries are reflected by dependency declarations in each package-level "info.rkt" file (see Package Metadata).

Dependency checking in raco setup is intended as an aid to package developers to help them declare dependencies correctly. The raco setup process itself does not depend on package dependency declarations. Similarly, a package with a missing dependency declaration may install successfully for other users, as long as they happen to have the dependencies installed already. A missing dependency creates trouble for others who install a package without having the dependency installed already.

Practically every package depends on the "base" package, which includes the collections that are in a minimal variant of Racket. Declaring a dependency on "base" may seem unnecessary, since its collections are always installed. In a future version of Racket, however, the minimal collections may change, and the new set of minimal collections will then have a package name, such as "base2". Declaring a dependency on "base" ensures forward compatibility, and raco setup complains if the declaration is missing.

To accommodate the early stages of package development, missing dependencies are not treated as an error for a package that has no dependency declarations.

#### 6.5.1 Declaring Build-Time Dependencies🔗ℹ

A build-time dependency is one that is not present in a package if it is converted to a binary package (see Source, Binary, and Built Packages). For example, "tests" and "scribblings" directories are stripped away in a binary package by default, so cross-package references from directories with those names are treated as build dependencies. Similarly, test and doc submodules are stripped away, so references within those submodules create build dependencies.

Build-time-only dependencies can be listed as build-deps instead of deps in a package’s "info.rkt" file. Dependencies listed in deps, meanwhile, are treated as both run-time and build-time dependencies. The advantage of using build-deps, instead of listing all dependencies in deps, is that a binary version of the package can install with fewer dependencies.

#### 6.5.2 How Dependency Checking Works🔗ℹ

Dependency checking uses ".zo" files, associated ".dep" files (see Dependency Files), and the documentation index. Dynamic references, such as through dynamic-require, are not visible to the dependency checker; only dependencies via require, define-runtime-module-path-index, and other forms that cooperate with raco make are visible for dependency checking.

Dependency checking is sensitive to whether a dependency is needed only as a build-time dependency. If raco setup detects that a missing dependency could be added as a build-time dependency, it will suggest the addition, but raco setup will not suggest converting a normal dependency to a build-time dependency (since every normal dependency counts as a build-time dependency, too).

top contents ← prev up next →