Bug 178206

Summary: [GStreamer][GTK][WPE] update-webkit-libs-jhbuild fails to detect changes in included moduleset files
Product: WebKit Reporter: Nael Ouedraogo <nael.ouedp>
Component: Tools / TestsAssignee: Nael Ouedraogo <nael.ouedp>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, aperez, bugs-noreply, calvaris, clopez, commit-queue, dbates, eocanha, lforschler, mcatanzaro, ossy, simon.fraser, webkit-bug-importer, zan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Nael Ouedraogo 2017-10-12 03:19:38 PDT
[GStreamer][GTK][WPE] update-webkit-libs-jhbuild fails to detect changes in included moduleset files. For instance, it cannot detect modification of gstreamer/jhbuild.modules when updating dependencies of WebKitGtk.
Comment 1 Michael Catanzaro 2017-10-12 04:53:05 PDT
This regressed when we split GStreamer stuff into a separate moduleset file (that update-webkit-libs-jhbuild does not know about).
Comment 2 Adrian Perez 2017-10-12 09:11:39 PDT
Created attachment 323529 [details]
Patch

Tentative patch. Note that my Perl-fu is close to non-existant.

(But at least this did not seem to break anything locally for me.)
Comment 3 Nael Ouedraogo 2017-10-12 10:03:03 PDT
I discussed with Michael on this by email and he told me that we don't want to have to modify the perl script every time we add a new moduleset file. So maybe we should find another fix. 

In the meantime I prepared a patch that parses jhbuild.modules to determine if other jhbuild.modules are included. If any, it computes MD5 sum for each included jhbuild.modules file. If you think it is a good way to fix this bug, I can upload the patch.
Comment 4 Adrian Perez 2017-10-12 10:15:13 PDT
(In reply to Nael Ouedraogo from comment #3)

> I discussed with Michael on this by email and he told me that we don't want
> to have to modify the perl script every time we add a new moduleset file. So
> maybe we should find another fix. 

Well, not having to touch the Perl is certainly nicer.
 
> In the meantime I prepared a patch that parses jhbuild.modules to determine
> if other jhbuild.modules are included. If any, it computes MD5 sum for each
> included jhbuild.modules file. If you think it is a good way to fix this
> bug, I can upload the patch.

That sounds certainly *much better* than the patch I have posted earlier.
Thanks a lot for working on it!
Comment 5 Adrian Perez 2017-10-12 10:16:08 PDT
Comment on attachment 323529 [details]
Patch

Marking my patch as obsolete, as Nael's solution will be much better.
Comment 6 Nael Ouedraogo 2017-10-12 11:01:57 PDT
Created attachment 323535 [details]
Patch
Comment 7 Xabier Rodríguez Calvar 2017-10-16 00:19:13 PDT
I'd prefer somebody with better Perl-fu could review this but the main ideas lgtm.
Comment 8 Carlos Alberto Lopez Perez 2017-10-16 03:06:29 PDT
Comment on attachment 323535 [details]
Patch

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

> Tools/Scripts/webkitdirs.pm:49
> +use XML::LibXML;

This is a new runtime dependency. It should be added to the scripts Tools/gtk/install-dependencies and Tools/wpe/install-dependencies.
The name of the package in Debian is libxml-libxml-perl
I will be installing it on the bots so the EWS don't fail anymore due to this
Comment 9 Adrian Perez 2017-10-16 04:22:29 PDT
(In reply to Carlos Alberto Lopez Perez from comment #8)
> Comment on attachment 323535 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=323535&action=review
> 
> > Tools/Scripts/webkitdirs.pm:49
> > +use XML::LibXML;
> 
> This is a new runtime dependency. It should be added to the scripts
> Tools/gtk/install-dependencies and Tools/wpe/install-dependencies.
> The name of the package in Debian is libxml-libxml-perl
> I will be installing it on the bots so the EWS don't fail anymore due to this

For Arch Linux the package is “perl-xml-libxml”:

  https://www.archlinux.org/packages/extra/x86_64/perl-xml-libxml/
Comment 10 Michael Catanzaro 2017-10-16 12:11:55 PDT
Comment on attachment 323535 [details]
Patch

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

r=me if you also update the two install-dependencies scripts. Thanks!

>>> Tools/Scripts/webkitdirs.pm:49
>>> +use XML::LibXML;
>> 
>> This is a new runtime dependency. It should be added to the scripts Tools/gtk/install-dependencies and Tools/wpe/install-dependencies.
>> The name of the package in Debian is libxml-libxml-perl
>> I will be installing it on the bots so the EWS don't fail anymore due to this
> 
> For Arch Linux the package is “perl-xml-libxml”:
> 
>   https://www.archlinux.org/packages/extra/x86_64/perl-xml-libxml/

The package name variations for this on the different distros are incredible... I believe the correct Fedora package is "perl-libxml-perl".

> Tools/Scripts/webkitdirs.pm:1888
> +sub getJhbuildIncludedFilePath

I think this should be called "getJhbuildIncludedFilePaths" since it returns multiple paths.
Comment 11 Michael Catanzaro 2017-10-16 12:12:39 PDT
(In reply to Michael Catanzaro from comment #10)
> The package name variations for this on the different distros are
> incredible... I believe the correct Fedora package is "perl-libxml-perl".

Not to be confused with Debian's libxml-libxml-perl and Arch's perl-xml-libxml....
Comment 12 Nael Ouedraogo 2017-10-17 03:24:10 PDT
Created attachment 324009 [details]
Patch
Comment 13 Nael Ouedraogo 2017-10-17 03:32:35 PDT
Thanks for all reviews and for helping me to find the good lib names for each distribution. 

In uploaded patch, I moved getJhbuildIncludedFilePaths sub from webkitdirs.pm to update-webkit-libs-jhbuild script to avoid issues when other ports (win port) use webkitdir.pm and perl-libXML is not installed. I also updated install-dependencies.
Comment 14 WebKit Commit Bot 2017-10-17 06:54:59 PDT
Comment on attachment 324009 [details]
Patch

Clearing flags on attachment: 324009

Committed r223536: <https://trac.webkit.org/changeset/223536>
Comment 15 WebKit Commit Bot 2017-10-17 06:55:01 PDT
All reviewed patches have been landed.  Closing bug.
Comment 16 Radar WebKit Bug Importer 2017-10-17 06:55:51 PDT
<rdar://problem/35028586>
Comment 17 Michael Catanzaro 2017-10-24 17:32:18 PDT
(In reply to Michael Catanzaro from comment #10)
> The package name variations for this on the different distros are
> incredible... I believe the correct Fedora package is "perl-libxml-perl".

Wrong... it is perl-XML-LibXML.

I don't pretend to understand
Comment 18 Michael Catanzaro 2017-10-24 17:37:02 PDT
Committed r223943: <https://trac.webkit.org/changeset/223943>