Bug 170106

Summary: generate-bindings-all.pl shouldn't use Perl threads
Product: WebKit Reporter: Antoine Jacoutot <ajacoutot>
Component: Tools / TestsAssignee: Fujii Hironori <Hironori.Fujii>
Status: RESOLVED FIXED    
Severity: Blocker CC: buildbot, cdumez, commit-queue, Hironori.Fujii, lforschler, mcatanzaro, sam, ysuzuki
Priority: P2    
Version: WebKit Local Build   
Hardware: PC   
OS: Other   
Bug Depends on: 161433    
Bug Blocks:    
Attachments:
Description Flags
WIP Patch
none
Patch none

Description Antoine Jacoutot 2017-03-26 05:59:48 PDT
Hi.

Could the generate-bindings-all.pl script be modified to not require a threaded perl?
"The use of interpreter-based threads in perl is officially discouraged" by upstream and not all Linux distributions compile perl with threads support; that's also the case of the BSDs.

Trying to build on OpenBSD fails with:
This Perl not built to support threads
Compilation failed in require at ./webkitgtk4-2.16.0/webkitgtk-2.16.0/Source/WebCore/bindings/scripts/generate-bindings-all.pl line 35.
BEGIN failed--compilation aborted at ./webkitgtk4-2.16.0/webkitgtk-2.16.0/Source/WebCore/bindings/scripts/generate-bindings-all.pl line 35.
ninja: build stopped: subcommand failed.

Thanks.
Comment 1 Fujii Hironori 2017-03-26 22:24:39 PDT
http://search.cpan.org/~rybskej/forks/lib/forks.pm

This seems useful. I'll try it.
Comment 2 Antoine Jacoutot 2017-03-27 00:25:15 PDT
Thanks for looking into it. If you need me to test anything, feel free to ask :-)
Comment 3 Fujii Hironori 2017-03-27 03:20:28 PDT
(In reply to Fujii Hironori from comment #1)
> http://search.cpan.org/~rybskej/forks/lib/forks.pm
> This seems useful. I'll try it.

This doesn't work for me.
I need to give up using threads in Perl.
Comment 4 Fujii Hironori 2017-03-27 03:22:43 PDT
Created attachment 305459 [details]
WIP Patch

I created a WIP patch of using fork&exec&wait.

I feel slower in case of using Windows Perl.
Comment 5 Antoine Jacoutot 2017-03-27 09:37:07 PDT
Ah that seems to work fine so far :-)
Still building but I am way passed the original failure.
I'll keep you posted once the build is done. Thanks.
Comment 6 Fujii Hironori 2017-03-27 19:50:54 PDT
(In reply to Fujii Hironori from comment #4)
> I feel slower in case of using Windows Perl.

This my feeling was wrong. I did benchmark:

with threads:    00:04:01.83
without threads: 00:04:01.32
Comment 7 Fujii Hironori 2017-03-27 21:43:40 PDT
Created attachment 305559 [details]
Patch
Comment 8 Antoine Jacoutot 2017-03-27 23:06:42 PDT
I can confirm that with this patch I am able to build WebKit fine :-)
Thank you!
Comment 9 Fujii Hironori 2017-04-08 15:53:44 PDT
Could anyone review this?

Gentoo Linux also gets the trouble.
https://paste.pound-python.org/show/cC5FbmhCBLSg1qrwoLuv/
Comment 10 Yusuke Suzuki 2017-04-09 14:20:22 PDT
Comment on attachment 305559 [details]
Patch

r=me
Comment 11 WebKit Commit Bot 2017-04-09 14:48:09 PDT
Comment on attachment 305559 [details]
Patch

Clearing flags on attachment: 305559

Committed r215166: <http://trac.webkit.org/changeset/215166>
Comment 12 WebKit Commit Bot 2017-04-09 14:48:11 PDT
All reviewed patches have been landed.  Closing bug.