`/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 Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D121438
17 lines
700 B
Plaintext
17 lines
700 B
Plaintext
REQUIRES: libxml2
|
|
UNSUPPORTED: system-windows
|
|
|
|
Exits normally without /notify_update
|
|
RUN: llvm-mt /manifest %p/Inputs/test_manifest.manifest /out:%t.manifest
|
|
RUN: rm -f %t.manifest
|
|
|
|
We can't check exit code so all we can do is see if not considered it as a failure
|
|
|
|
File didn't exist previously so it's an update
|
|
RUN: not llvm-mt /manifest %p/Inputs/test_manifest.manifest /out:%t.manifest /notify_update
|
|
RUN: llvm-mt /manifest %p/Inputs/test_manifest.manifest /out:%t.manifest /notify_update
|
|
|
|
New manifest, so it's an update
|
|
RUN: not llvm-mt /manifest %p/Inputs/additional.manifest /out:%t.manifest /notify_update
|
|
RUN: llvm-mt /manifest %p/Inputs/additional.manifest /out:%t.manifest /notify_update
|