You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expensive assertion in Distribution.Solver.Modular.Linking #4258
makes the solver run slowly when there are many setup dependencies, especially with --reorder-goals. Solving for jsaddle-warp with new-build is a good example (See #4192 (comment)). When I ran cabal new-build jsaddle-warp --dry-run with GHC 8.0.1, it took almost nine minutes with the assertion and about eight seconds without.
I didn't see any obvious ways to improve the performance. However, even if we minimized the effect of assertions on runtime, assertions could still affect performance measurements during development. It's easy to accidentally compare a cabal executable with assertions enabled to one without assertions.
I'm not sure of the best solution. Here are some ideas:
Remove ghc-options: -fno-ignore-asserts from cabal.project and then enable assertions for unit tests in CI.
Add another build flag to control just the expensive assertions, and turn them on in CI. Other assertions would be enabled in cabal.project.
The way that GHC's RTS handles expensive asserts is like (2): by default they are not turned on, but if you turn on a "sanity" mode it will start running with them. The RTS asserts are toggleable at runtime but that will probably be inconvenient to do in the solver unless we're threading around some solver environment (maybe we are?)
Activity
ezyang commentedon Jan 23, 2017
The way that GHC's RTS handles expensive asserts is like (2): by default they are not turned on, but if you turn on a "sanity" mode it will start running with them. The RTS asserts are toggleable at runtime but that will probably be inconvenient to do in the solver unless we're threading around some solver environment (maybe we are?)
23Skidoo commentedon Jan 23, 2017
We should definitely do that at least.
Control expensive assertions in cabal-install with a build flag.
Control expensive assertions in cabal-install with a build flag.
Control expensive assertions in cabal-install with a build flag.
sebright commentedon Feb 20, 2017
Thanks for the feedback. I added a build flag in #4346 so that it would be easy to call the conditional assert from anywhere in cabal-install.
I think it would also be useful to warn when assertions are enabled. I'm not sure where we should put the warning, though.
Control expensive assertions in cabal-install with a build flag.
Control expensive assertions in cabal-install with a build flag.
Control expensive assertions in cabal-install with a build flag.
sebright commentedon Mar 6, 2017
I opened a new issue: #4377