Make test fails with bash > 5.0.18
Starting with bash 5.1.0, the test will fail with:
*snip*
bash variable sanity check...failed 4/7
TEST FAILED: BASH built-in variable $BASH_REMATCH: declare -a BASH_REMATCH=() does not match declare -ar *
make[1]: *** [Makefile:395: test] Error 255
make[1]: Leaving directory '/tmp/arch-builds/nhc/src/nhc/test'
make: *** [Makefile:935: test] Error 2
Running Archlinux here.
Happy to provide more details or tests any patches.
This is also failing on bash version GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu) for ubuntu 20.04.
Running latest commit (260f8a511611b768cb53145505d7f23ef92a286a) from master branch, on Ubuntu 20.04, with GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu) and all tests pass.
The BASH variable sanity checks were added to the dev branch during 1.4.3 development; that would be why you didn't encounter any issues on the master branch, @heitorPB.
Because I'm taking a multi-pronged approach to the upcoming development & releases (which I'll detail at a later date), my chosen solution for the 1.4.3 release as committed in a042b595 was to disable those tests entirely. They were originally added for my benefit to ensure that, as I develop NHC going forward, I do not accidentally clobber any of the built-in BASH variables. Most of them, if assigned to or unset, will lose their special functionality and value permanently; no error or warning is provided by BASH when this happens, making it very difficult to debug and diagnose. It has no impact on the production deployment and use of NHC, so it can be safely removed for the time being.
In the 1.4.4 development branch, I plan to re-introduce those tests but using a much cleaner and less fragile way -- querying and storing the variable metadata prior to executing any NHC code so that the pre-run state could be compared to the post-run state. But there's not an urgent need for that, so it won't be a high-priority issue to work.