Hello,
I am running into problems with GN on Windows for Pigweed. I get an error about a file created with generate_file being used by another process during gn gen.
Here's the summarized error message:
$ gn gen 'C:\<build_dir>' --color=always --check --fail-on-unused-args
[9200:0426/144652.603:ERROR:file_writer.cc(40)] CreateFile failed for path C:/<build_dir>/<toolchain>/gen/<file_path> The process cannot access the file because it is being used by another process. (0x20)
ERROR Unable to write file.
I was writing "C:/<build_dir>/<toolchain>/gen/<file_path>".
(example build failure here, though you may not have access)
These errors started occurring when I switched some
generate_file commands from the default toolchain to a non-default toolchain (
CL). They only occur on Windows for one internal project, and happen about half of the time. They never happen if the
generate_file commands are in the default toolchain.
A second, possibly related issue occurs after gn gen succeeds. The directory for an output from an action_foreach does not exist when it runs on Windows, but only for this one project. The directory does exist on Linux or Mac. That is easy to work around -- I just create the parent directory of the output file before creating it (perhaps we should be doing that anyway). Just odd that this only occurs for one project's build on one platform.
Has anyone seen issues like these on Windows?
Thanks,
Wyatt