1 year ago

#281097

test-img

rstr1112

Log file write error while using Cmake, Ninja, PREFast with MSVC

Turning on the /analyze flag to run PREFast for Windows builds using MSVC non deterministically throws the below error. I think this is because ninja is trying to optimize builds by compiling files from the same target simultaneously but since each target logs to a single file, MSVC is not able to edit the file while another process is writing to the same log file because the file the other process is compiling belongs to the same target.

fatal error C1258: Failed to save XML Log file '<path to log file>.xml'. The process cannot access the file because it is being used by another process.
  1. Can I write to different files per target ?
  2. Can I make MSVC smarter and force it to attempt to write despte another process writing to it ?
  3. I don't want to set paralell jobs to 1 , so do I have any other options ?

visual-studio

cmake

static-code-analysis

ninja

prefast

0 Answers

Your Answer

Accepted video resources