Skip to content

Error messages for package locations - #3774

Merged
ezyang merged 5 commits into
haskell:masterfrom
dcoutts:error-messages-for-package-locations
Sep 8, 2016
Merged

ezyang merged 5 commits into
haskell:masterfrom
dcoutts:error-messages-for-package-locations

Conversation

@dcoutts

@dcoutts dcoutts commented Sep 4, 2016

Copy link
Copy Markdown
Contributor

This is for the "packages: blah/*/" locations in cabal.project files, when they don't match anything or match crazy unrecognised stuff. Previously we just used the derived Show.

Also improve classification of project package problems in a couple cases so we get more accurate helpful error messages in those cases.

Should improve #3636, but that one could be better since it's for the special case of an implicit project file.

@mention-bot

Copy link
Copy Markdown

@dcoutts, thanks for your PR! By analyzing the annotation information on this pull request, we identified @hvr, @23Skidoo and @BardurArantsson to be potential reviewers

This is for the "packages: blah/*/" locations in cabal.project files,
when they don't match anything or match crazy unrecognised stuff.
Previously we just used the derived Show.
So we get more accurate helpful error messages in those cases.
Also update a corresponding test.
@dcoutts
dcoutts force-pushed the error-messages-for-package-locations branch from 3969e4c to 3d79701 Compare September 4, 2016 13:29
@dcoutts
dcoutts force-pushed the error-messages-for-package-locations branch from 3d79701 to b2c587b Compare September 4, 2016 13:33
(BadPerPackageCompilerPaths ((pkgname, progname) : _)) =
"The path to the compiler program (or programs used by the compiler) "
++ "cannot be specified on a per-package basis in the cabal.project file "
++ "(ie setting the '" ++ progname ++ "-location' for package '"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e.,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK ok :-)

@ezyang

ezyang commented Sep 4, 2016

Copy link
Copy Markdown
Contributor

Error message improvements good! So I won't complain too much. But I am a little puzzled.

@dcoutts

dcoutts commented Sep 7, 2016

Copy link
Copy Markdown
Contributor Author

@ezyang in older base the Exception type class had no displayException and the default exception handler had to use show instead. So yes in the glorious new future we just use derived Show instances for exception types, but for older base we have to do this silly CPP dance to get show to show the human readable form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants