Re: [hatari-devel] build test fails for macos on cirrus ci

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


On 02/06/2022 11.57, Chris Jenkins wrote:
....
If I ls the contents of $testdir then I see the following:

$ ls /var/folders/kk/xv3dmf2n31vb5hvlh65f7cmc0000gp/T/tmp.VLDfkT9d/

grab0001.pnghatari.nvramout.txttestmem.sav


So it has successfully saved the screenshot and the memory snapshot but it has silently failed to save the audio recording sndrec.wav and the video recording videorec.avi. These two files are specified in the temporary hatari.cfg that is created by the script so I'm wondering if the problem is caused by Hatari failing to correctly read and use the config. I'll try to find some time to investigate that next.

How does that sound and do you have any other suggestions for things I can look at?

I think you're on the right track here. The cmdfifo test saves the config
to "$testdir/.config/hatari/hatari.cfg" and then runs Hatari with
HOME="$testdir" so that Hatari "should" find it's config file in
~/.config/hatari/hatari.cfg ... however, that does not work on macOS,
if you look at src/paths.c, you can see:

#if defined(__MACOSX__)
        #define HATARI_HOME_DIR "Library/Application Support/Hatari"
#elif defined(WIN32)
        #define HATARI_HOME_DIR "AppData\\Local\\Hatari"
#else
        #define HATARI_HOME_DIR ".config/hatari"
#endif

thus the HATARI_HOME_DIR is in another location here.

I don't have any time for testing right now (sorry), but if you have got
some spare minutes, could you please check if this fixes the issue:

diff --git a/tests/cmdfifo.sh b/tests/cmdfifo.sh
index 3de58d4d..8cbe7913 100755
--- a/tests/cmdfifo.sh
+++ b/tests/cmdfifo.sh
@@ -23,7 +23,7 @@ trap remove_temp EXIT
mkdir -p "$testdir/.config/hatari" -cat > "$testdir/.config/hatari/hatari.cfg" <<EOF
+cat > "$testdir/hatari.cfg" <<EOF
 [Sound]
 szYMCaptureFileName=$testdir/sndrec.wav
@@ -37,7 +37,8 @@ export SDL_AUDIODRIVER=dummy
 unset TERM
HOME="$testdir" $hatari --confirm-quit false --screenshot-dir "$testdir" \
-       --tos none --cmd-fifo "$cmdfifo" $* > "$testdir/out.txt" 2>&1 &
+       -c "$testdir/hatari.cfg" --tos none --cmd-fifo "$cmdfifo" $* \
+       > "$testdir/out.txt" 2>&1 &
 hatari_pid=$!
# Wait until the fifo has been created by Hatari

.... this will load the config file via the "-c" parameter of Hatari
instead of silently assuming that the config file should be in a certain
location.

 Thomas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/