LYR-PKG0004
a dependency's source holds no package of that name
Reported when the directory or repository a dependency names has no lyric.toml, when the package found there has another name, or when a package read from git names a dependency by a directory. The error points at the line of the declaring manifest.
Explanation
A dependency is a name and a source, and the manifest at the source must say the same name: geo = { path = "libs/geo" } needs a libs/geo/lyric.toml with name = "geo". A package read from git is its repository's content, so a directory beside it is no part of it: it names its own dependencies by git, or the root's [override] replaces them.
Check the path or the repository, and the name in the manifest found there.
Wrong
//- lyric.toml
[package]
name = "app"
version = "0.1.0"
[dependencies]
geo = { path = "libs/geo" }
//- src/main.lyr
fn main(): void {
}
Right
//- lyric.toml
[package]
name = "app"
version = "0.1.0"
[dependencies]
geo = { path = "libs/geo" }
//- libs/geo/lyric.toml
[package]
name = "geo"
version = "1.0.0"
//- libs/geo/src/lib.lyr
pub fn area(r: int): int {
return 3 * r * r;
}
//- src/main.lyr
import geo { area };
fn main(): void {
let _ = area(2);
}