Workaround possible TH environment overflow running `wine` (#1517)
We still do not understand the cause, but wine seems to fail to start (we get a segfault) when building `cardano-wallet-cli` test `unit`. It seems to be an overflow somewhere in bash or very early in the `wine` startup code (since nothing is logged even with `WINEDEBUG=+all`).
This changes `unsets` the large `pkgsHostTargetAsString` environment variable before wine is started (after that variable has been used). This seems to be enough to avoid the issue though it is worrying that it is not clear why.
commit5a310b0b3904d9b90239390eb2dfb59e4dcb0d96
authorHamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
dateThu 16 Jun 2022, 20:58 (4 years ago)
parent19e9e37
overlays/mingw_w64.nix+2
@@ -44,6 +44,8 @@ let
4444 ln -s "$l" "''${l#lib}"
4545 done
4646 )
47+ # Not sure why this `unset` helps. It might avoids some kind of overflow issue. We see `wine` fail to start when building `cardano-wallet-cli` test `unit`.
48+ unset pkgsHostTargetAsString
4749 WINEDLLOVERRIDES="winemac.drv=d" WINEDEBUG=warn-all,fixme-all,-menubuilder,-mscoree,-ole,-secur32,-winediag WINEPREFIX=$TMP ${wine}/bin/wine64 $REMOTE_ISERV/remote-iserv.exe tmp $PORT &
4850 (>&2 echo "---| remote-iserv should have started on $PORT")
4951 RISERV_PID="$!"