Morganamilo/paru · error

repo does not have a URL or Path

Error message

repo {} does not have a URL or Path

What it means

Repo::path resolves the local checkout path of a repo-backed pkgbuild. It handles Url-with-path, Url-without-path, and Path variants, but if the RepoSource is None — the repo was configured with neither a URL nor a local Path — there is no way to derive a filesystem location, so it bails naming the repo.

Solutions

  1. Open paru.conf and add a `Url = <git-url>` (or `Path = /local/dir`) line to the named repo section
  2. Check for typos in the key names (Url/Path must match the expected capitalization)
  3. Remove the half-configured repo section if it's not needed
  4. Re-add the repo via the documented paru.conf syntax and retry

Example fix

// paru.conf before
[myrepo]
SigLevel = Optional
// after
[myrepo]
Url = https://github.com/user/myrepo.git
Defensive patterns

Strategy: validation

Validate before calling

// validate repo config before use
for repo in repos {
    if repo.url.is_none() && repo.path.is_none() {
        bail!("repo {} needs a Url or Path in paru.conf", repo.name);
    }
}

Prevention

When it happens

Trigger: Calling Repo::path (public) on a repo whose `source` is RepoSource::None: a repo registered in paru.conf (or via the pkgbuild repos feature) without either a Url = or Path = key.

Common situations: Hand-editing paru.conf and adding a repo section with only a name; typo'd keys (e.g. `url =` lowercase in a case-sensitive parser or `Repo =` misformat); repos created programmatically without setting source; config migration dropping the URL field.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of Morganamilo/paru@9ac3578807 (2026-09-12). Data as JSON: /api/errors/63b05282361196ac. Report an issue: GitHub.

Appendix: source

Thrown at src/pkgbuild.rs:91

        PkgbuildRepo {
            depth: 2,
            path,
            name,
            source: RepoSource::None,
            skip_review: false,
            force_srcinfo: false,
            pkgs: OnceCell::new(),
        }
    }

    pub fn path(&self) -> Result<PathBuf> {
        match &self.source {
            RepoSource::Url(_, Some(path)) => {
                Ok(self.path.join(path.strip_prefix("/").unwrap_or(path)))
            }
            RepoSource::Url(_, None) => Ok(self.path.clone()),
            RepoSource::Path(path) => Ok(path.clone()),
            RepoSource::None => bail!(tr!("repo {} does not have a URL or Path")),
        }
    }

    pub fn pkgs(&self, config: &Config) -> &[PkgbuildPkg] {
        self.pkgs
            .get_or_init(move || Arc::new(self.read_pkgs(config)))
    }

    pub fn base(&self, config: &Config, base: &str) -> Option<&PkgbuildPkg> {
        self.pkgs(config)
            .iter()
            .find(|p| p.srcinfo.base.pkgbase == base)
    }

    pub fn pkg(&self, config: &Config, pkg: &str) -> Option<(&PkgbuildPkg, &srcinfo::Package)> {
        self.pkgs(config)
            .iter()
            .find_map(|srcinfo| srcinfo.srcinfo.pkg(pkg).map(|p| (srcinfo, p)))

View on GitHub (pinned to 9ac3578807)