# Retry build steps on specific errors

**URL:** https://discourse.cmake.org/t/retry-build-steps-on-specific-errors/6221
**Category:** Usage
**Created:** [August 5, 2022, 1:51pm UTC](https://discourse.cmake.org/t/retry-build-steps-on-specific-errors/6221 "2022-08-05T13:51:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![KUGA2](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kuga2/32/4968_2.png) [@KUGA2](https://discourse.cmake.org/u/KUGA2)
#### Post date: [August 5, 2022, 1:51pm UTC](https://discourse.cmake.org/t/retry-build-steps-on-specific-errors/6221/1 "2022-08-05T13:51:15Z")

</div>

Is it possible to (silently) retry build steps if specific errors occur?

If some pattern is in stdout/err, it will not log the error but retry it (maybe after some sleep).

Details:  
The particular error is  
mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file “run\eventopen.exe”. Access is denied.

Where the binary name is variable of course. The reason is the antivir program and the IT is not fond of the idea to exclude files. See also: [c++ - mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file ... Access is denied - Stack Overflow](https://stackoverflow.com/q/3775406/4675668)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [August 5, 2022, 3:45pm UTC](https://discourse.cmake.org/t/retry-build-steps-on-specific-errors/6221/2 "2022-08-05T15:45:18Z")

</div>

There is no mechanism to do so. You’d need to write a compiler wrapper that detects these cases and reruns the compiler internally. There’s the `CMAKE_<LANG>_COMPILER_LAUNCHER` variable to add this to all rules.

---

<div class="post-metadata">

### Author: ![KUGA2](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kuga2/32/4968_2.png) [@KUGA2](https://discourse.cmake.org/u/KUGA2)
#### Post date: [August 5, 2022, 4:17pm UTC](https://discourse.cmake.org/t/retry-build-steps-on-specific-errors/6221/3 "2022-08-05T16:17:12Z")

</div>

Thanks, I thought so.
