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

Treat cabal file parsing failures from index as non-fatal #3396

Closed
snoyberg opened this issue Aug 31, 2017 · 1 comment
Closed

Treat cabal file parsing failures from index as non-fatal #3396

snoyberg opened this issue Aug 31, 2017 · 1 comment
Milestone

Comments

@snoyberg
Copy link
Contributor

Some recent issues come from the fact that Stack has been (perhaps overzealously) too strict in its parsing logic. Given that we can't properly rely on upstream sources always providing input which is compatible with the deployed version of the Cabal file parser, we should relax this logic. (I made the original decision implicitly to be strict in parsing, due to past experiences with tools like packdeps and weird corner cases around BOMs, but this reasoning no longer applies.)

Here are some examples of things we should be less strict about:

  • If a cabal file does not parse, ignore it. We need to figure out what that means for cases like a snapshot referring to a specific cabal file (perhaps disallow usage of that snapshot, perhaps drop that one package).
  • Already implemented: don't add additional checks to flag name parsing: we'll just let in whatever the Cabal library accepts.
  • Are there other data types that have additional checks not performed by Cabal?

We need to accept that there is no Cabal format specification, and as it stands now, the Cabal library implementation is the library.

@snoyberg snoyberg added this to the P0: Blocking release milestone Aug 31, 2017
denibertovic added a commit to denibertovic/stack that referenced this issue Oct 20, 2017
The provided test package (dinamo), that is part of a custom snapshot has
a malformed cabal file. Specifically, it's setting the required cabal
version to an invalid number (9001). This test makes sure that
stack does not care about this if we do not actually use the package
in our project.
denibertovic added a commit to denibertovic/stack that referenced this issue Oct 20, 2017
The provided test package (dinamo), that is part of a custom snapshot has
a malformed cabal file. Specifically, it's setting the required cabal
version to an invalid number (9001). This test makes sure that
stack does not care about this if we do not actually use the package
in our project.
@snoyberg
Copy link
Contributor Author

Based on testing by @denibertovic, this is already implemented as needed. I'm going to move this out of the P0 milestone to avoid blocking the release, and will follow up with Deni on #3502 to get an integration test added.

denibertovic added a commit to denibertovic/stack that referenced this issue Oct 24, 2017
The provided test package (dinamo), that is part of a custom snapshot has
a malformed cabal file. Specifically, it's setting the required cabal
version to an invalid number (9001). This test makes sure that
stack does not care about this if we do not actually use the package
in our project.
denibertovic added a commit to denibertovic/stack that referenced this issue Oct 24, 2017
The provided test package (dinamo), that is part of a custom snapshot has
a malformed cabal file. Specifically, it's setting the required cabal
version to an invalid number (9001). This test makes sure that
stack does not care about this if we do not actually use the package
in our project.
snoyberg added a commit that referenced this issue Oct 24, 2017
tswelsh pushed a commit to tswelsh/stack that referenced this issue Nov 7, 2017
The provided test package (dinamo), that is part of a custom snapshot has
a malformed cabal file. Specifically, it's setting the required cabal
version to an invalid number (9001). This test makes sure that
stack does not care about this if we do not actually use the package
in our project.
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

No branches or pull requests

1 participant