Run `cabal update` before resolving the dependencies
Sometimes cabal-audit fails resolving the dependencies because the index-state in ~/.cabal is too old. Either it should run cabal update itself or show an appropriate message to the user.
We can also set CABAL_DIR to a temporary directory and run update in there so as to not pollute any existing ~/.cabal
Does it not show the output that cabal itself sends to stderr? Smth like “the index state is N days old”?
I don’t know if running cabal update is appropriate, it changes the global state of the cabal installation which may be unexpected.
Does it not show the output that cabal itself sends to stderr? Smth like “the index state is N days old”?
It does but it's just a warning so it's not immediately obvious
I don’t know if running cabal update is appropriate, it changes the global state of the cabal installation which may be unexpected.
I agree, however when we set this up in a github runner it wasn't obvious why it failed there when it doesn't fail locally. Anyway just documenting it in the README should be good enough as the default haskell action runs cabal update anyway