ratfactor / ziglings

Learn the Zig programming language by fixing tiny broken programs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

windows-latest freeze when running jobs

perillo opened this issue · comments

The problem started when I added an additional job running zig build test.

I have done some tests on an old laptop with Windows 10.0.19044.0.
It seems the problem is Bash from Git for Windows (I'm using PortableGit from scoop).

When running zig build -Dhealed from PowerShell, it works correctly.
When running zig build -Dhealed from Bash, sometimes it freeze, and sometimes it prints:

      0 [sig] patch 1829 wait_sig: garbled signal pipe data nb 62, sig 1920226088
   1968 [sig] patch 1829 wait_sig: garbled signal pipe data nb 52, sig 1668571504
   2325 [sig] patch 1829 wait_sig: garbled signal pipe data nb 43, sig 1634038312

However I was unable to find similar problem on Internet.

I will run some tests using github actions from my clone of ziglings.

PowerShell, it works correctly.

As far as I know the github actions uses PowerShell. That's why I am wondering about the errors in this repo.

PowerShell, it works correctly.

As far as I know the github actions uses PowerShell. That's why I am wondering about the errors in this repo.

All the workflows in ziglings set the default shell to bash, so that it can run the eowyn.sh script.

Ok, than I was wrong.

Idea: When we split the steps for windows and linux/mac, than we could change from bash to PpowerShell. What do you think?

@perillo Update: It seems to work, I'm going to make some tests, I hope it solves the problem.

@chrboesch I think you are too fast to commit, without waiting for a review and run/check the github actions.

In #267 you tried to run a Bash script from PowerShell, and it is obviously wrong.
I ran the Eowyn workflow from my ziglings clone manually: https://github.com/perillo/ziglings/actions/runs/4830425751

The working time for windows-latest was 1m 6s, clearly suspicious.
The output from "Run Eowyn" step is simply:

patches/eowyn.sh

The script was not executed and PowerShell did not raise an error.

The cause of the problem may be https://lightrun.com/answers/httpie-httpie-hangs-up-on-git-bash-windows

I also found that some commands are not terminated correctly after a session. As an example the zig process from a previous session was preventing access to the cache directory (but in this case the command returned an error).

I think you are too fast to commit

You are right, sorry.

The script was not executed and PowerShell did not raise an error.

That is bad.

The cause of the problem may be

I'm going to read that and try to understand how we can solve the issue.

Maybe we should go the same way as Ziglang and write a PS script?

The simple solution is to temporarily disable running the unit tests, and revert the latest changes. As an example, commenting the run: zig build test line in the test job.

Here is the problem I found:

zig build test will run several test cases in parallel.
As an example: first zig build -Dhealed -Dn=n and second zig build -Dhealed -Dn=1 start.

The first test case runs without problems, but the second deadlocks, because there is a patch process that cause it.
I have no idea where/how that patch process is spawned, but killing it will remove the deadlock (but returns an error StreamTooLong).

The solution is already documented in test/tests.zig: each test case should be run in a separate directory. This will need a new option -Dhealed-path. I will implement it later, after other commits that I think are more important.

UPDATE: The problem may be also caused by a bug in Child.spawnAndWait() that does not correctly terminate the spawned process.

After some time I finally fixed this issue; I will create a PR later.

@chrboesch I will need to update the workflows, and I noted that you added quotes to the workflow names and comments.
However I think that they are not very useful. I would like to remove the quotes and move the comments at the top of the files, improving them. Is it ok for you?

and I noted that you added quotes to the workflow names and comments.
However I think that they are not very useful

According to gihub documentation, this is how you are supposed to do it.

and I noted that you added quotes to the workflow names and comments.
However I think that they are not very useful

According to gihub documentation, this is how you are supposed to do it.

The workflow file uses the YAML format, so quoting is not necessary, unless you need to force a builtin type like int or bool to a string.