[Hackage] #191: Hackage should check for common QA problems in ghc-options

#191: Hackage should check for common QA problems in ghc-options --------------------------+------------------------------------------------- Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal | Version: 1.2.2.0 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.8.1 Platform: Linux | --------------------------+------------------------------------------------- Simple test that many packages have is dodgy ghc-options, or options that would be suitable for development but not release. It should be easy to check for these. Suggestions: {{{ghc-options: -Wall -Werror}}} is a very bad combination. It means the package will break silently as soon as the next version of ghc adds a new warning, which generally does happen every major release. {{{ghc-options: -fasm}}} is unnecessary and breaks on all arches except for x86, x86-64 and ppc. {{{ghc-options: -O}}} is unnecessary since Cabal does that itself and it prevents people from configuring with the {{{--disable-optimization}}} flag. {{{ghc-options: -O2}}} may be necessary in some circumstances but people should not use it routinely for the same reasons as -O and since -O2 take a lot longer to compile most of the time and usually with little benefit. {{{ghc-options: -ffi}}} or {{{-fffi}}} use extensions: ForeignFunctionInterface. Once #190 is implemented then {{{ghc-options: -fvia-C}}} will be unnecessary too. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/191 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#191: Hackage should check for common QA problems in ghc-options --------------------------+------------------------------------------------- Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.1 | Platform: Linux --------------------------+------------------------------------------------- Comment (by guest): `ghc-options: -Wall -Werror` would be quite reasonable inside an `if flag(devel)`, though. Ian -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/191#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#191: Hackage should check for common QA problems in ghc-options ----------------------------+----------------------------------------------- Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.1 | Platform: Linux ----------------------------+----------------------------------------------- Changes (by duncan): * difficulty: normal => easy (<4 hours) Comment: Adding at least some of these should be an easy project for someone. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/191#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#191: Hackage should check for common QA problems in ghc-options --------------------------------+------------------------------------------- Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: HackageDB website | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.1 | Platform: Linux --------------------------------+------------------------------------------- Old description:
Simple test that many packages have is dodgy ghc-options, or options that would be suitable for development but not release. It should be easy to check for these.
Suggestions:
{{{ghc-options: -Wall -Werror}}} is a very bad combination. It means the package will break silently as soon as the next version of ghc adds a new warning, which generally does happen every major release.
{{{ghc-options: -fasm}}} is unnecessary and breaks on all arches except for x86, x86-64 and ppc.
{{{ghc-options: -O}}} is unnecessary since Cabal does that itself and it prevents people from configuring with the {{{--disable-optimization}}} flag.
{{{ghc-options: -O2}}} may be necessary in some circumstances but people should not use it routinely for the same reasons as -O and since -O2 take a lot longer to compile most of the time and usually with little benefit.
{{{ghc-options: -ffi}}} or {{{-fffi}}} use extensions: ForeignFunctionInterface.
Once #190 is implemented then {{{ghc-options: -fvia-C}}} will be unnecessary too.
New description: Simple test that many packages have is dodgy ghc-options, or options that would be suitable for development but not release. It should be easy to check for these. Suggestions: {{{ghc-options: -Wall -Werror}}} is a very bad combination. It means the package will break silently as soon as the next version of ghc adds a new warning, which generally does happen every major release. {{{ghc-options: -fasm}}} is unnecessary and breaks on all arches except for x86, x86-64 and ppc. {{{ghc-options: -O}}} is unnecessary since Cabal does that itself and it prevents people from configuring with the {{{--disable-optimization}}} flag. {{{ghc-options: -O2}}} may be necessary in some circumstances but people should not use it routinely for the same reasons as -O and since -O2 take a lot longer to compile most of the time and usually with little benefit. {{{ghc-options: -ffi}}} or {{{-fffi}}} use extensions: ForeignFunctionInterface. Once #190 is implemented then {{{ghc-options: -fvia-C}}} will be unnecessary too. == == Comment (by ross@soi.city.ac.uk): I think it's a library issue, specifically `parsePackageDescription` and `sanityCheckPackage` in `Distribution.PackageDescription`. If either of these functions fails, the HackageDB upload will fail and show the error. If they produce warnings, the upload succeeds but shows the warnings (as does check). Currently HackageDB has additional fatal errors for * version numbers like 00.02 that change when parsed and printed. and additional warnings for * missing Category, Description, Maintainer or Synopsis field. * over-long Synopsis field. * exposed modules that use unallocated top-level names in the module hierarchy. But there are quite a few packages in the archive that triggered these warnings. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/191#comment:4 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#191: Hackage should check for common QA problems in ghc-options --------------------------------+------------------------------------------- Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: HackageDB website | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.1 | Platform: Linux --------------------------------+------------------------------------------- Comment (by duncan): Yes it is a lib issue. The code to do these checks should be in the library and used in hackagedb and cabal-install. However I think the interpretation of some of the checks should be different in the hackage context than in a private build context. So something that might be a warning in cabal locally, like a missing build- type should be a fatal error for hackagedb. Perhaps we should improve sanityCheckPackage or add an extra qaCheckPackage that gives enough info for hackage and cabal to react differently. That one about version number parsing should be integrated into the cabal lib. It's ticket 194#. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/191#comment:5 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#191: Hackage should check for common QA problems in ghc-options ----------------------------+----------------------------------------------- Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Cabal-1.4 Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.1 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * platform: Linux => * milestone: => Cabal-1.4 -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/191#comment:7 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#191: Hackage should check for common QA problems in ghc-options ----------------------------+----------------------------------------------- Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Cabal-1.4 Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.1 | Platform: ----------------------------+----------------------------------------------- Comment (by duncan): More QA and sanity checks: * configure should error out if a configuration gives duplication in the exposed modules, or other modules (I've seen this happen accidentally in the real world resulting in much confusion). * qa should check that exposed modules does not change with different configurations. This would be a non-fatal warning because the base package does it :-). -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/191#comment:8 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#191: Hackage should check for common QA problems in ghc-options ----------------------------+----------------------------------------------- Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Cabal-1.4 Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.1 | Platform: ----------------------------+----------------------------------------------- Comment (by duncan): Yet another QA check: * qa should check that if build-type: Configure then the configure file must exist and be in extra-source-files, so that it gets included into the tarball. This is partly for hackage's qa checks so that it can reject packages produced by older cabal versions that have a missing configure file. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/191#comment:9 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#191: Hackage should check for common QA problems in ghc-options ----------------------------+----------------------------------------------- Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Cabal-1.4 Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.1 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * difficulty: very easy (<1 hour) => easy (<4 hours) Comment: And another... Ticket #271 has a .cabal file with some nice examples. Not only does it use `-O2` with little reason (probably) and `-optl-Wl,-s`, but it also uses `ghc-options: -lcrypt`. Grrr. * `-l -L -I` flags in ghc-options or cc-options should give a QA error * `-lfoo` should be `extra-libraries: foo` * `-Lbar` should be `extra-lib-dirs: bar` * `-Ibaz` should be `include-dirs: baz` The other QA bug in the #217 .cabal file is that it puts files in `extra- source-files:` that get included anyway. I'm not sure if this would be an easy QA check, it should be doable as an error in sdist however if it finds that it wants to create a fileset with duplicate source file paths. We can revisit that one perhaps. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/191#comment:10 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#191: Hackage should check for common QA problems in ghc-options ----------------------------+----------------------------------------------- Reporter: duncan | Owner: Type: enhancement | Status: closed Priority: normal | Milestone: Cabal-1.4 Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: fixed Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.1 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * status: new => closed * resolution: => fixed Comment: Most of these implemented and a few more. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/191#comment:11 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage