-
Notifications
You must be signed in to change notification settings - Fork 712
Update solver Hackage benchmark for v2-install. #6434
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
Conversation
Nice, |
I noticed your PR when I first pushed my branch. Thanks for adding the flag! |
When I try
I get
I think that |
Oh, I know, because |
Another thing: On my system, the Is there some mechanism to prevent store from affecting the benchmarks? Could we create some temporary directory, and use |
Something like diff --git a/solver-benchmarks/HackageBenchmark.hs b/solver-benchmarks/HackageBenchmark.hs
index 145b49f93..df79d361e 100644
--- a/solver-benchmarks/HackageBenchmark.hs
+++ b/solver-benchmarks/HackageBenchmark.hs
@@ -176,7 +176,7 @@ runCabal timeoutSeconds cabal flags pkg = do
let timeout = "timeout --foreground -sINT " ++ show timeoutSeconds
cabalCmd =
unwords $
- [cabal, "install", "--ignore-project", "--lib", unPackageName pkg, "--dry-run", "-vsilent+nowrap"] ++ flags
+ [cabal, "--store-dir=/tmp/store", "v2-install", "--ignore-project", "--lib", unPackageName pkg, "--dry-run", "-vsilent+nowrap"] ++ flags
cmd = (shell (timeout ++ " " ++ cabalCmd)) { std_err = CreatePipe }
-- TODO: Read stdout and compare the install plans.
EDIT: on my machine, from
to
so this is significant. |
In fact, we probably should specify some non-existing environment, as diff --git a/solver-benchmarks/HackageBenchmark.hs b/solver-benchmarks/HackageBenchmark.hs
index 145b49f93..ed2bdd5f8 100644
--- a/solver-benchmarks/HackageBenchmark.hs
+++ b/solver-benchmarks/HackageBenchmark.hs
@@ -176,7 +176,7 @@ runCabal timeoutSeconds cabal flags pkg = do
let timeout = "timeout --foreground -sINT " ++ show timeoutSeconds
cabalCmd =
unwords $
- [cabal, "install", "--ignore-project", "--lib", unPackageName pkg, "--dry-run", "-vsilent+nowrap"] ++ flags
+ [cabal, "--store-dir=/tmp/store", "v2-install", "--package-env=hackage-benchmarks-dont-use", "--ignore-project", "--lib", unPackageName pkg, "--dry-run", "-vsilent+nowrap"] ++ flags
cmd = (shell (timeout ++ " " ++ cabalCmd)) { std_err = CreatePipe }
-- TODO: Read stdout and compare the install plans. note: I'm not sure whether it affects significantly the run-times, but it definitely affects the solver results. There probably should be some comments, why we have so much different flags for seemingly so simple task. Sorry for the comment spam. |
Fixes haskell#6417. Changes in this commit: - Set the --lib flag so that the benchmark works for packages with libraries or executables. - Set --ignore-project to prevent cabal projects from affecting the results. - Handle four types of cabal errors that were introduced by v2-install. - Use +nowrap to simplify parsing of cabal errors.
3e3fb20
to
5c4fde3
Compare
@phadej Thanks for the suggestions! I didn't realize that so much time was spent reading the store, so I definitely want to skip that. I just specified a directory that shouldn't exist, because cabal shouldn't need to create the store with --dry-run. I also added v2- and --package-env and documented the flags. |
Merged in #6447, thanks! |
Fixes #6417.
Changes in this commit:
executables.
Please include the following checklist in your PR:
[ci skip]
is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!