Reimplement cabal check#8427
Merged
Merged
Conversation
02db5c5 to
39b45ff
Compare
28948e9 to
e44f74f
Compare
54e4c30 to
70c93d7
Compare
ffaf1
added a commit
to ffaf1/cabal
that referenced
this pull request
Sep 22, 2022
ffaf1
added a commit
to ffaf1/cabal
that referenced
this pull request
Sep 22, 2022
ffaf1
added a commit
to ffaf1/cabal
that referenced
this pull request
Sep 23, 2022
ffaf1
added a commit
to ffaf1/cabal
that referenced
this pull request
Sep 23, 2022
ffaf1
commented
Sep 23, 2022
ffaf1
commented
Sep 23, 2022
ffaf1
commented
Sep 23, 2022
ffaf1
commented
Sep 23, 2022
ffaf1
commented
Sep 23, 2022
Collaborator
|
no need to wait for me, I'm good at rebasing 😉 |
Mikolaj
approved these changes
Nov 9, 2023
Member
Mikolaj
left a comment
There was a problem hiding this comment.
Thank you very much, Francesco! That's the big one!
geekosaur
approved these changes
Nov 9, 2023
When two target names are the same, `mappend`ing them should not error but just pick the first name.
* Add test for haskell#7423 i.e. Do not warn on -O2 if under off-by-default package configuration flag conditional. * Add a regression for: * Add another -WErrr test This is to make sure we do *not* report it if it is under a user, off-by-default flag. * Add test for non manual user flags. * Add “absolute path in extra-lib-dirs” test * Add if/else test * Add “dircheck on abspath” check * Add Package version internal test * Add PackageVersionsStraddle test
* Integrate Artem’s review (review) Clarify `combineNames` documentation By explaining the way it operates (working if the two names are equal or one is empty) and renaming the function from `combineName` to `combineNames`. (review) Use guards instead of if/then/else (review) Match inside argument list (review) Replace “white” with “allow” (review) Fix typo in comment (review) Fix typo in Check module documentation (review) Harmonise indentation for `data` decls First field goes in a new line than the data constructor, so we have more space. (review) Rename `Prim` module to `Types` (review) Add checkPackageFilesGPD `checkPackageFiles` — which works on PD — was used to perform IO. We introduce a function that does the same thing but works on GPD (which is more principled). `checkPackageFiles` cannot just be removed, since it is part of the interface of Distribution.PackageDescription.Check. Deprecation can be planned once “new check” is up and running. * Integrate Andreas’ review (review) Add named section to missing upper bound check “miss upper bound” checks will now list target type and name (“On executable 'myexe', these packages miss upper bounds”) for easier fixing by the user. (review) remove `cabal gen-bounds` suggestion Reasonable as `cabal gen-bounds` is stricter than `cabal check`, see haskell#8427 (comment) Once `gen-bounds` behaves in line with `check` we can readd the suggestion. (review) Do not warn on shared bounds When a target which depends on an internal library shares some dependencies with the latter, do not warn on upper bounds. An example is clearer library build-depends: text < 5 ⁝ build-depends: myPackage, ← no warning, internal text, ← no warning, shared bound monadacme ← warning! * Integrate Artem’s review /II (review) Split Check.hs Check.hs has been split in multiple file, each une sub 1000 lines: Check 857 lines Check.Common 147 lines Check.Conditional 204 lines Check.Monad 352 lines Check.Paths 387 lines Check.Target 765 lines Check.Warning 865 lines Migration guide: - Check GPD/PD checks plus work-tree checks. - Check.Common common types and functions that are *not* part of monadic checking setup. - Check.Conditional checks on CondTree and related matter (variables, duplicate modules). - Check.Monad Backbone of the checks, monadic inter- face and related functions. - Check.Paths Checks on files, directories, globs. - Check.Target Checks on realised targets (libraries, executables, benchmarks, testsuites). - Check.Warning Datatypes and strings for warnings and severities. (review) remove useless section header (review) Fix typo (review) Add warnings documentation (list) For each warning, we document constructor/brief description in the manual. This might not be much useful as not but it will come handy when introducing `--ignore=WARN` and similar flags. * (review Andreas) Clarify CheckExplanation comment Whoever modifies `CheckExplanation` data constructors needs to be aware that the documentation in doc/cabal-commands.rst has to be updated too.
No need to expose Distribution.PackageDescription.Check.* to the world. API for checking, for cabal-install and other tools, should be in Distribution.PackageDescription.Check.
Cabal codebase has now a formatter/style standard (see haskell#8950). “Ravioli ravioli, give me the formuoli”
See haskell#8963 for reason and clarification requests.
It is now in the Reader part of CheckM monad.
Internal: testsuite, benchmark. See haskell#8361.
When checking internal version ranges, we need to make sure we are not mistaking a libraries with the same name but from different packages. See haskell#9132.
neither…nor, completing what done in haskell#9162
Brandon’s review/II.
Collaborator
Author
|
Contributing to cabal is a fullfilling experience! You can have an immediate impact on the ecosystem, people are helpful, thanks everyone for their support! |
Member
|
@ffaf1 Congrats on the successful merge, and also on your persistence! I am glad to see this project completed. |
Collaborator
Collaborator
Author
|
Thanks, I closed that manually! |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reimplementing
cabal check, closes #8211, #652, #2065.For a detailed description of the problem at hand, the proposed solution, benefits and future work check the explanatory article.
Here I will only highlight bits to ease reviews. In brief:
cabal checkgoes from “make a soup withflattenPackageDescription, check it” to “start fromGenericPackageDescriptionand walk down, perform the appropriate checks near the relevant datatype”.ifs inside a.cabalare merged in a single ball of mud no more. Rather we visit theCondTreein a principled manner, building the target from slices and then validating it in its appropriate context.CheckM m, a wrappedRSTWtransformer wheremabstracts over some IO/.tar archive/VCS filesystem.hackage-server, nor in anyhaskellrepo, nor instack) and a signature change forcheckPackage, eliminating a useless parameter. I tackled the rewrite with the idea to minimise disruption.To the reviewer: a good way of approaching this is to to avoid the two “large diffs” files at first. Check first how other modules were impacted and the two preliminary patches. Then you can dive in
PackageDescription/Check.hs:and you should find your way.
Testsuite added in #8248 and #8250 passes. As a proof of what can be done after the rewrite, this PR also:
cabal checkwarns about-O2even if it is just a flag #7423.If not merged by the time this is approved, #8441 and #8361 might need to be updated.
This patch is big, the logic of checks sometimes tricky, I expect breakage. I took care to minimise API change, this should make bugs pop up faster and allow me to fix them faster. Once everything is stable, features can be accomodated appropriately.
cabal checkin your project folder should warn you about common mistakes, exit with 1 on more serious ones.