Skip to content

Conversation

arcanis
Copy link
Member

@arcanis arcanis commented Jan 18, 2023

What's the problem this PR addresses?

Running constraints must currently be a conscious thing, or run on CI. I think some users have the expectation that Yarn should just report the errors during install, as it's the main interface they'll use.

How did you fix it?

This PR adds a new setting, enableConstraintsChecks. When enabled, constraints will be checked during each install, as part of the project validation.

note: Prolog constraints are slower than the (new) JS ones; it's suggested to upgrade to JS constraints when using this setting.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

Comment on lines +1533 to +1534
if (hasErrors)
return;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I marked the PR as breaking change for @yarnpkg/cli, because the validation errors didn't previously stop the execution. However, if they don't, there's a decent risk it'll hide important information due to peer dependency warnings.

@arcanis arcanis merged commit 5687c2c into master Jan 18, 2023
@arcanis arcanis deleted the mael/constraints-checks branch January 18, 2023 12:48
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.

1 participant