Bug 180921 - [Win][CMake] Use add_custom_command to copy each forwarding header files
Summary: [Win][CMake] Use add_custom_command to copy each forwarding header files
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-12-17 18:06 PST by Fujii Hironori
Modified: 2018-01-05 02:41 PST (History)
6 users (show)

See Also:


Attachments
WIP patch (8.02 KB, patch)
2017-12-19 18:33 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
WIP patch (9.15 KB, patch)
2017-12-19 22:48 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (12.63 KB, patch)
2017-12-20 19:04 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (15.87 KB, patch)
2017-12-21 20:26 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (15.86 KB, patch)
2017-12-21 21:57 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2017-12-17 18:06:59 PST
My previous patch (Bug 180521) doesn't solve the issue perfectly.
Another incremental build failure happens.

https://build.webkit.org/builders/WinCairo%2064-Bit%20Release/builds/9336
Comment 1 Fujii Hironori 2017-12-17 18:08:24 PST
WTF forwarding headers are generated by using WTF_PRE_BUILD_COMMAND in Source/WTF/wtf/PlatformWin.cmake.

But, BYPRODUCTS of add_custom_target is not specified.
<https://cmake.org/cmake/help/v3.10/command/add_custom_target.html>

So, Ninja doesn't know the forwarding headers are generated.
Comment 2 Konstantin Tokarev 2017-12-18 01:50:29 PST
Make sure that cmake property GENERATED is enabled for generates files
Comment 3 Fujii Hironori 2017-12-18 18:27:43 PST
Just setting GENERATED source file property isn't enough in this case. Ninja have to know which command generates the dependent files.
Comment 4 Fujii Hironori 2017-12-19 18:33:28 PST
Created attachment 329868 [details]
WIP patch
Comment 5 Fujii Hironori 2017-12-19 22:48:12 PST
Created attachment 329899 [details]
WIP patch
Comment 6 Fujii Hironori 2017-12-20 01:32:13 PST
Unfortunately, this WIP patch doen't work as expected.
Modifying WTF header doesn't trigger the recompilation of TestWTF.

I guess this is caused by case insensitive file system.

Condition.cpp.obj of TestWTF depends on ForwardingHeaders/wtf/Condition.h.

> C:\webkit\ga\WebKitBuild\Debug>ninja -t deps Tools\TestWebKitAPI\CMakeFiles\TestWTFLib.dir\Tests\WTF\Condition.cpp.obj
> (...)
>    DerivedSources/ForwardingHeaders/wtf/Condition.h
> (...)

It's a lowercase wtf.
But, actual build rule is uppercase WTF.

> C:\webkit\ga\WebKitBuild\Debug>ninja -t query DerivedSources/ForwardingHeaders/WTF/Condition.h
> DerivedSources/ForwardingHeaders/WTF/Condition.h:
>   input: CUSTOM_COMMAND
>     ../../Source/WTF/wtf/Condition.h
>   outputs:
>     cmake_object_order_depends_target_WTF
>     Source/WTF/wtf/WTFForwardingHeaders
>     Source/WTF/wtf/CMakeFiles/WTFForwardingHeaders
Comment 7 Fujii Hironori 2017-12-20 02:24:30 PST
I've confirmed my speculation is right. I'll fix it beforehand in Bug 181022.
Comment 8 Fujii Hironori 2017-12-20 19:04:48 PST
Created attachment 329995 [details]
Patch
Comment 9 Fujii Hironori 2017-12-21 20:26:02 PST
Created attachment 330100 [details]
Patch
Comment 10 Fujii Hironori 2017-12-21 21:57:32 PST
Created attachment 330109 [details]
Patch
Comment 11 Brent Fulgham 2017-12-28 13:46:25 PST
Comment on attachment 330109 [details]
Patch

r=me
Comment 12 WebKit Commit Bot 2017-12-28 14:06:39 PST
Comment on attachment 330109 [details]
Patch

Clearing flags on attachment: 330109

Committed r226306: <https://trac.webkit.org/changeset/226306>
Comment 13 WebKit Commit Bot 2017-12-28 14:06:40 PST
All reviewed patches have been landed.  Closing bug.
Comment 14 Radar WebKit Bug Importer 2018-01-02 12:58:28 PST
<rdar://problem/36260870>
Comment 15 Fujii Hironori 2018-01-05 02:41:13 PST
REGRESSION: Bug 181324