jdx/mise · error

relative repo path `{path_raw}` must name a directory inside

Error message

relative repo path `{path_raw}` must name a directory inside the project root

What it means

A relative repo path that contains no Normal component — the empty string `""` or `"."` — would resolve to the project root itself; from_toml rejects it because bootstrap would otherwise try to manage the whole project directory as a repo checkout. Any path naming at least one real subdirectory passes (leading `./` is fine and is normalized away).

Source

Thrown at src/system/repos.rs:108

                bail!(
                    "relative repo paths are only allowed in a project config; use an absolute path or a `~/` path"
                );
            };
            if path.components().any(|component| {
                matches!(
                    component,
                    Component::ParentDir | Component::RootDir | Component::Prefix(_)
                )
            }) {
                bail!(
                    "relative repo path `{path_raw}` must stay within the project root (no `..` or absolute segments)"
                );
            }
            if !path
                .components()
                .any(|component| matches!(component, Component::Normal(_)))
            {
                bail!(
                    "relative repo path `{path_raw}` must name a directory inside the project root"
                );
            }
            // Join only the Normal segments so `./foobar` resolves to
            // `<root>/foobar` rather than `<root>/./foobar` — a `.` component
            // survives `Path::join` and leaks into every displayed path.
            let mut resolved = root.to_path_buf();
            for component in path.components() {
                if let Component::Normal(segment) = component {
                    resolved.push(segment);
                }
            }
            resolved
        };
        let Some(url) = config.url.map(|s| s.trim().to_string()) else {
            bail!("must set `url`");
        };
        if url.is_empty() {

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Name an actual subdirectory, e.g. `"vendor/tool"`
  2. If you meant the project currently being configured, remove the entry — a project does not declare itself as a bootstrap repo

Example fix

# before
[bootstrap.repos]
"." = { url = "https://example.com/tool.git" }

# after
[bootstrap.repos]
"vendor/tool" = { url = "https://example.com/tool.git" }
Defensive patterns

Strategy: validation

Validate before calling

use std::path::{Component, Path};

fn repo_path_names_a_directory(path_raw: &str) -> bool {
    Path::new(path_raw)
        .components()
        .any(|c| matches!(c, Component::Normal(_)))
}

Type guard

fn names_subdirectory(path_raw: &str) -> bool {
    std::path::Path::new(path_raw)
        .components()
        .any(|c| matches!(c, std::path::Component::Normal(_)))
}

Prevention

When it happens

Trigger: An `[bootstrap.repos]` key of `""`, `"."`, or a key made only of `./` segments in a project config.

Common situations: Placeholder keys left from templating; attempting to pin the current project as its own bootstrap repo; TOML copy-paste where the path was never filled in.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/ecdafba77751450d. Report an issue: GitHub.