Skip to content
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

Improve error message about stanzas #4361

Closed
chrissound opened this issue Feb 27, 2017 · 5 comments
Closed

Improve error message about stanzas #4361

chrissound opened this issue Feb 27, 2017 · 5 comments

Comments

@chrissound
Copy link

chrissound commented Feb 27, 2017

I've just added the following lines in my .cabal file:

source-repository    head
  type:              git
  location:          https://github.com/exampleabc

And get an error message of:

FromString "Plain fields are not allowed in between stanzas: F 15 \"data-files\" \"templates/*\\n, templates/heist/*\\n, templates/cache/.keepme\"" (Just 15)

"Stanza" is mentioned only briefly within the cabal user guide (https://www.haskell.org/cabal/users-guide/installing-packages.html). Could we add documentation for this or improve the error message?

It works correctly if I move those lines to the end of the .cabal file.

@ezyang
Copy link
Contributor

ezyang commented Mar 7, 2017

@chrissound It's hard to tell because you haven't posted the whole Cabal file, but I'm guessing you did something like:

source-repository    head
  type:              git
  location:          https://github.com/exampleabc
data-files: blah blah blah
...

Which, apparently, the parser doesn't know how to handle.

@chris-martin
Copy link

I just got this error, and I'm still confused about what I did wrong.

@chris-martin
Copy link

It is trying to say that plain fields aren't allowed after stanzas?

@hvr
Copy link
Member

hvr commented Aug 5, 2017

@chris-martin exactly that, yes

And btw, the new parsec parser would emit a warning like

Warning: test.cabal:9:1: Ignoring trailing fields after sections: "data-files"

@phadej
Copy link
Collaborator

phadej commented Dec 25, 2017

I close this, as error message is improved

@phadej phadej closed this as completed Dec 25, 2017
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

5 participants