Package name conflicts

A recent discussion in another thread made me wonder: what are the limitations of the support for duplicated package names, and the practical problems of their possible existence?

In the documentation of Pkg and in the Julia manual there are very good explanations and examples, about how the Manifest.toml may have different packages with the same name. In both cases, the examples are related to the existence of an indirect dependency, which shares name with another indirect or a direct dependency.

But is it possible to have two direct dependencies with the same name? Pkg.add allows to pass the uuid for disambiguation, and in Project.toml all deps are accompanied by the uuid, so technically it seems feasible. But then: how can you disambiguate using them?

Also, how are different name-alike packages dealt with by the package manager? In .julia/packages, package folders are identified by their name; and the same happens with the registries.

Nope.

In .julia/packages there are subdirectories which are hashes based on the git-tree-sha which is unique for each version.

For the registry, there is a uuid → path table in the top-level file Registry.toml.

1 Like