Skip to content

cabal-version check in parsec-parser #4681

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
phadej opened this issue Aug 10, 2017 · 7 comments
Closed

cabal-version check in parsec-parser #4681

phadej opened this issue Aug 10, 2017 · 7 comments
Assignees

Comments

@phadej
Copy link
Collaborator

phadej commented Aug 10, 2017

No description provided.

@phadej phadej self-assigned this Aug 10, 2017
@phadej
Copy link
Collaborator Author

phadej commented Aug 10, 2017

Should one reject to work with such files, or should we be optimistic and try anyway (yet report the version error, not the parse error?)

@phadej
Copy link
Collaborator Author

phadej commented Aug 10, 2017

I can amend ParseResult to also return the cabal-version, even the parse fails, so users of parseGenericPackageDescription can either fail or skip.

-newtype ParseResult = ParseResult (Writer (warnings, errors) (Maybe a))
+newtype ParseResult = ParseResult (Writer (warnings, errors, cabalVersion) (Maybe a))

@23Skidoo
Copy link
Member

I can amend ParseResult to also return the cabal-version, even the parse fails,

+1, that would be useful.

@ezyang
Copy link
Contributor

ezyang commented Aug 13, 2017

Yes, I think the general idea is that the format of the header, or at least the format far enough to read cabal-version, must stay stable enough so that old versions of Cabal can parse far enough to determine that they don't support a version. In practice I don't think old version of Cabal's actually fulfill this property... but never too early to start right?

@hvr
Copy link
Member

hvr commented Aug 13, 2017

@ezyang I've put quite a bit of thought into the cabal-spec forward/backware compat story, but I don't have time to explain it right now (I hint at this here); but my plan allows us to radically change the lexical structure of .cabal files w/o breaking old cabal-installs :-)

@23Skidoo
Copy link
Member

23Skidoo commented Dec 8, 2017

@hvr's plan is now described in #4899.

@phadej
Copy link
Collaborator Author

phadej commented Feb 4, 2018

This is done

@phadej phadej closed this as completed Feb 4, 2018
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

4 participants