Skip to content
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

Deterministic solver output #4332

Open
ezyang opened this issue Feb 15, 2017 · 2 comments
Open

Deterministic solver output #4332

ezyang opened this issue Feb 15, 2017 · 2 comments

Comments

@ezyang
Copy link
Contributor

ezyang commented Feb 15, 2017

CC @grayjay

I wanted to add expect tests for the dependency solver but unfortunately the output wobbles depending on the state of built in packages. For example:

@@ -7,7 +7,6 @@
 cabal: Could not resolve dependencies:
 trying: custom-setup-1.0 (user goal)
 next goal: custom-setup:setup.Cabal (dependency of custom-setup-1.0)
-rejecting: custom-setup:setup.Cabal-1.24.0.0/installed-1.2... (conflict: custom-setup => custom-setup:setup.Cabal<1.20) 
-rejecting: custom-setup:setup.Cabal-1.18.0.0 (constraint from minimum version of Cabal used by Setup.hs requires >=1.20) 
+rejecting: custom-setup:setup.Cabal-1.18.1.5/installed-inp..., custom-setup:setup.Cabal-1.18.0.0 (constraint from minimum version of Cabal used by Setup.hs requires >=1.20) 
 fail (backjumping, conflict set: custom-setup, custom-setup:setup.Cabal)
 After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: custom-setup, custom-setup:setup.Cabal

Is there anything we could do to make this totally deterministic, even when the global packages change?

@grayjay
Copy link
Collaborator

grayjay commented Mar 6, 2017

I think we would need to somehow create a test package database that can be used with all versions of GHC. Is there anything specific that you want to test in the solver's output, or do you want to reduce the amount of output that must be excluded by the expect tests? The solver's output is also unstable because it can easily change after small code changes, especially changes to goal order.

@ezyang
Copy link
Contributor Author

ezyang commented Mar 6, 2017

I think the benefit of putting solver errors into expect tests is that when we start improving solver error messages, we can see how the messages improve over time, and we can also see when a change regresses a message. Even if a solver change causes the messages to wobble, it's good to make sure that the wobble isn't significant.

I think it's reasonable for solver output tests to be run on an entirely synthetic test package database which is invariant over all versions of GHC. Will require a little engineering though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants