Skip to content

Dependency Management

Corral is the dependency manager for Pony. It handles fetching dependencies, managing versions, and setting up the PONYPATH so the compiler can find your packages. Corral is currently in beta.

Installation

Install corral via ponyup:

ponyup update corral release

To build from source, see corral’s BUILD.md.

Getting Started

Initialize a project in the current directory:

corral init

This creates two files: corral.json (your project manifest) and lock.json (revision locks).

Add a dependency:

corral add github.com/ponylang/valbytes.git

Fetch all dependencies and lock their revisions:

corral update

Build your project with dependencies on the PONYPATH:

corral run -- ponyc

Arguments after -- are passed through to the command. For example, to build in debug mode:

corral run -- ponyc --debug

In your Pony source, import the dependency by package name:

use "valbytes"

After running corral update, two directories appear in your project:

  • _corral/ — per-project dependency workspace
  • _repos/ — local VCS repo cache

Add both to your .gitignore. They are managed by corral and do not belong in version control.

Configuration

corral.json

The project manifest. It describes your project and lists its dependencies:

{
  "info": {
    "name": "myproject",
    "description": "A Pony project"
  },
  "deps": [
    {
      "locator": "github.com/ponylang/valbytes.git",
      "version": ">=0.6.0 <2.0.0"
    }
  ]
}

The info section is optional metadata. The deps list contains one entry per dependency, each with a locator (where to find it) and an optional version constraint.

lock.json

Auto-generated by corral update. It pins each dependency to an exact revision so that builds are reproducible. Commit lock.json to version control.

More Information

See the corral README for an overview and the DOCS.md for the full command reference, all dependency types (remote git, local git, local path), and version constraint syntax.