Skip to content

Conversation

@sellout
Copy link
Owner

@sellout sellout commented Dec 4, 2025

NoRecursion is basically a linter, so don’t have consumers build with it by default. This reduces the dependency graph.

Any dependency can introduce complexity when solving bounds. This gets
`NeRecursion` out of the way automatically.

1. it introduces a new flag, `verify-no-recursion` that controls the use of
   `NoRecursion` and defaults to `True`;
2. if the solver can’t find a solution with the flag enabled, it will
   automatically try again with the flag disabled (that is, no dependency on
   `no-recursion`);
3. the local `cabal.project` file has `flags: +verify-no-recursion`, which
   prevents the solver from trying without the flag enabled, ensuring that local
   package development always has `NoRecursion` enabled, even if it causes the
   solver to fail.

This also makes a few other minor changes:

- Setup no longer uses `NoRecursion`, because it’s not possible to
  conditionalize it with the flag.
- The `noisy-deprecations` flag now has `manual: True`, because disabling it
  won’t help the solver.
- `custom-setup` has been moved above the `flag` sections because flags can’t
  apply to `custom-setup`.
It’s still enabled in cabal.project for local development, but this means
consumers will never have to worry about it in their dependency graph.
@sellout sellout merged commit 6de6468 into main Dec 4, 2025
94 checks passed
@sellout sellout deleted the optional-no-recursion branch December 4, 2025 18:52
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

Successfully merging this pull request may close these issues.

2 participants