firefox: fix flaky dylib check due to SIGPIPE race

The `otool ... | grep -q ...` pipeline sometimes fails with
PIPESTATUS=141 because of SIGPIPE race.

It happens because `grep -q` doesn't drain the pipe but exits on first
match. If it exists before `otool` writes its last line to stdout,
`otool` fails on write. It makes the whole dylib check fail. This
results in a symlink left pointing to a dylib file instead of copying
it, which may break the app.

The solution is to drain the pipeline with `grep -F`.
This commit is contained in:
Ihar Hrachyshka
2026-07-11 09:26:47 -04:00
parent 8098344e9d
commit c0cc2fda70
@@ -434,7 +434,7 @@ let
;;
*)
# Copy if the symlink resolves to a Mach-O dylib
otool -l "$file" 2>/dev/null | grep -q 'LC_ID_DYLIB' || continue
otool -l "$file" 2>/dev/null | grep -F 'LC_ID_DYLIB' >/dev/null || continue
;;
esac