darlinghq / darling

Darwin/macOS emulation layer for Linux
http://www.darlinghq.org
GNU General Public License v3.0
11.56k stars 447 forks source link

darling hangs when trying to save out to variable when bootstrap isn't already running #1510

Open tihmstar opened 7 months ago

tihmstar commented 7 months ago

Expected Result darling should bootstrap and then execute the command and write the result into a variable.

Actual Result Darling bootstrap hangs when trying to write the result into a variable indefinitely

Steps To Reproduce This causes a hang:

RANDSTR=$(cat /dev/random | head -c16 | xxd -p)
DIRPATH="/tmp/darling.XXXXXXXX"${RANDSTR}
MYTMPDIR=$(mktemp -d ${DIRPATH})
export HOME=${MYTMPDIR}
rsp=$(/usr/local/bin/darling exec /usr/local/libexec/darling/bin/echo 123)

Output:

Setting up a new Darling prefix at /tmp/darling.sEDpLv9t2ed667d37f5a7ffbcdc87b06c5280f1b/.darling
<HANGS HERE FOREVER>

However running it first without writing it to the variable (so that darling can first bootstrap), works as expected.

RANDSTR=$(cat /dev/random | head -c16 | xxd -p)
DIRPATH="/tmp/darling.XXXXXXXX"${RANDSTR}
MYTMPDIR=$(mktemp -d ${DIRPATH})
export HOME=${MYTMPDIR}
/usr/local/bin/darling exec /usr/local/libexec/darling/bin/echo 123
rsp=$(/usr/local/bin/darling exec /usr/local/libexec/darling/bin/echo 123)
echo $rsp

Output:

Setting up a new Darling prefix at /tmp/darling.WreDvMdhbf5751fbb219b31eb38940698138400b/.darling
Bootstrapping the container with launchd...
123
123

dmesg Output Run dmesg | grep 'overlay\|darling'

[346121.157101] overlayfs: "xino" feature enabled using 2 upper inode bits.

System Information What system are you running?

Software Version
Linux Kernel 6.8.7-arch1-1
Darling 7c8415e679b59641f9f7aede78ed0acb2972051f