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

Provide .bat alternatives to test scripts #10179

Closed
jasagredo opened this issue Jul 6, 2024 · 4 comments · Fixed by #10236
Closed

Provide .bat alternatives to test scripts #10179

jasagredo opened this issue Jul 6, 2024 · 4 comments · Fixed by #10236

Comments

@jasagredo
Copy link
Collaborator

jasagredo commented Jul 6, 2024

Some of the tests in our test-suite rely on external scripts that are written in bash, and although MSYS2 comes with bash, they are not understood directly by Windows. For this reason some tests are marked as broken.

It would be good to provide .bat alternatives to these scripts (which are easy scripts, it should't be too difficult) or alternatively combine the sh and batch scripts (with some magic https://stackoverflow.com/questions/17510688/single-script-to-run-in-both-windows-batch-and-linux-bash) so that those tests are also runnable on Windows.

@jasagredo
Copy link
Collaborator Author

Bat files are not a replacement for a real program on Windows, because we use Process.proc, which cannot call .bat files. See haskell/process#140

I think the wisest thing would be to distinguish by extension if we should call proc or shell on Windows.

@geekosaur
Copy link
Collaborator

The other alternative is to use proc with the executable being cmd.exe and the batch file being the first parameter, I think.

@jasagredo
Copy link
Collaborator Author

I think then the arguments have to be inside the same string as the script such as cmd.exe /c "script.bat arg1 arg2" and not as cmd.exe /c "script.bat" "arg1" "arg2".

@jasagredo
Copy link
Collaborator Author

jasagredo commented Jul 15, 2024

Test failing because of this issue:

  • PackageTests\ForeignLibs\setup.test.hs
  • PackageTests\GHCJS\BuildRunner\cabal.test.hs
  • PackageTests\GhcPkgGuess\SameDirectory\setup.test.hs
  • PackageTests\GhcPkgGuess\SameDirectoryGhcVersion\setup.test.hs
  • PackageTests\GhcPkgGuess\SameDirectoryVersion\setup.test.hs
  • PackageTests\GhcPkgGuess\Symlink\setup.test.hs
  • PackageTests\GhcPkgGuess\SymlinkGhcVersion\setup.test.hs
  • PackageTests\GhcPkgGuess\SymlinkVersion\setup.test.hs
  • PackageTests\PkgConfigParse\setup.test.hs

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

Successfully merging a pull request may close this issue.

2 participants