Fixes #5474: list-compatible-inputs fails when there is no which command
Fixes #5523: Generate cache in a configurable directory