This is an archive of the discontinued LLVM Phabricator instance.

lld: Include name of output file in "failed to write output" diag
ClosedPublic

Authored by thakis on Sep 1 2022, 7:08 AM.

Diff Detail

Event Timeline

thakis created this revision.Sep 1 2022, 7:08 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
thakis requested review of this revision.Sep 1 2022, 7:08 AM
thakis added a comment.Sep 1 2022, 7:09 AM

I see this fairly often on Windows, where you can't write to a file that another process – such as a virus scanner – has open: http://45.33.8.238/win/65440/step_4.txt I think it'd be nice to include the file name in the diag.

Come to think of it, maybe we should retry the write after it fails? Might help on Windows. On the other hand, that just hides the problem and doesn't fully fix it, so not sure that's better.

thakis updated this revision to Diff 457298.Sep 1 2022, 9:11 AM

fix test that only runs on windows

sbc100 accepted this revision.Sep 1 2022, 9:14 AM

I guess we could make a test that runs elsewhere, by creating a read-only output directory? But maybe not worth it. lgtm either way.

This revision is now accepted and ready to land.Sep 1 2022, 9:14 AM
MaskRay accepted this revision.Sep 1 2022, 9:33 AM
MaskRay added inline comments.
lld/test/ELF/link-open-file.test
15
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2022, 11:58 AM