Introduce new ComponentEnabledSpec, removing testEnabled/benchmarkEna…#3542
Introduce new ComponentEnabledSpec, removing testEnabled/benchmarkEna…#3542ezyang merged 3 commits intohaskell:masterfrom
Conversation
| enabledTests = filter testEnabled . testSuites | ||
|
|
||
| -- | Perform an action on each buildable 'TestSuite' in a package. | ||
| withTest :: PackageDescription -> (TestSuite -> IO ()) -> IO () |
There was a problem hiding this comment.
Are this removed because we favour withTestLBI?
There was a problem hiding this comment.
Correct. Unfortunately a backwards compatible interface is not possible because you really do need the CLBI to determine what is enabled.
|
I guess I need to push the change through cabal-install too. |
|
Hmm, I just realized that if I remove 'withTest' and 'withBenchmark' then I really ought to remove 'withLib' and 'withExe'. Maybe it's better to keep them and note that there's been a change in behavior. |
|
@ezyang you could |
|
I decided to put them back in with copious hyperlinks. |
|
OK so I came up with a way to do Notes that get rendered by Haddock (since the info is relevant to clients). Along the way I fixed a lot of Haddock documentation. Take a look. |
|
I guess this PR is blocked on #3545. |
|
Unblocked! |
|
Calling attention to the And the rest:
After fixing BC, my plan is to push this and the hack for #3545; the yak for that ticket can be shaved later. |
See the comment in the code. I don't like it but it's BC! Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
…bled. As per an existing TODO in the code, the use of testEnabled/benchmarkEnabled to indicate if a component was enabled/disabled by the user command line was an egregious violation of abstraction. This commit removes these two fields, instead passing along the necessary enabling information with ComponentEnabledSpec instead. As there were not many uses of testEnabled/benchmarkEnabled, this was not too difficult to do. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
|
||
| -- | Perform an action on each buildable 'Benchmark' in a package. | ||
| -- You probably want 'withBenchLBI' if you have a 'LocalBuildInfo', see the note in | ||
| -- "Distribution.Simple.LocalBuildInfo#buildable_vs_enabled_components" |
There was a problem hiding this comment.
This note lives in Cabal/Distribution/Types/ComponentEnabledSpec.hs now.
…bled.
As per an existing TODO in the code, the use of
testEnabled/benchmarkEnabled to indicate if a component
was enabled/disabled by the user command line was an
egregious violation of abstraction. This commit removes
these two fields, instead passing along the necessary
enabling information with ComponentEnabledSpec instead.
As there were not many uses of testEnabled/benchmarkEnabled,
this was not too difficult to do.
Signed-off-by: Edward Z. Yang ezyang@cs.stanford.edu