vulkano
vulkano copied to clipboard
Improve examples scripts
This adds a PowerShell version of the run_all.sh
script for those that want to test on Windows, as well as headless versions of both scripts which will come in handy for CI but can also be used by us. I also made the existing run_all.sh
script more portable.
I get an error when I try to run the script:
rua@rua-desktop ~/code/vulkano/examples $ ./run_all.sh ./run_all.sh: 2: set: Illegal option -o pipefail
Interesting, may I know the output you get when running sh --version
please?
rua@rua-desktop ~ $ sh --version sh: 0: Illegal option --
Eh? XD
Er, the original bourne shell didn't have that option. Oof. I suspect you have actual bourne shell installed. I can't seem to be able to install it, only bash, on my system. If you really have it installed that's actually chef's kiss.
I assume it's done for compatibility reasons, and I guess it also stops people from using sh
when they're not actually using commands compatible with sh
. I have both sh
and bash
, and the latter is 5.1.16.
Yeah, that's why I'm happy you have it. It's not possible to install for me so mistakes are bound to happen. Bash is Linux-specific so I wanted to make the script more compatible by being inclusive to the BSD systems (and I guess MacOS?)
That's why I also removed all the RiiR programs. Personally when I tried to run the script I had 1/4 of those programs installed, and the one I did have installed (ripgrep) was a dependency at the time. Kind of silly if you ask me, since the whole point of shell scripts is that they run without additional setup.
It seems -o pipefail
is bash-only. Pity, but it worked without it before so.
Now it works, but the gl-interop example crashes (as it has been for a while), and the script terminates instead of continuing. Is there a way to make it continue?
Wait, is continuing on failure the expected behavior?
I actually hadn't noticed that, that the sh script would continue even after one of the commands returned non-zero. That makes the way the PowerShell scripts run inconsistent. But in any case, the gl-interop example crashes because of SIGSEGV which terminates everything I think. Not sure why exactly.
I put this at the start of the async-update example:
unsafe { (1 as *mut u8).write_volatile(69) };
And indeed this makes xargs terminate, unlike a panic for instance.
Wait, is continuing on failure the expected behavior?
It's what the script did before, at least. And there should be a way to skip over a problematic example so that you can continue with the rest, it shouldn't block you from everything else.
As I say that's still the behavior, except for SIGSEGV, which makes xargs terminate for some reason. Pretty weird.
I'll use a loop instead of xargs, and make the PowerShell version behave the same, sometime later. This PR is not that high-priority anyway.