cabal
cabal copied to clipboard
Make cabal check reject packages with invalid file names
Describe the feature request
Make cabal check reject packages when source distribution contains files with invalid names on any operating system. For example aux is not valid on Windows (and Windows file systems are case insensitive)., so e.g. module Foo.Aux.Helpers or Language.Con, Foreign.Nul are a bad idea.
Additional context
I think calling explicitly, System.FilePath.Posix.isValid and System.FilePath.Windows.isValid would be enough.
Sounds reasonable. @ffaf1, any thoughts?
It is a sensible request. We already do some isValid checks with regard to Windows
https://github.com/haskell/cabal/blob/1e93e57d20801a333c6fae05573c2e0687a17e75/Cabal/src/Distribution/PackageDescription/Check.hs#L574-L580
We just need to get this right with regard to — say — excluding autogenerated modules and the like.
We just need to get this right with regard to — say — excluding autogenerated modules
You don't need to exclude them. Autogenerated modules will also have files on the filesystem. (EDIT: when autogenerated...)
I have put up a MR #10816
Let me know if you think this is along the right lines. There are already quite comprehensive checks in place for most of the paths you can write in a cabal file but not the module names.