Skip to content

The "You need to re-run the 'configure' command" message is a bit ugly #3157

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

Closed
bgamari opened this issue Feb 16, 2016 · 9 comments
Closed
Assignees
Milestone

Comments

@bgamari
Copy link
Contributor

bgamari commented Feb 16, 2016

Today I stumbled upon Cabal's "you need to reconfigure" message and noticed that not only is it >100 columns wide, but it doesn't have a terminating newline,

[0949 ben@ben-laptop network-analysis(distributed)] $ cabal build
You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.23.1.0, now Cabal-1.23.2.0). Additionally the compiler is different (was ghc-7.10, now ghc-8.0) which is probably the cause of the problem.[0949 ben@ben-laptop network-analysis(distributed)] $ 

As far as bugs go this is pretty minor, but it seems like it shouldn't be difficult to fix. It seems that ideally ConfigStateFileError would have a Text instance and whoever is catching this exception would use it one way or another.

@23Skidoo
Copy link
Member

We do call wrapText in topHandler, it looks like something else is going on here. Is this a package with build-type: Custom?

@bgamari
Copy link
Contributor Author

bgamari commented Feb 16, 2016

Mikhail Glushenkov [email protected] writes:

We do call wrapText in topHandler, it looks like something else is
going on here. Is this a package with build-type: Custom?

Afraid not, build-type: Simple.

@23Skidoo
Copy link
Member

I have actually encountered this once or twice, but right now am having problems reproducing.

@ttuegel
Copy link
Member

ttuegel commented Feb 20, 2016

It seems that ideally ConfigStateFileError would have a Text instance and whoever is catching this exception would use it one way or another.

I don't believe it does. I'll take a look.

@ttuegel ttuegel self-assigned this Feb 20, 2016
@23Skidoo
Copy link
Member

It doesn't, but one approach to this is to replace its Show instance with Text and fix the compile errors.

@ttuegel
Copy link
Member

ttuegel commented Mar 11, 2016

I'm not sure about this now; should I write a Text instance, complete with parse? I don't expect anyone will need to parse an error message. Would a one-off function, e.g. dispConfigStateFileError :: ConfigStateFileError -> Doc be more appropriate?

@23Skidoo
Copy link
Member

You're right, it doesn't need a parse function.

@ttuegel
Copy link
Member

ttuegel commented Mar 12, 2016

The root cause turned out to be that we only used wrapText on IOExceptions. I just needed to move the call up in topHandler so it applies to all exceptions. My PR will be on its way soon; I am taking this opportunity to improve the messages ConfigStateFileError throws.

@ttuegel ttuegel added this to the Cabal 1.24 milestone Mar 12, 2016
@23Skidoo
Copy link
Member

Great, thanks for working on this.

ttuegel added a commit to ttuegel/cabal that referenced this issue Mar 12, 2016
Fixes haskell#3157. The wrapText helper is used to format all error
messages. Previously, it was only used to format IOException errors;
other exceptions would be formatted incorrectly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants