JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
610 stars 251 forks source link

Case insensitive search with `Pkg.add()` #3803

Open odunbar opened 4 months ago

odunbar commented 4 months ago

Issue

The Julia registry requires that package names are case insensitive e.g. see this recent denied request https://github.com/JuliaRegistries/General/pull/101489

For the package registry therefore, two packages ABCDE to Abcde cannot exist in the registry, However if ABCDE is registered then the following happens

Pkg.add("Abcde")
ERROR: The following package names could not be resolved:
 * Abcde (not found in project, manifest or registry)
   Suggestions: ABCDE

Request

As packages cannot be created with case sensitive names, could the search with Pkg also be made case insensitive?

Cheers, Ollie

DilumAluthge commented 4 months ago

In the General registry, we wouldn't allow both ABC and Abc. But someone could choose to allow that in a private registry.

GunnarFarneback commented 4 months ago

There's also the possibility of having ABC in one registry and Abc in another registry, and both being installed.

goerz commented 4 months ago

Apart from the policy decision that multiple packages that only differ in capitalization are too confusing, there are also underlying technical issues with git and case-insensitive file systems (Windows, macOS). So any other registry built around git would have a hard time allowing this, even if they wanted to.

In any case, this is a registry restriction, not a Julia restriction (Julia can distinguish packages that only differ in case just fine). It doesn’t seem like something we’d want to artificially restrict. Besides, it wouldn’t just have to change in Pkg, it would have also change in import/using if your goal is to be able to pretend that you renamed CLIMAParameters to ClimaParameter, and then we’re halfway to making Julia case-insensitive, which I’d emphatically say isn’t something we’d want.