Skip to content

ndd-log4b.sh fails on Apple Silicon Macs

Hello!

I have been trying to use your Docker container on a MacBook Air M1 (macOS Monterey 12.2.1) and am having some issues.

If I try to run any of the scripts that call ndd-log4b.sh once the Docker container is running, the script exits with the following:

❯ ./bin/build-html.sh
/Users/joeuser/docker/sphinx-doc-test/bin/ndd-log4b/ndd-log4b.sh: line 54: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]

Unless I'm mistaken, the following is the declare statement that is causing issues:

declare -A NDD_LOG4B_LEVEL_DISPLAY_NAMES

I have never encountered the use of 'declare' in any of the scripts/applications I've used in the past - at least if I have...I haven't noticed it. There might also be an inconsistency - line 50 contains:

declare -a NDD_LOG4B_LEVEL_NAMES

Whereas the other declare statements use a capital "A".

I guess it's also possible that this is occurring since macOS defaults to zsh instead of bash, but I am not sure.

Do you have an M1-based Mac? Are you able to test this?

Thanks!

-JeffH