www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - imports like in Go. to avoid package naming collisions [feature

reply AnimusPEXUS <animuspexus protonmail.com> writes:
because somebody registered package named 'dutils' on dub 
registry and now it collides with my local package with same name.
Dec 22 2022
next sibling parent rikki cattermole <rikki cattermole.co.nz> writes:
The solution that has been in consideration for a number of years now is 
name spacing based upon account.

But no one has implemented yet.
Dec 22 2022
prev sibling parent reply AnimusPEXUS <animuspexus protonmail.com> writes:
On Friday, 23 December 2022 at 03:56:08 UTC, AnimusPEXUS wrote:
 because somebody registered package named 'dutils' on dub 
 registry and now it collides with my local package with same 
 name.
I think I've came up with some collision avoid decision: I'll calc CRC for my 'github.com/AnimusPEXUS' profile and will use it like so: 'p315cffe8_packagename' so all my packages will have 'p315cffe8' prefix in names.. or maybe 'crc32_315cffe8_packagename', to define hash method.
Dec 25 2022
parent reply Siarhei Siamashka <siarhei.siamashka gmail.com> writes:
On Sunday, 25 December 2022 at 13:13:25 UTC, AnimusPEXUS wrote:
 On Friday, 23 December 2022 at 03:56:08 UTC, AnimusPEXUS wrote:
 because somebody registered package named 'dutils' on dub 
 registry and now it collides with my local package with same 
 name.
I think I've came up with some collision avoid decision: I'll calc CRC for my 'github.com/AnimusPEXUS' profile and will use it like so: 'p315cffe8_packagename' so all my packages will have 'p315cffe8' prefix in names.. or maybe 'crc32_315cffe8_packagename', to define hash method.
Why not `AnimusPEXUS.packagename`? Similar to `arsd.*`, `mir.*` or some other package name prefixes. This should work fine and avoid collisions until somebody intentionally hijacks your package prefix name (but in this case p315cffe8 won't save you either).
Dec 25 2022
next sibling parent AnimusPEXUS <animuspexus protonmail.com> writes:
On Sunday, 25 December 2022 at 14:12:11 UTC, Siarhei Siamashka 
wrote:
 On Sunday, 25 December 2022 at 13:13:25 UTC, AnimusPEXUS wrote:
 Why not `AnimusPEXUS.packagename`? Similar to `arsd.*`, `mir.*` 
 or some other package name prefixes. This should work fine and 
 avoid collisions until somebody intentionally hijacks your 
 package prefix name (but in this case p315cffe8 won't save you 
 either).
because 315CFFE8 covers whole 'github.com/AnimusPEXUS' which is less likely will change soon. and AnimusPEXUS doesn't (and shouldn't) mean anything to anybody on it's own.
Dec 25 2022
prev sibling next sibling parent AnimusPEXUS <animuspexus protonmail.com> writes:
On Sunday, 25 December 2022 at 14:12:11 UTC, Siarhei Siamashka 
wrote:
 On Sunday, 25 December 2022 at 13:13:25 UTC, AnimusPEXUS wrote:

 Why not `AnimusPEXUS.packagename`? Similar to `arsd.*`, `mir.*` 
 or some other package name prefixes. This should work fine and 
 avoid collisions until somebody intentionally hijacks your 
 package prefix name (but in this case p315cffe8 won't save you 
 either).
and to avoid cybersquatting on dub repo, I'd rather make and agreement with dub repo's owner to make 'p315cffe8' prefix locked to be used for my packages only.
Dec 25 2022
prev sibling parent cc <cc nevernet.com> writes:
On Sunday, 25 December 2022 at 14:12:11 UTC, Siarhei Siamashka 
wrote:
 Why not `AnimusPEXUS.packagename`? Similar to `arsd.*`, `mir.*` 
 or some other package name prefixes. This should work fine and 
 avoid collisions until somebody intentionally hijacks your 
 package prefix name
Gives me something to think about, personally. My nickname does not mean "C compiler", just in case anyone was curious, but I imagine that would still be a bit disorienting if I were to publish modules under it. 😏
Dec 25 2022