-
Notifications
You must be signed in to change notification settings - Fork 137
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
Running Flang tests on Windows #1363
Labels
windows
Add this to all windows specific issues or PRs
Comments
Thanks for creating and investigating the issue and volunteering for this effort! Some quick responses to your points:
|
This was referenced Jun 27, 2023
tdusnoki
added a commit
to tdusnoki/flang
that referenced
this issue
Jun 29, 2023
On Windows `%flang1` and `%flang2` are interpreted incorrectly. related issue: flang-compiler#1363
tdusnoki
added a commit
to tdusnoki/flang
that referenced
this issue
Jun 29, 2023
On Windows `%flang1` and `%flang2` are interpreted incorrectly. related issue: flang-compiler#1363
tdusnoki
added a commit
to tdusnoki/flang
that referenced
this issue
Jun 29, 2023
On Windows `%flang1` and `%flang2` are interpreted incorrectly. related issue: flang-compiler#1363
bryanpkc
pushed a commit
that referenced
this issue
Jul 19, 2023
On Windows `%flang1` and `%flang2` are interpreted incorrectly. related issue: #1363
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The goal is to add a basic Windows support to Flang tests. My approach is to adopting the current test environment to Windows, try to preserve the current test process [lit->sh->make->FileCheck] how they are launched as much as possible by using gnuwin32 tools. As far as I see this is the simplest way to find a general solution in a short time.
I managed to determine some issues which need to be fixed in order to run Flang tests on Windows:
Defining temporary "environment" variable for forked process:
The following logic how these variables are defined and pass them to the forked bash process doesn't work in PowerShell or Command Promt.
RUN: KEEP_FILES=%keep FLAGS=%flags TEST_SRC=%s MAKE_FILE_DIR=%S/.. bash %S/runmake | tee %t
Instead we should use this format:
RUN: bash -c "KEEP_FILES=%keep FLAGS=%flags TEST_SRC=%:s MAKE_FILE_DIR=%:S/.. %:S/runmake | tee %:t"
It would be good, if we could use a common sh file for Linux and Windows. But maybe it is more clear if we create a separate bat/ps1 file for each tests.
Using proper path separator for gnuwin32 bash.
We should use Linux style path '/c/path/to//test/dir' instead of Windows path. Maybe we should override %:S behaviour which removes : from the path (this is good for us) , but also removes / single leading by default.
Detecting Clang-cl and Flang compiler.
On Linux by default classic flang llvm tools are installed into /usr/local and the make easily finds them.
On Windows it needs to tell explicitly to the make where the Flang compiler is.
It could be done if we pass the path to llvm tools dir through the script chain, or generating a 'config.mk' file with cmake which will be included in main Makefile. Or add the 'llvm_tools_dir' to the PATH before the tests execution.
Linking issue
It seems it needs to fix the how Flang pass the flang runtime libraries to MS Linker.
The output of tests direct to a file and stdout by 'tee' ( "bash %S/runmake | tee %t " ). In this case the output is empty, so the result of the test is not represented in stdout nor the tmp file.
It seems it is a buffering issue due to different line endings [cr+lf vs lf], if I add an extra 'fflush' call in the 'check.c' file, it solves this issue.
The text was updated successfully, but these errors were encountered: