-
Notifications
You must be signed in to change notification settings - Fork 704
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
cabal check improvements for globs #5403
cabal check improvements for globs #5403
Conversation
e673f1b
to
a20ab93
Compare
This PR actually needs correction on two counts:
|
a20ab93
to
061073b
Compare
I've fixed the two problems above. I think it'd still make sense to bump up the 'glob matches nothing' and the 'glob failed to parse' warnings to |
a1aa7bc
to
593b670
Compare
This also significantly improves the error when trying to refer to missing directories, hopefully making it clear that it's coming from Cabal. haskell#5318 and snowleopard/hadrian#634 are two bugs which manifested as Cabal trying to glob in a non-existent directory and both took some debugging because of the obscurity of the error.
These globs make `haddock`, `sdist` and `install` die, so they definitely ought to be warned about! Because of the dying behaviour, I made the checks dist-inexcusable; starting from a clean slate I would probably have only made them suspicious, but this isn't terrible.
This has been a problem since haskell#5372 began expanding globs in `cabal check`. Now the logic of running a glob is separated from the parsing, giving the caller the opportunity to handle parsing failures flexibly.
593b670
to
24c4e77
Compare
Tested this a bit and read the code. LGTM. |
Thanks! |
Please include the following checklist in your PR:
[ci skip]
is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!
Tests added!
This PR is based on top of #5401 and #5402 (which explains today's PR frenzy: I didn't expect to need to do #5401 when I started!). I'll rebase on master once those two are merged. As noted in #5401, the
cabal-version
check inCheck.hs
is kind of weird; I have left it in the expected output of the relevant test on the basis that it's easy to remove later.