fix(nix): address review feedback on setup and runtime safety

This commit is contained in:
Nicolai Bruns committed 2026-10-18 13:51:58 +02:00
1 parent 57223d4c0a
commit 6909c7f83b
6 files changed
+26 -10

No files matched your search

+2
View File
@@ -71,6 +71,8 @@ one of the following methods.
```sh
nix profile add github:lucannez64/darling-lol#default
# Older Nix/Lix versions without `profile add`:
# nix profile install github:lucannez64/darling-lol#default
```
Then launch from your application menu or terminal:
+2
View File
@@ -18,6 +18,8 @@ To install permanently, adding the launcher to your user profile:
```sh
nix profile add github:lucannez64/darling-lol#default
# Older Nix/Lix versions without `profile add`:
# nix profile install github:lucannez64/darling-lol#default
```
Then run `darling-lol` or use the desktop application menu. See
+2 -1
View File
@@ -8,7 +8,8 @@ if [ -n "${DARLING_WORKSPACE:-}" ] && ! python3 scripts/nix-state.py check; then
fi
export PATH="${DARLING_RUNNER_DIR:+$DARLING_RUNNER_DIR:}$repo/usr-local/bin:/usr/local/bin:$PATH"
region=${1:-euw}
case "$region" in euw|eune|na|br|kr|jp|lan|las|oce|ru|tr) ;; *) echo 'Use a Riot installer region code' >&2; exit 1;; esac
case "$region" in lan) region=la1;; las) region=la2;; oce) region=oc1;; esac
case "$region" in euw|eune|na|br|kr|jp|la1|la2|oc1|ru|tr) ;; *) echo 'Use a Riot installer region code' >&2; exit 1;; esac
python3 scripts/configure.py >/dev/null
bash build/runtime/tools/fetch-installer.sh "$region" build/installer
unzip -q -o "build/installer/live.$region.zip" -d build/installer
+15 -7
View File
@@ -13,6 +13,14 @@ import sys
import time
def warn(message):
"""Diagnostics must not discard the namespace after a terminal hangup."""
try:
print(message, file=sys.stderr, flush=True)
except OSError:
pass
def main():
scripts = Path(__file__).resolve().parent
spec = importlib.util.spec_from_file_location('nix_idle', scripts / 'nix-idle.py')
@@ -42,7 +50,7 @@ def main():
if result < 0:
result = 128 - result
except OSError as error:
print(f'Cannot start client: {error}', file=sys.stderr)
warn(f'Cannot start client: {error}')
finally:
# A launcher can return while guest clients remain. Do not tear down
# their server, or discard the only namespace capable of shutting it down.
@@ -54,21 +62,21 @@ def main():
last_error = None
except (OSError, RuntimeError) as error:
if str(error) != last_error:
print(f'{error}; retaining original namespace and retrying. '
'Exit clients to allow safe shutdown.', file=sys.stderr)
warn(f'{error}; retaining original namespace and retrying. '
'Exit clients to allow safe shutdown.')
last_error = str(error)
time.sleep(1)
while True:
try:
shutdown = subprocess.run(['bash', str(scripts / 'darling-rootless.sh'), 'shutdown']).returncode
except OSError as error:
print(f'Cannot run namespace-local shutdown: {error}', file=sys.stderr)
warn(f'Cannot run namespace-local shutdown: {error}')
shutdown = 1
if not shutdown:
break
print(f'Darling namespace-local shutdown failed (status {shutdown}); '
'retaining the original namespace and retrying in 5 seconds. '
'Keep this terminal open.', file=sys.stderr)
warn(f'Darling namespace-local shutdown failed (status {shutdown}); '
'retaining the original namespace and retrying in 5 seconds. '
'Keep this terminal open.')
time.sleep(5)
result = interrupted or result
return result
+4 -2
View File
@@ -71,10 +71,12 @@ def inventory(root):
for directory, dirs, files in os.walk(root, followlinks=False,
onerror=enumeration_error):
excluded = ('.before-', '.rt-', '.llvm')
dirs[:] = sorted(name for name in dirs if not any(token in name for token in excluded))
for name in sorted(dirs + files):
path = Path(directory) / name
if any(token in path.name for token in ('.before-', '.rt-', '.llvm')):
if any(token in name for token in excluded):
continue
path = Path(directory) / name
info = path.lstat()
target_str = ''
if path.is_symlink():
+1
View File
@@ -245,6 +245,7 @@
"include/Metal/MTLTrace.h",
"private-include/Metal/MTLArgumentInternal.h",
"private-include/Metal/MTLBlitCommandEncoderInternal.h",
"private-include/Metal/MTLDeviceInfo.h",
"private-include/Metal/MTLDepthStencilInternal.h",
"private-include/Metal/MTLSamplerStateInternal.h",
"private-include/Metal/MTLVertexDescriptorInternal.h",