See https://travis-ci.org/native-api/opencv-python/builds/453359272 for a sample failure and https://travis-ci.org/native-api/opencv-python/builds/453426776 for the success after that when I figured out the problem.
At certain points, Travis bash logic calls
shell_session_update for some reason. This function, which is always present in an OSX interactive shell, is not present in Travis shell environment, so the command fails with the above message.
I see that Travis protects itself against accidental termination by unsetting
-e – but it doesn’t unset
trap ERR, so the above failure still terminates Travis logic.
So, there are a few problems here:
shell_session_updatein the first place
AFAICS it saves interactive session history and optionally state. So there’s no point using it inside a batch job anyway.
Not protecting Travis logic against an ERR trap
It’s not documented in hxxps://docs.travis-ci.com/user/customizing-the-build/ that using traps is illegal or some conditions must be met, so officially they are fair game.