RESOLVED FIXED187725
[CMake][Ninja][Win] midl.exe fails to create, open and write a temporary file in parallel build in Docker container
https://bugs.webkit.org/show_bug.cgi?id=187725
Summary [CMake][Ninja][Win] midl.exe fails to create, open and write a temporary file...
Fujii Hironori
Reported 2018-07-17 03:13:36 PDT
[WinCairo][EWS] midl : command line error MIDL1016 : cannot create intermediate file C:\Users\ContainerAdministrator\AppData\Local\Temp\MIDEFA7.tmp https://webkit-queues.webkit.org/patch/345018/wincairo-ews > midl : command line error MIDL1016 : cannot create intermediate file C:\Users\ContainerAdministrator\AppData\Local\Temp\MIDEFA7.tmp
Attachments
Patch to run midl.exe sequentially (1.79 KB, patch)
2018-10-01 02:26 PDT, Fujii Hironori
no flags
Patch to run midl.exe sequentially (4.14 KB, patch)
2018-10-01 02:28 PDT, Fujii Hironori
no flags
Patch to run midl.exe sequentially (2.03 KB, patch)
2018-10-01 02:54 PDT, Fujii Hironori
no flags
Patch (1.96 KB, patch)
2018-10-24 20:35 PDT, Fujii Hironori
no flags
Fujii Hironori
Comment 1 2018-07-20 00:33:13 PDT
A following error looks similar: https://webkit-queues.webkit.org/patch/343701/wincairo-ews > FAILED: DerivedSources/WebKitLegacy/Interfaces/AccessibleStates.h > > cmd.exe /C "cd /D C:\WebKit-EWS\WebKit\WebKitBuild\Release\Source\WebKitLegacy && midl.exe /I C:/WebKit-EWS/WebKit/Source/WebKitLegacy/win/Interfaces /I C:/WebKit-EWS/WebKit/Source/WebKitLegacy/win/Interfaces/Accessible2 /I C:/WebKit-EWS/WebKit/WebKitBuild/Release/DerivedSources/WebKitLegacy/include /I C:/WebKit-EWS/WebKit/Source/WebKitLegacy/win /WX /char signed /env win32 /tlb C:/WebKit-EWS/WebKit/WebKitBuild/Release/bin64/AccessibleStates.tlb /out C:/WebKit-EWS/WebKit/WebKitBuild/Release/DerivedSources/WebKitLegacy/Interfaces /h C:/WebKit-EWS/WebKit/WebKitBuild/Release/DerivedSources/WebKitLegacy/Interfaces/AccessibleStates.h /iid AccessibleStates_i.c "/D \"__PRODUCTION__=01\"" C:/WebKit-EWS/WebKit/Source/WebKitLegacy/win/Interfaces/Accessible2/AccessibleStates.idl" > > Microsoft (R) 32b/64b MIDL Compiler Version 8.01.0622 > > Copyright (c) Microsoft Corporation. All rights reserved. > > midl : error MIDL2212 : error while writing to file C:\Users\ContainerAdministrator\AppData\Local\Temp\MID9469.tmp
Ross Kirsling
Comment 2 2018-09-02 13:04:26 PDT
Ross Kirsling
Comment 3 2018-09-04 15:30:36 PDT
Although the one in my previous comment was the same as the first (MIDL1016), https://webkit-queues.webkit.org/results/9093311 has yet a third error code: > [4501/6255] Generating ../../DerivedSources/WebKitLegacy/Interfaces/AccessibleStates.h > FAILED: DerivedSources/WebKitLegacy/Interfaces/AccessibleStates.h > cmd.exe /C "cd /D C:\WebKit-EWS\WebKit\WebKitBuild\Release\Source\WebKitLegacy && midl.exe /I C:/WebKit-EWS/WebKit/Source/WebKitLegacy/win/Interfaces /I C:/WebKit-EWS/WebKit/Source/WebKitLegacy/win/Interfaces/Accessible2 /I C:/WebKit-EWS/WebKit/WebKitBuild/Release/DerivedSources/WebKitLegacy/include /I C:/WebKit-EWS/WebKit/Source/WebKitLegacy/win /WX /char signed /env win32 /tlb C:/WebKit-EWS/WebKit/WebKitBuild/Release/bin64/AccessibleStates.tlb /out C:/WebKit-EWS/WebKit/WebKitBuild/Release/DerivedSources/WebKitLegacy/Interfaces /h C:/WebKit-EWS/WebKit/WebKitBuild/Release/DerivedSources/WebKitLegacy/Interfaces/AccessibleStates.h /iid AccessibleStates_i.c "/D \"__PRODUCTION__=01\"" C:/WebKit-EWS/WebKit/Source/WebKitLegacy/win/Interfaces/Accessible2/AccessibleStates.idl" > Microsoft (R) 32b/64b MIDL Compiler Version 8.01.0622 > > Copyright (c) Microsoft Corporation. All rights reserved. > > midl : error MIDL2419 : Unable to open intermediate compiler file : Permission denied (C:\Users\ContainerAdministrator\AppData\Local\Temp\MID1C3B.tmp)
Fujii Hironori
Comment 4 2018-10-01 02:02:00 PDT
I can reproduce this issue by using Docker container on my PC. perl Tools\Scripts\build-webkit --wincairo cd WebKitBuild\Release del DerivedSources/WebKitLegacy/Interfaces/* ninja If I invoke ninja -j1, it seems that it'd not happen.
Fujii Hironori
Comment 5 2018-10-01 02:26:17 PDT
Created attachment 351227 [details] Patch to run midl.exe sequentially I created a patch to run midl.exe sequentially, but this doesn't address the issue. So strange.
Fujii Hironori
Comment 6 2018-10-01 02:28:59 PDT
Created attachment 351228 [details] Patch to run midl.exe sequentially Wrong patch attached. This is the patch I wanted to attach.
Fujii Hironori
Comment 7 2018-10-01 02:54:04 PDT
Created attachment 351230 [details] Patch to run midl.exe sequentially
Fujii Hironori
Comment 8 2018-10-01 23:46:36 PDT
I created a PowerShell script to run midl.exe parallely in Docker. https://gist.github.com/fujii/5dabb82dbd62dd535be6a44d6815b37b Then, I got following errors. > midl : error MIDL2419 : Unable to open intermediate compiler file : Permission denied (C:\Users\ContainerAdministrator\AppData\Local\Temp\MID9E47.tmp) > midl : command line error MIDL1016 : cannot create intermediate file C:\Users\ContainerAdministrator\AppData\Local\Temp\MID2B18.tmp > midl : command line error MIDL1016 : cannot create intermediate file C:\Users\ContainerAdministrator\AppData\Local\Temp\MID3E58.tmp But, If I run it sequentially, no such errors happened.
Fujii Hironori
Comment 9 2018-10-02 00:03:32 PDT
My conclusion is Docker seems to have a problem of parallel file system access. WinCairo port should give up either Docker or parallel build.
Fujii Hironori
Comment 10 2018-10-03 21:16:54 PDT
Comment on attachment 351230 [details] Patch to run midl.exe sequentially These my patches are completely wrong. JOB_POOL_COMPILE target property doesn't affect to custom commands. I should try USE_TERMINAL of add_custom_command to run midl.exe sequentially.
Fujii Hironori
Comment 11 2018-10-05 03:52:46 PDT
I've confirmed it still happens even with USES_TERMINAL. :-(
Fujii Hironori
Comment 12 2018-10-24 20:23:05 PDT
(In reply to Fujii Hironori from comment #11) > I've confirmed it still happens even with USES_TERMINAL. :-( This is wrong. I tested again. USES_TERMINAL actually solves this issue.
Fujii Hironori
Comment 13 2018-10-24 20:35:51 PDT
Don Olmstead
Comment 14 2018-10-24 20:56:54 PDT
Informal r+ This will add the command to the job pool https://cmake.org/cmake/help/v3.13/prop_gbl/JOB_POOLS.html#prop_gbl:JOB_POOLS
WebKit Commit Bot
Comment 15 2018-10-25 09:33:40 PDT
Comment on attachment 353076 [details] Patch Clearing flags on attachment: 353076 Committed r237416: <https://trac.webkit.org/changeset/237416>
WebKit Commit Bot
Comment 16 2018-10-25 09:33:42 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 17 2018-10-25 09:34:41 PDT
Note You need to log in before you can comment on or make changes to this bug.