-
Notifications
You must be signed in to change notification settings - Fork 697
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
Cabal Init Omnibus #7344
Cabal Init Omnibus #7344
Conversation
Why bundle coverage changes and cabal init changes? Are they related? I don't see how. |
I don't like how this contains at least three separate changes in one PR. I hope this is just a draft. |
@phadej it's clearly marked a draft. I'll split it out into several PRs if that makes you less uneasy.
Because i can't test the init script reasonably well if i can't generate coverage. It turns out that in order to make any effective change towards fixing things for |
At the commit level, ideally the smallest chunks that make sense (and build) on their own. At the pr level, strongly related changes can be on the same pr. Or not. So something like this, following OP:
|
@fgaz i agree with that timeline. The HPC + coverage stuff is covered by Ocharles' PR that just went in, and the init stuff can't be split (or at least, shouldn't) |
* Restructures the `cabal init` command to fix historical issues. All flags are preserved. * Codebases for interactive and non-interactive flags are disentangled. * Data structures now exploit relevant stanza structure and formatters only care about stanza data * Heuristics and prompts have a pure and impure implementation. * Sets default behavior to be `--interactive` as opposed to `--non-interactive`. * Rewrites tests to achieve 98% coverage * Golden files now test every stanza individually * Every flag is covered by a unit test * Interactive, simple, and non-interactive workflows are covered.
17e31e9
to
1068755
Compare
cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-and-exe-with-comments.golden
Show resolved
Hide resolved
972ceb3
to
5892f42
Compare
-> InstalledPackageIndex | ||
-> SourcePackageDb | ||
-> InitFlags | ||
-> m ProjectSettings | ||
createProject v pkgIx srcDb initFlags = do | ||
createProject v _comp pkgIx srcDb initFlags = do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ptkato This is unused in a bunch of cases (interactive + simple, including thier tests). I'd just configure NonInteractive.createProject
to take the compiler arg first and then return NonInteractive.createProject comp
as the function returned in the where clause. Otherwise it just introduces cruft into more places than we want.
582d4c3
to
0d20866
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome mega-PR. I can't do it justice, not taking part in the epic struggle from the beginning, but I'm duly impressed by its breadth and the law and order it imposes. I would feel uncomfortable with such a large PR, but I understand it provides an excellent test coverage for what it changes. Great job.
cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-and-exe-with-comments.golden
Show resolved
Hide resolved
🎉 |
Please include the following checklist in your PR:
New additions
This PR does the following:
cabal init
command to have a saner structure that can be tested easily.This comes with bugfixes:
cabal init --libandexe
should add thelibrary
to thebuild-depends
of theexecutable
#7256cabal init --lib
puts build-tools(happy, alex) generated modules twice into exposed-modules #7251extra-source-files: CHANGELOG.md
#6864