This reverts commit 492de35df4. I tried to apply John's changes in 8d897ec915 that were expected to fix his patch but that didn't work unfortunately. Reverting this again to fix the macOS bots and leave him more time to investigate the issue.
492de35df4
8d897ec915