-
Notifications
You must be signed in to change notification settings - Fork 48
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
FR: findExecutable "" should return Nothing, like on linux #180
Comments
What are the affected versions? |
|
I can also reproduce this with directory-1.3.7.1 from GHC-9.4.8. So it is not related to the OsPath migration. |
hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see haskell/directory#180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully.
hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see haskell/directory#180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully.
This appears to be canonical behavior for the Win32 #include <stdio.h>
#include <windows.h>
int main(void)
{
wchar_t buffer[512] = {0};
if (SearchPathW(NULL, L"", L".exe", 512, buffer, NULL) == 0) {
return GetLastError();
}
printf("%ls\n", buffer);
return 0;
} This fails with ERROR_INVALID_PARAMETER (87). Given that the I think it is a reasonable feature request though. The |
On Windows,
findExecutable ""
would throw*** Exception: searchPath: invalid argument (The parameter is incorrect.)
. However, on Linux it simply returnsNothing
. I believe this is a bug and we should align Windows behavior with Linux to also returnNothing
.The text was updated successfully, but these errors were encountered: