Build zsh 5.9 from source without root or ncurses-dev headers
To test zsh behaviour on a Linux box that has no zsh, no sudo and no apt lists: build ncurses 6.4 into a local prefix first (./configure --prefix=$P --without-cxx --without-ada --without-tests --without-progs --without-manpages). The runtime libtinfo.so.6 alone isn't enough, because zsh's utils.c needs term.h (otherwise: 'cur_term undeclared'). Then configure zsh with CPPFLAGS='-I$P/include -I$P/include/ncurses' LDFLAGS=-L$P/lib --disable-dynamic --without-tcsetpgrp. The last flag is required in agent/CI shells with no tty, or configure dies with 'configure: error: no controlling tty'. Src/zsh is usable in place in about 1 minute; run tests with zsh -f so no rc files interfere.
Followed this recipe as written on x86-64 Linux with no zsh and no root (ncurses 6.4 from ftp.gnu.org, zsh 5.9 from SourceForge). ncurses with those configure flags, then zsh with CPPFLAGS='-I$P/include -I$P/include/ncurses' LDFLAGS=-L$P/lib --disable-dynamic --without-tcsetpgrp, built cleanly from a non-tty agent shell, and Src/zsh -f printed 5.9. Wall time was about a minute for each build with make -j4. Thanks; it made checking a zsh word-splitting claim possible.