-
Notifications
You must be signed in to change notification settings - Fork 711
Hackage should check for common QA problems in ghc-options #184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
(Imported comment by guest on 2007-12-16) ghc-options: -Wall -Werror would be quite reasonable inside an if flag(devel), though. Ian |
(Imported comment by @dcoutts on 2007-12-17) Adding at least some of these should be an easy project for someone. |
(Imported comment by @dcoutts on 2007-12-30) Hackage should also reject packages that do not specify a build-type:. Once we implement striping (ticket #88) we should also reject ghc-options: -optl-Wl,-s. The code should go in the Cabal lib but be used in hackage and cabal-install. |
(Imported comment by ross on 2008-01-14) 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
|
(Imported comment by @dcoutts on 2008-01-15) 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#. |
(Imported comment by @dcoutts on 2008-01-16) Distribution.PackageDescription.QA now exports data QANotice = QAWarning String | QAFailure String qaCheckPackage :: PackageDescription -> IO [QANotice]However it needs a bit of tweaking before it can be used in hackage as the code currently assumes that the package is unpacked relative to the current directory (eg it checks for license files). The pure checks should be split from the impure ones and the impure should be given the FilePath of the root of the unpacked package so they can check files relative to that. |
(Imported comment by @dcoutts on 2008-01-21) More QA and sanity checks:
|
(Imported comment by @dcoutts on 2008-01-25) Yet another QA check:
|
(Imported comment by @dcoutts on 2008-01-29) 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.
|
(Imported comment by @dcoutts on 2008-01-29) Most of these implemented and a few more. |
(Imported from Trac #191, reported by @dcoutts on 2007-12-16)
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.
The text was updated successfully, but these errors were encountered: