Bug 178574

Summary: Make SERVICE_WORKER feature buildable on GTK, WPE
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Zan Dobersek <zan>
Status: RESOLVED FIXED    
Severity: Normal CC: cgarcia, mcatanzaro, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 178579    
Bug Blocks: 178576    
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing
none
Patch for landing
none
Patch
none
Patch
none
Patch for landing none

Description Zan Dobersek 2017-10-20 03:51:23 PDT
Make SERVICE_WORKER feature buildable on GTK, WPE
Comment 1 Zan Dobersek 2017-10-20 04:08:57 PDT
Created attachment 324382 [details]
Patch
Comment 2 Carlos Garcia Campos 2017-10-20 04:19:41 PDT
Comment on attachment 324382 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=324382&action=review

> Source/WebKit/PlatformGTK.cmake:1306
> -    COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${WEBKIT_DIR} --output ${FORWARDING_HEADERS_DIR} --platform gtk --platform soup
> +    COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${WEBKIT_DIR} --include-path ${DERIVED_SOURCES_WEBKIT_DIR} --output ${FORWARDING_HEADERS_DIR} --platform gtk --platform soup

I don't think this works in a clean build, the derived sources might not have been generated yet. This is a known issue that we normally solve by explicitly including the required headers in the non-generated source file that includes the generated one.
Comment 3 Zan Dobersek 2017-10-20 04:36:26 PDT
Comment on attachment 324382 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=324382&action=review

>> Source/WebKit/PlatformGTK.cmake:1306
>> +    COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${WEBKIT_DIR} --include-path ${DERIVED_SOURCES_WEBKIT_DIR} --output ${FORWARDING_HEADERS_DIR} --platform gtk --platform soup
> 
> I don't think this works in a clean build, the derived sources might not have been generated yet. This is a known issue that we normally solve by explicitly including the required headers in the non-generated source file that includes the generated one.

Can this target not depend on the WebKit_DERIVED_SOURCES list, which would be the list of all source files generated via the generate-message-*.py scripts? Is there an existing bug covering this?
Comment 4 Carlos Garcia Campos 2017-10-20 04:52:01 PDT
(In reply to Zan Dobersek from comment #3)
> Comment on attachment 324382 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=324382&action=review
> 
> >> Source/WebKit/PlatformGTK.cmake:1306
> >> +    COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${WEBKIT_DIR} --include-path ${DERIVED_SOURCES_WEBKIT_DIR} --output ${FORWARDING_HEADERS_DIR} --platform gtk --platform soup
> > 
> > I don't think this works in a clean build, the derived sources might not have been generated yet. This is a known issue that we normally solve by explicitly including the required headers in the non-generated source file that includes the generated one.
> 
> Can this target not depend on the WebKit_DERIVED_SOURCES list, which would
> be the list of all source files generated via the generate-message-*.py
> scripts? Is there an existing bug covering this?

Maybe, I've never tried it. I don't remember if there's a bug for this...
Comment 5 Zan Dobersek 2017-10-20 05:46:16 PDT
(In reply to Carlos Garcia Campos from comment #4)
> (In reply to Zan Dobersek from comment #3)
> > Comment on attachment 324382 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=324382&action=review
> > 
> > >> Source/WebKit/PlatformGTK.cmake:1306
> > >> +    COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${WEBKIT_DIR} --include-path ${DERIVED_SOURCES_WEBKIT_DIR} --output ${FORWARDING_HEADERS_DIR} --platform gtk --platform soup
> > > 
> > > I don't think this works in a clean build, the derived sources might not have been generated yet. This is a known issue that we normally solve by explicitly including the required headers in the non-generated source file that includes the generated one.
> > 
> > Can this target not depend on the WebKit_DERIVED_SOURCES list, which would
> > be the list of all source files generated via the generate-message-*.py
> > scripts? Is there an existing bug covering this?
> 
> Maybe, I've never tried it. I don't remember if there's a bug for this...

Opened bug #178579.
Comment 6 Zan Dobersek 2017-10-20 06:07:10 PDT
Comment on attachment 324382 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=324382&action=review

> Source/WebKit/StorageProcess/StorageProcess.cpp:377
> -    IPC::Connection::Identifier connectionIdentifier = encodedConnectionIdentifier.releaseFileDescriptor();
> +    IPC::Connection::Identifier connectionIdentifier = encodedConnectionIdentifier.fileDescriptor();

We actually do have to release the file descriptor here. For that we need a mutable IPC::Attachment, so the didGetWorkerContextProcessConnection() method must expect an rvalue reference to the IPC::Attachment object, which is already casted as such in the IPC::handleMessage() implementation.
Comment 7 Zan Dobersek 2017-10-24 03:05:27 PDT
Created attachment 324665 [details]
Patch
Comment 8 Zan Dobersek 2017-10-24 05:30:53 PDT
Created attachment 324668 [details]
Patch for landing

Moves JSDOMPromise.cpp to the unified sources build process.
Comment 9 Zan Dobersek 2017-10-24 05:32:05 PDT
Created attachment 324669 [details]
Patch for landing

Moves JSDOMPromise.cpp to the unified sources build process.
Comment 10 Zan Dobersek 2017-10-24 08:14:16 PDT
Created attachment 324673 [details]
Patch
Comment 11 Zan Dobersek 2017-10-24 08:15:59 PDT
Created attachment 324674 [details]
Patch
Comment 12 Zan Dobersek 2017-10-24 10:53:24 PDT
(In reply to Zan Dobersek from comment #11)
> Created attachment 324674 [details]
> Patch

This finally builds now, and it's already reviewed. The r? flag was set by accident.
Comment 13 Zan Dobersek 2017-10-24 22:58:08 PDT
Created attachment 324795 [details]
Patch for landing
Comment 14 Zan Dobersek 2017-10-25 00:17:24 PDT
Comment on attachment 324795 [details]
Patch for landing

Clearing flags on attachment: 324795

Committed r223951: <https://trac.webkit.org/changeset/223951>
Comment 15 Zan Dobersek 2017-10-25 00:17:28 PDT
All reviewed patches have been landed.  Closing bug.
Comment 16 Radar WebKit Bug Importer 2017-11-15 13:11:34 PST
<rdar://problem/35568955>