46cd4174

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Fix watch crash on attachment in a nonexistent directory

When an attachment's path points into a directory that does not exist (for
example because of a typo), checkAttachment tried to list that parent directory
with listDirRel to suggest similar filenames, which threw an uncaught IO
exception (getDirectoryContents:openDirStream: does not exist). The watch loop
only catches ExitCode, so this crashed the whole watch process.

Wrap the directory listing in forgivingAbsence so a nonexistent parent
directory simply yields no suggestions, and the normal CE_MISSING_ATTACHMENT
error is reported instead.

Adds a regression test scenario (CE_MISSING_ATTACHMENT_NONEXISTENT_DIR) that
crashed before the fix.

Suite timing

Time to Start Worker time Duration Time to finish Idle
Config 4m01s 1s 1s 4m03s 4m01s
Eval 4m05s 54s 54s 4m59s 2s
Build 32m58s 56s 56s 33m55s 27m59s
Suite 4m01s 1m52s 29m53s 33m55s 32m02s

Timeline

0s4m10s4m20s4m30s4m40s4m50s33m33m10s33m20s33m30s33m40s33m50s