This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mt] Add support /notify_update
ClosedPublic

Authored by abrachet on Mar 10 2022, 6:51 PM.

Details

Summary

/notify_update is an undocumented feature used by CMake. From their usage, it looks like this feature just changes mt's exit code if the output file was changed. See https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmcmd.cxx#L2300 this is also consistent with some testing I have done of the mt.exeshipped with Visual Studio. See also the comment at https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmcmd.cxx#L2440.

There might be a more performant way to implement this by first checking calling llvm::sys::fs::file_size() and if it is the same as the new output's size use llvm::WritableMemoryBuffer and fallback to llvm::FileOutputBuffer otherwise, but these don't inherit from a common ancestor so any implementation doing this would be really ugly.

Fixes https://github.com/llvm/llvm-project/issues/54329

Diff Detail

Event Timeline

abrachet created this revision.Mar 10 2022, 6:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 6:51 PM
abrachet requested review of this revision.Mar 10 2022, 6:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 6:51 PM
phosek accepted this revision.Mar 10 2022, 7:35 PM

LGTM

This revision is now accepted and ready to land.Mar 10 2022, 7:35 PM
This revision was landed with ongoing or failed builds.Mar 10 2022, 7:48 PM
This revision was automatically updated to reflect the committed changes.