Skip to content

Disallow new packages with only case differences from existing ones #352

Closed

Description

@bergmark

(updated by @hvr based on previous discussions)

We want to avoid throwing the baby out with the bathwater, as our main concern here is avoiding people (intentionally or not) hijacking other people's packages. But we certainly don't want to forbid legitimate uses, as package names are by design intended to be case-sensitive in nature and efforts are being made to make sure that this works reliably even in the presence of case-folding clashes (and other corner cases that occur even w/o case-folding being involved).

New Specification

Allow uploading the first release of a new package (i.e. whose exact name spelling wasn't allocated yet) if and only if

  1. the uploader is a member of any maintainer group of the packages in the equivalence class of (allocated) package names modulo case-folding, or
  2. there don't exist any such maintainers groups (i.e. the package name had no case-folded sibling on Hackage yet)

where "modulo case-folding" is intended to mean the obvious equivalence relation

on (==) (map toLower) :: String -> String -> Bool`

(NB: Hackage, by policy, only allows the ASCII subset of code-points for package names)

An additional orthogonal suggestion was voiced, to emit warnings for capitalized package names (or more generally starting with an upper-case letter) in the interest to politely nudge maintainers towards the predominant convention on Hackage to use all lower-case package names.


(origininal description)

This is confusing for users trying to find a package, might cause problems with case insensitive file systems, and it may also be a mistake by authors thinking the package name isn't taken.

I suggest keeping the existing "duplicates" but disallowing new ones from being uploaded.

Current list (ht @int-e):

BerkeleyDB berkeleydb
Buster buster
Checked checked
CLI cli
Command command
Condor condor
Dao dao
Data-Rope data-rope
DBus dbus
Digit digit
DocTest doctest
Eq eq
Extra extra
FileManip filemanip
FilePather filepather
Focus focus
Geodetic geodetic
GiST gist
HDBC-postgresql-hstore hdbc-postgresql-hstore
HLogger hlogger
HMM hmm
Hricket hricket
IndentParser indentparser
Interpolation interpolation
Irc irc
JackMiniMix jackminimix
Javasf javasf
Javav javav
KyotoCabinet kyotocabinet
Lattices lattices
Metrics metrics
Modulo modulo
Moe moe
Noise noise
Numbers numbers
Omega omega
Peano peano
Range range
Ref ref
Safe safe
SDL2-ttf sdl2-ttf
SmtLib smtLib
SVG2Q svg2q
Tables tables
Tensor tensor
Thrift thrift
Validation validation
XAttr xattr
Yocto yocto

Activity

  1. hvr commented on May 3, 2015

    @hvr
    Member

    There's also the issue that such packages may cause issues for file-systems that don't allow two filenames in the same folder differing only by case.

    However, I think it should be allowed to change the case of a package, if it turns out the originally chosen capitalization was not a good idea... maybe packages with different case should be considered to be the same package

  2. qnikst commented on Nov 2, 2017

    @qnikst

    Just another package of that form landed on hackage.. I'll try to make a patch that would reject new packages if they difference only with case, but would not have any other changes in the logic, i.e. packages with different case would not be considered as the same one. Will such patch be accepted?

  3. hvr commented on Nov 2, 2017

    @hvr
    Member

    Just another package of that form landed on hackage..

    which one?

    Will such patch be accepted?

    Not with that logic; there's a more differentiated logic I have in mind implementing. But there's no hurry.

  4. assigned and unassigned on Nov 2, 2017
  5. hvr commented on Nov 2, 2017

    @hvr
    Member

    Oh I see; the logic I have in mind would have prevented that questionable act of defiance; but in general we have to trust Hackage users to be reasonable, as there's a lot of opportunities to harm Hackage if you put your mind to it.

  6. gbaz commented on Jan 28, 2018

    @gbaz
    Contributor

    I would suggest a new warning/rule as well -- preventing users from uploading new packages that begin with an upper-case letter in general, as the convention is nearly all lower-case. (Existing packages of course have to be grandfathered in).

  7. tfausak commented on Jan 29, 2018

    @tfausak

    I would be in favor of something that either warned or prevented uploading packages with uppercase characters in their names. But also, to the issue at hand, I think Hackage should prevent you from uploading packages that only differ in capitalization.

  8. hvr commented on Jan 29, 2018

    @hvr
    Member

    @gbaz I wouldn't go as far as preventing but as part of the new candidate workflow, we can certainly add clearly visible warnings that cause some soft gravitational pull towards the desired convention of lower-case names (which I consider merely a SHOULD as per RFC2119; one may have very good technical reasons to go against the strong recommendation).

  9. gbaz commented on Mar 24, 2018

    @gbaz
    Contributor
  10. tom-bop commented on Jul 6, 2018

    @tom-bop

    For posterity, here's a list of all packages that were added between when @bergmark added their list and when case-clash uploading became disallowed (to be clear: if you want a complete list, add the two lists together):

    cabal Cabal
    Cassava cassava
    Compactable compactable
    Empty empty
    Fin fin
    gitHUD githud
    Hangman hangman
    hlist HList
    HPath hpath
    HSet hset
    Hydrogen hydrogen
    kalman Kalman
    Mecha mecha
    Mechs mechs
    naperian Naperian
    nomyx-core Nomyx-Core
    nomyx-language Nomyx-Language
    nomyx-web Nomyx-Web
    only Only
    perfecthash PerfectHash
    Plural plural
    quickson Quickson
    SCalendar scalendar
    SeqAlign seqalign
    Stack stack
    stream Stream
    tic-tac-toe Tic-Tac-Toe
    Top top
    unique Unique
    vec Vec
    Vulkan vulkan
    WAVE wave
    WaveFront wavefront
    XML xml
    
  11. tom-bop commented on Jul 9, 2018

    @tom-bop

    Here's a list of all packages with duplicate-modulo-case names, where none of the packages have been deprecated:

    Edit: strikethru are ones that have been fixed with deprecation, since publication of this list:

    ["berkeleydb","BerkeleyDB"]
    ["Buster","buster"]
    ["Cassava","cassava"]
    ["checked","Checked"]
    ["CLI","cli"]
    ["dao","Dao"]
    ["DBus","dbus"]
    ["Fin","fin"]
    ["Focus","focus"]
    ["gist","GiST"]

    ["Hangman","hangman"]
    ["hlist","HList"]
    ["HMM","hmm"]
    ["HPath","hpath"]
    ["hricket","Hricket"]
    ["HSet","hset"]
    ["Hydrogen","hydrogen"]
    ["interpolation","Interpolation"]
    ["Irc","irc"]
    ["KyotoCabinet","kyotocabinet"]
    ["Lattices","lattices"]
    ["Mecha","mecha"]
    ["Mechs","mechs"]
    ["Metrics","metrics"]
    ["Modulo","modulo"]
    ["Moe","moe"]
    ["naperian","Naperian"]
    ["noise","Noise"]
    ~~~["nomyx-core","Nomyx-Core"]~~~
    ~~~["nomyx-language","Nomyx-Language"]~~~
    ~~~["nomyx-web","Nomyx-Web"]~~~
    ["Numbers","numbers"]
    ["omega","Omega"]
    ["only","Only"]
    ["peano","Peano"]
    ["perfecthash","PerfectHash"]
    ["Plural","plural"]
    ["Range","range"]
    ["Ref","ref"]
    ["SmtLib","smtLib"]
    ["Stack","stack"]
    ["stream","Stream"]
    ["svg2q","SVG2Q"]
    ["tensor","Tensor"]
    ["thrift","Thrift"]
    ["tic-tac-toe","Tic-Tac-Toe"]
    ["Top","top"]
    ["unique","Unique"]
    ["vec","Vec"]
    ["Vulkan","vulkan"]
    ["WAVE","wave"]
    ["WaveFront","wavefront"]
    ["XML","xml"]
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions