However, I was the one who requested the musl detection in config.guess and the maintainer implemented the check like this for reasons of portability.
Without escaping the caret it’s not as portable as it could be. By the way, I checked in the mean time, and the problem with unescaped ^musl in zsh is that it may be expanded to “any file name that is not musl” which explains the output Thomas was getting. The grep command is thus expanded to something like “grep -q dir1 dir2 file1 [piped output]”, generating an error message for each directory. Mojca, if you want to reproduce that, you need the extended glob option (setopt EXTENDED_GLOB). See man zshexpn for details.
Perhaps the problem is the else case in this statement. Maybe it should be:
LIBC="glibc" if command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl then LIBC="musl" fi
That won’t help; it is logically equivalent to if command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl then LIBC=musl else LIBC=glibc fi and doesn’t address any of problems. Best, Arthur