OpenModelica / OpenModelicaLibraryTesting

Test script for OMCompiler+OpenModelicaLibraries
Other
8 stars 13 forks source link

Add Windows support and CI #57

Closed AnHeuermann closed 6 months ago

AnHeuermann commented 7 months ago

To support library testing on Windows we need to ensure these scripts are running fine on Windows.

casella commented 7 months ago

@AndreaBartolini you have some experience with it, can you comment on that?

bilderbuchi commented 7 months ago

Windows CI runners are available from Github (e.g. as windows-latest): https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories

AndreaBartolini commented 7 months ago

To support library testing on Windows we need to ensure these scripts are running fine on Windows.

I've already done something to achieve the goal and now I can run the CI on my WIN11 PC, but my modifications does not cover all the features in the scripts.

Basically I've done this:

I also added some parameters to switch between "win" and "linux" mode and to manage some other minor features.

I've not managed:

To be done:

If it may help, I can create a pull request in order to better show my modifications

AnHeuermann commented 7 months ago

@AndreaBartolini That would be a nice start. I can add windows-latest to the GitHub workflow and than we see what's still breaking 😁

AndreaBartolini commented 7 months ago

I made my modifications starting from the commit 65b4f9db (2023.09.30) and I saw that a lot of commits have been made after that one, so in order to avoid confusion I made a new branch WindowSupport and put my modification on it After your check and if you agree I can merge my modifications on the master branch and create a pull request.

The only problem is that I have no rights to push on the repo, here the message I got when tryed to push the new branch:

$ git push origin WindowsSupport
Enter passphrase for key '/c/Users/andre/.ssh/id_rsa':
ERROR: Permission to OpenModelica/OpenModelicaLibraryTesting.git denied to AndreaBartolini.
fatal: Could not read from remote repository.

Can you please give me the rights to push in the repo?

AndreaBartolini commented 7 months ago

BTW: on my PC if I run the CI under windows on multiple processes sometimes the last log line is not recorded in the log files. I suppose this is beacuse Python multiprocess is not thread-safe under windows. I remember that in the past I got a similar issue in Visual C++ under windows. Running the CI under windows on a single process the problem disappears.

bilderbuchi commented 7 months ago

suppose this is beacuse Python multiprocess is not thread-safe under windows.

That makes me curious, and would be good to be aware of, do you have further information on this supposition?

AndreaBartolini commented 7 months ago

I remember reading something about this on python documentation online when I investigated the problem of the missing line in the log file, unfortunately I've not saved the page address...

What I've understood is that this problem arises when omc fails due to the long path of the model name, rising the error:

[C:/dev/OM64bit/OMCompiler/Compiler/SimCode/SimCodeMain.mo:532:7-532:78:writable] Error: Internal error C:\Program Files\OpenModelica1.23.0-dev-64bit\bin\omc.exe: [unknown function name] failed

This error line is missing in the log file if I run more than one process in parallel (--jobs = zero or higher than 1), so I suppose that the problem is the thread termination before the file writing is completed when more than one thread are running in parallel.

I've not found a way to better investigate the problem, but is seems to be structural because it happens anytime omc raises said error. Maybe it depends on the way the omc exits when this error arises, but I don't know omc so deeply to verify this.

The problem is windows related becase under linux there is no path limitation.

AnHeuermann commented 7 months ago

Can you please give me the rights to push in the repo?

No, the master branch is protected and needs a pull request as well as passing tests before merging. That way we break the nightly tests less frequently.

You can create a PR, even if it can't be merged. Then I can merge the master on top.

AndreaBartolini commented 7 months ago

Maybe I've not right understood the workflow. I don't trying to push over the master but to push a new branch and then to create a PR to master (this is what I do, for example, when I create PR on the Powergrids repo).

Can you please explain me the right workflow?

Thanks in advance

AnHeuermann commented 7 months ago

Sure.

First create a fork of this repository:

grafik

https://github.com/OpenModelica/OpenModelicaLibraryTesting/fork

That is your personal copy AndreaBartolini/OpenModelicaLibraryTesting where you can push your new branch WindowsSupport with the changes you want to contribute to OpenModelica/OpenModelicaLibraryTesting.

Then create a new pull request:

grafik

https://github.com/OpenModelica/OpenModelicaLibraryTesting/compare

AndreaBartolini commented 7 months ago

the PR #58 partially implements the windows support