Skip to content

Build a repository from its layout

This page shows how to build a repository whose directory layout already says what it contains, without writing a project file (Mode 1).

Before you start

  • Install reprobuild.
  • The repository keeps each program in apps/<name>/ and each library in libs/<name>/, in one language, following that language's own layout inside each directory.
  • The repository has no repro.nim at its root. If it has one, reprobuild uses that instead.

A repository of that shape looks like this:

my-repository/
├── apps/
│   └── calc/
│       └── src/main.rs      # use mathlib::add;
└── libs/
    └── mathlib/
        └── src/lib.rs

Steps

1. Check what reprobuild infers

From the repository root, check what reprobuild infers:

repro show-conventions

It lists each target, its language and source directory, and each dependency it found, with the import line that shows it.

2. Build

Build:

repro build --tool-provisioning=path

reprobuild keeps what it inferred under .repro/. It does not write a project file into your repository.

Check that it worked

repro show-conventions lists every directory under apps/ and libs/ as a target, and every dependency you expect between them.

If reprobuild stops

  • An import matches two candidates. Mode 1 refuses to choose and names both. Write a project file that states the dependency, which moves the repository to Mode 3.
  • The repository mixes languages. Mode 1 handles one language per repository. Write a project file instead.