-
Notifications
You must be signed in to change notification settings - Fork 712
Fail more gracefully when tests can't be run #2844
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
Fail more gracefully when tests can't be run #2844
Conversation
Any ideas about what caused the build bot failure? |
It's the AMP, I think. |
Fixed now :) |
@@ -109,7 +109,7 @@ findProgramOnSearchPath verbosity searchpath prog = do | |||
findFirstExe (f:fs) = do | |||
isExe <- doesExecutableExist f | |||
if isExe | |||
then return (Just f) | |||
then Just `fmap` canonicalizePath f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed, this function already returns an absolute path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only returns absolute paths if all of the ProgramSearchPathDir
s are absolute. That's the whole point. You'll notice my change is the only call to canonicalizePath
in the function.
So the problem is that |
@@ -60,8 +60,9 @@ main = do | |||
distPref <- findDistPrefOrDefault NoFlag | |||
-- Use the default builddir for all of the subsequent package tests | |||
setEnv "CABAL_BUILDDIR" "dist" | |||
buildDir <- canonicalizePath (distPref </> "build/cabal") | |||
let programSearchPath = ProgramSearchPathDir buildDir : defaultProgramSearchPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can get the wrong cabal if dist/build/cabal exists but is empty.
The counterargument is that we already have a system for finding executables and throwing errors if they aren't there. It makes sense to me to use it. The diffstat for these changes is negative if you ignore comments. |
AFAICS the original issue is already fixed in master. Can @enolan confirm? |
Bug is still there. On 3923101:
|
If cabal-install isn't built yet, we can't run it's tests yet. Prior to this commit, if you tried running "./Setup test" on cabal-install without having built cabal-install yet you got: package-tests: dist/build/cabal: canonicalizePath: does not exist (No such file or directory) Now you get: package-tests: user error (The program 'cabal' is required but it could not be found.) I moved the canonicalization logic into findProgramOnSearchPath. This is a change to the semantics of the library, but shouldn't break anything.
05b8579
to
e7b7a35
Compare
Updated to work with the newer |
Is this still relevant? The test-suite's gone through some significant changes in the past few years and |
If cabal-install isn't built yet, we can't run it's tests yet. Prior to
this commit, if you tried running "./Setup test" on cabal-install without
having built cabal-install yet you got:
package-tests: dist/build/cabal: canonicalizePath: does not exist (No such file or directory)
Now you get:
package-tests: user error (The program 'cabal' is required but it could not be found.)
I moved the canonicalization logic into findProgramOnSearchPath. This is
a change to the semantics of the library, but shouldn't break anything.