Title: [264092] trunk/Tools
Revision
264092
Author
clo...@igalia.com
Date
2020-07-08 03:41:54 -0700 (Wed, 08 Jul 2020)

Log Message

[JHBuild] Add support for using a minimal moduleset
https://bugs.webkit.org/show_bug.cgi?id=213614

Reviewed by Carlos Garcia Campos.

This patch introduces a way of specifying a moduleset other than the default
via the environment variable WEBKIT_JHBUILD_MODULESET and adds a minimal moduleset
that allows building WebKit with it. This minimal moduleset includes the libraries
needed for building WebKit on Ubuntu-18.04, and those libraries are only build if
needed since they include the <pkg-config> entries that tells JHBuild to not build
them if those are already installed system wide. So this minimal moduleset should
work also on newer versions of Ubuntu or even other distributions.

Currently a recipe for newer libsoup than the one shipped by Ubuntu-18.04 is included
since we need this to have support for SameSite cookie support.
The minimal moduleset is shared between WPE and GTK to reduce code duplication.

To use this, you have to export on the build environment:
WEBKIT_JHBUILD=1
WEBKIT_JHBUILD_MODULESET=minimal

* Scripts/update-webkit-libs-jhbuild:
(getJhbuildIncludedFilePaths):
(jhbuildModulesetNameChanged):
(jhbuildConfigurationChanged):
(saveJhbuildMd5):
(saveJhbuildModulesetName):
(saveJhbuildConfig):
(deleteJhbuildMd5):
(deleteJhbuildModulesetName):
(deleteJhbuildConfig):
* Scripts/webkitdirs.pm:
(getJhbuildModulesetName):
* gtk/jhbuild-minimal.modules: Added.
* jhbuild/jhbuild-minimal.modules: Added.
* jhbuild/jhbuildrc_common.py:
(init):
* jhbuild/patches/libsoup-lower-glib-dependency-to-2.38.patch: Added.
* wpe/jhbuild-minimal.modules: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (264091 => 264092)


--- trunk/Tools/ChangeLog	2020-07-08 10:07:59 UTC (rev 264091)
+++ trunk/Tools/ChangeLog	2020-07-08 10:41:54 UTC (rev 264092)
@@ -1,3 +1,45 @@
+2020-07-08  Carlos Alberto Lopez Perez  <clo...@igalia.com>
+
+        [JHBuild] Add support for using a minimal moduleset
+        https://bugs.webkit.org/show_bug.cgi?id=213614
+
+        Reviewed by Carlos Garcia Campos.
+
+        This patch introduces a way of specifying a moduleset other than the default
+        via the environment variable WEBKIT_JHBUILD_MODULESET and adds a minimal moduleset
+        that allows building WebKit with it. This minimal moduleset includes the libraries
+        needed for building WebKit on Ubuntu-18.04, and those libraries are only build if
+        needed since they include the <pkg-config> entries that tells JHBuild to not build
+        them if those are already installed system wide. So this minimal moduleset should
+        work also on newer versions of Ubuntu or even other distributions.
+
+        Currently a recipe for newer libsoup than the one shipped by Ubuntu-18.04 is included
+        since we need this to have support for SameSite cookie support.
+        The minimal moduleset is shared between WPE and GTK to reduce code duplication.
+
+        To use this, you have to export on the build environment:
+        WEBKIT_JHBUILD=1
+        WEBKIT_JHBUILD_MODULESET=minimal
+
+        * Scripts/update-webkit-libs-jhbuild:
+        (getJhbuildIncludedFilePaths):
+        (jhbuildModulesetNameChanged):
+        (jhbuildConfigurationChanged):
+        (saveJhbuildMd5):
+        (saveJhbuildModulesetName):
+        (saveJhbuildConfig):
+        (deleteJhbuildMd5):
+        (deleteJhbuildModulesetName):
+        (deleteJhbuildConfig):
+        * Scripts/webkitdirs.pm:
+        (getJhbuildModulesetName):
+        * gtk/jhbuild-minimal.modules: Added.
+        * jhbuild/jhbuild-minimal.modules: Added.
+        * jhbuild/jhbuildrc_common.py:
+        (init):
+        * jhbuild/patches/libsoup-lower-glib-dependency-to-2.38.patch: Added.
+        * wpe/jhbuild-minimal.modules: Added.
+
 2020-07-08  Philippe Normand  <pnorm...@igalia.com>
 
         [webkitpy] run-minibrowser doesn't default to mac and stdout/stderr are not displayed

Modified: trunk/Tools/Scripts/update-webkit-libs-jhbuild (264091 => 264092)


--- trunk/Tools/Scripts/update-webkit-libs-jhbuild	2020-07-08 10:07:59 UTC (rev 264091)
+++ trunk/Tools/Scripts/update-webkit-libs-jhbuild	2020-07-08 10:41:54 UTC (rev 264092)
@@ -48,6 +48,7 @@
 sub getJhbuildIncludedFilePaths
 {
     my $jhbuildFile = shift;
+    die "Can't find file $jhbuildFile" if ! -e $jhbuildFile;
     my $dom = XML::LibXML->load_xml(location => $jhbuildFile);
     my @includes;
 
@@ -95,10 +96,23 @@
     }
 }
 
+sub jhbuildModulesetNameChanged()
+{
+    my $jhBuildModulesetNameFile = join('/', getJhbuildPath(), $platform, 'moduleset.name');
+    my $previousModulesetName;
+    open(my $FH, '<', $jhBuildModulesetNameFile) or return 1;
+    {
+        local $/; # localized slurp mode
+        $previousModulesetName = <$FH>;
+    }
+    close($FH);
+    return $previousModulesetName ne getJhbuildModulesetName();
+}
+
 sub jhbuildConfigurationChanged()
 {
-    my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, 'jhbuild.modules');
-    my @jhbuildFiles = qw(jhbuildrc jhbuild.modules);
+    my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, getJhbuildModulesetName());
+    my @jhbuildFiles = ('jhbuildrc', getJhbuildModulesetName());
     push(@jhbuildFiles, getJhbuildIncludedFilePaths($jhbuildMain));
 
     foreach my $file (@jhbuildFiles) {
@@ -106,6 +120,7 @@
             return 1;
         }
     }
+    return jhbuildModulesetNameChanged();
 }
 
 sub saveMd5File
@@ -125,8 +140,8 @@
 sub saveJhbuildMd5() {
     # Save md5sum for jhbuild-related files.saveJhbuildMd5();
     my $jhbuildPath = getJhbuildPath();
-    my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, 'jhbuild.modules');
-    my @jhbuildFiles = qw(jhbuildrc jhbuild.modules);
+    my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, getJhbuildModulesetName());
+    my @jhbuildFiles = ('jhbuildrc', getJhbuildModulesetName());
     push(@jhbuildFiles, getJhbuildIncludedFilePaths($jhbuildMain));
 
     (-d $jhbuildPath) || mkpath $jhbuildPath;
@@ -135,6 +150,20 @@
     }
 }
 
+sub saveJhbuildModulesetName() {
+    my $jhBuildPlatformDir = join('/', getJhbuildPath(), $platform);
+    (-d $jhBuildPlatformDir) || mkpath $jhBuildPlatformDir;
+    my $jhBuildModulesetNameFile = join('/', $jhBuildPlatformDir, 'moduleset.name');
+    open(FH, '>', $jhBuildModulesetNameFile);
+    print FH getJhbuildModulesetName();
+    close(FH);
+}
+
+sub saveJhbuildConfig() {
+    saveJhbuildMd5();
+    saveJhbuildModulesetName();
+}
+
 sub deleteJhbuildMd5() {
     my $jhbuildPath = getJhbuildPath();
     if (!-d $jhbuildPath) {
@@ -141,8 +170,8 @@
         return;
     }
 
-    my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, 'jhbuild.modules');
-    my @jhbuildFiles = qw(jhbuildrc jhbuild.modules);
+    my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, getJhbuildModulesetName());
+    my @jhbuildFiles = ('jhbuildrc', getJhbuildModulesetName());
     push(@jhbuildFiles, getJhbuildIncludedFilePaths($jhbuildMain));
 
     foreach my $file (@jhbuildFiles) {
@@ -151,6 +180,16 @@
     }
 }
 
+sub deleteJhbuildModulesetName() {
+    my $jhBuildModulesetNameFile = join('/', jhbuildPath, $platform, 'moduleset.name');
+    unlink($jhBuildModulesetNameFile) if -e $jhBuildModulesetNameFile;
+}
+
+sub deleteJhbuildConfig() {
+    deleteJhbuildMd5();
+    deleteJhbuildModulesetName();
+}
+
 sub runJhbuild
 {
     my $command = shift;
@@ -193,8 +232,8 @@
 
 print "Updating " . $prettyPlatform{$platform} . " port dependencies using jhbuild...\n";
 if (runJhbuild("build") == 0) {
-    saveJhbuildMd5();
+    saveJhbuildConfig();
 } else {
-    deleteJhbuildMd5();
+    deleteJhbuildConfig();
     die "Failed to build " . $prettyPlatform{$platform} . " port dependencies with jhbuild\n";
 }

Modified: trunk/Tools/Scripts/webkitdirs.pm (264091 => 264092)


--- trunk/Tools/Scripts/webkitdirs.pm	2020-07-08 10:07:59 UTC (rev 264091)
+++ trunk/Tools/Scripts/webkitdirs.pm	2020-07-08 10:41:54 UTC (rev 264092)
@@ -2108,6 +2108,16 @@
     return File::Spec->catdir(@jhbuildPath);
 }
 
+
+sub getJhbuildModulesetName()
+{
+    if (defined($ENV{'WEBKIT_JHBUILD_MODULESET'})) {
+        return 'jhbuild-' . $ENV{'WEBKIT_JHBUILD_MODULESET'} . '.modules';
+    }
+    return 'jhbuild.modules';
+}
+
+
 sub getUserFlatpakPath()
 {
     my $productDir = baseProductDir();

Added: trunk/Tools/gtk/jhbuild-minimal.modules (0 => 264092)


--- trunk/Tools/gtk/jhbuild-minimal.modules	                        (rev 0)
+++ trunk/Tools/gtk/jhbuild-minimal.modules	2020-07-08 10:41:54 UTC (rev 264092)
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE moduleset SYSTEM "moduleset.dtd">
+<?xml-stylesheet type="text/xsl" href=""
+<moduleset>
+  <include href=""
+</moduleset>

Added: trunk/Tools/jhbuild/jhbuild-minimal.modules (0 => 264092)


--- trunk/Tools/jhbuild/jhbuild-minimal.modules	                        (rev 0)
+++ trunk/Tools/jhbuild/jhbuild-minimal.modules	2020-07-08 10:41:54 UTC (rev 264092)
@@ -0,0 +1,108 @@
+<?xml version="1.0"?>
+<!DOCTYPE moduleset SYSTEM "moduleset.dtd">
+<?xml-stylesheet type="text/xsl" href=""
+<moduleset>
+
+  <metamodule id="webkitgtk-minimal-dependencies">
+    <dependencies>
+      <dep package="wpebackend-fdo"/>
+      <dep package="libsoup"/>
+    </dependencies>
+  </metamodule>
+
+  <metamodule id="webkitwpe-minimal-dependencies">
+    <dependencies>
+      <dep package="wpebackend-fdo"/>
+      <dep package="libsoup"/>
+    </dependencies>
+  </metamodule>
+
+  <!-- Please use http/https to access repositories to be friendly to users stuck behind firewalls. -->
+  <repository type="git" name="github.com"
+      href=""
+  <repository type="tarball" name="github-tarball"
+      href=""
+  <repository type="tarball" name="sourceware.org-mirror"
+      href=""
+  <repository type="tarball" name="ftp.gnome.org"
+      href=""
+  <repository type="tarball" name="download.gnome.org"
+      href=""
+  <repository type="git" name="git.gnome.org"
+      href=""
+  <repository type="tarball" name="cairographics.org"
+      href=""
+  <repository type="tarball" name="freedesktop.org"
+      href=""
+  <repository type="tarball" name="xorg"
+      href=""
+  <repository type="tarball" name="xmlsoft.org"
+      href=""
+  <repository type="tarball" name="savannah.gnu.org"
+      href=""
+  <repository type="git" name="freedesktop-git"
+      href=""
+ <repository type="tarball" name="dri.freedesktop.org"
+      href=""
+  <repository type="tarball" name="mesa.freedesktop.org"
+      href=""
+  <repository type="tarball" name="wayland.freedesktop.org"
+      href=""
+  <repository type="tarball" name="llvm.org"
+      href=""
+  <repository type="tarball" name="webkitgtk-jhbuild-mirror"
+      href=""
+  <repository type="tarball" name="gnupg.org"
+      href=""
+  <repository type="tarball" name="wpewebkit"
+      href=""
+
+
+<!-- This moduleset is used when the environment variable WEBKIT_JHBUILD_MODULESET=minimal is set -->
+<!-- Its intended to allow building WebKit using as much as libraries from your distribution as possible -->
+<!-- In order to ensure its minimal, all the modules should have a pkg-config declaration line -->
+
+  <cmake id="libwpe">
+    <branch module="WebPlatformForEmbedded/libwpe/releases/download/1.6.0/libwpe-1.6.0.tar.xz" version="1.6.0"
+            repo="github-tarball"
+            hash="3587c6b8a807f4bb76b268ba74ca82c6b395b90235db41ad8252224456193c90"/>
+  </cmake>
+
+  <cmake id="wpebackend-fdo">
+    <dependencies>
+      <dep package="libwpe"/>
+    </dependencies>
+    <branch repo="github.com" module="Igalia/WPEBackend-fdo.git" checkoutdir="wpebackend-fdo" tag="1.3.1-54-g1f58ebdf632fdf90f691949d90c8338a8d7073c7"/>
+  </cmake>
+
+  <!-- libsoup >= 2.69 required for SameSite cookie support -->
+  <meson id="libsoup" mesonargs="-Dintrospection=disabled -Dgssapi=disabled -Dvapi=disabled -Dtests=false">
+    <pkg-config>libsoup-2.4.pc</pkg-config>
+    <dependencies>
+      <dep package="libpsl"/>
+    </dependencies>
+    <branch module="/sources/libsoup/2.69/libsoup-${version}.tar.xz" version="2.69.90"
+            repo="download.gnome.org"
+            hash="sha256:8ed18092cfb27d870a7c7c45992f3a216bd22dd6fd6d2c9fbf1adc2d6957cab8">
+    <patch file="libsoup-lower-glib-dependency-to-2.38.patch" strip="1"/>
+    </branch>
+  </meson>
+
+  <autotools id="libpsl" autogenargs="--enable-runtime=libicu --enable-builtin=libicu">
+    <pkg-config>libpsl.pc</pkg-config>
+    <branch module="rockdaboot/libpsl/releases/download/libpsl-${version}/libpsl-${version}.tar.gz"
+            version="0.20.2"
+            repo="github-tarball"
+            hash="sha256:f8fd0aeb66252dfcc638f14d9be1e2362fdaf2ca86bde0444ff4d5cc961b560f"/>
+  </autotools>
+
+  <!-- meson 0.50.1 required to build libsoup 2.69 -->
+  <distutils id="meson" python3="1">
+    <branch repo="github-tarball"
+            version="0.50.1"
+            module="mesonbuild/meson/releases/download/${version}/meson-${version}.tar.gz"
+            checkoutdir="meson-${version}"
+            hash="sha256:f68f56d60c80a77df8fc08fa1016bc5831605d4717b622c96212573271e14ecc"/>
+  </distutils>
+
+</moduleset>

Modified: trunk/Tools/jhbuild/jhbuildrc_common.py (264091 => 264092)


--- trunk/Tools/jhbuild/jhbuildrc_common.py	2020-07-08 10:07:59 UTC (rev 264091)
+++ trunk/Tools/jhbuild/jhbuildrc_common.py	2020-07-08 10:41:54 UTC (rev 264092)
@@ -43,7 +43,14 @@
 
     jhbuildrc_globals["build_policy"] = 'updated'
 
-    __moduleset_file_uri = 'file://' + os.path.join(__tools_directory, 'jhbuild.modules')
+    __moduleset_file_name = 'jhbuild.modules'
+    if 'WEBKIT_JHBUILD_MODULESET' in os.environ:
+        __moduleset_file_name = 'jhbuild-%s.modules' % os.environ['WEBKIT_JHBUILD_MODULESET']
+    __moduleset_file_path = os.path.join(__tools_directory, __moduleset_file_name)
+    if not os.path.isfile(__moduleset_file_path):
+        raise RuntimeError("Can't find the moduleset in path %s" % __moduleset_file_path)
+    __moduleset_file_uri = 'file://' + __moduleset_file_path
+
     __extra_modulesets = os.environ.get("WEBKIT_EXTRA_MODULESETS", "").split(",")
     jhbuildrc_globals["moduleset"] = [__moduleset_file_uri, ]
     if __extra_modulesets != ['']:
@@ -50,7 +57,12 @@
         jhbuildrc_globals["moduleset"].extend(__extra_modulesets)
 
     __extra_modules = os.environ.get("WEBKIT_EXTRA_MODULES", "").split(",")
-    jhbuildrc_globals["modules"] = ['webkit' + jhbuild_platform + '-testing-dependencies', ]
+
+    base_dependency_suffix = 'testing'
+    if 'WEBKIT_JHBUILD_MODULESET' in os.environ:
+        base_dependency_suffix = os.environ['WEBKIT_JHBUILD_MODULESET']
+
+    jhbuildrc_globals["modules"] = ['webkit' + jhbuild_platform + '-' + base_dependency_suffix + '-dependencies', ]
     if __extra_modules != ['']:
         jhbuildrc_globals["modules"].extend(__extra_modules)
 

Added: trunk/Tools/jhbuild/patches/libsoup-lower-glib-dependency-to-2.38.patch (0 => 264092)


--- trunk/Tools/jhbuild/patches/libsoup-lower-glib-dependency-to-2.38.patch	                        (rev 0)
+++ trunk/Tools/jhbuild/patches/libsoup-lower-glib-dependency-to-2.38.patch	2020-07-08 10:41:54 UTC (rev 264092)
@@ -0,0 +1,30 @@
+From 8b52555afed23e4c22e0a110c06d38a1c88dc3cf Mon Sep 17 00:00:00 2001
+From: Carlos Alberto Lopez Perez <clo...@igalia.com>
+Date: Wed, 1 Jul 2020 14:47:50 +0200
+Subject: [PATCH] Revert "Bump glib dependency to 2.58"
+
+This reverts commit c7da362a2593ed9391ee831edbf0d27cbd680a67.
+
+The new glib version is only needed to be able to use
+g_canonicalize_filename() on tests/test-utils.c which we dont
+build.
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index fffbb42f..7d9d7d86 100644
+--- a/meson.build
++++ b/meson.build
+@@ -80,7 +80,7 @@ endif
+ 
+ add_project_arguments(common_flags, language : 'c')
+ 
+-glib_required_version = '>= 2.58'
++glib_required_version = '>= 2.38'
+ glib_dep = dependency('glib-2.0', version : glib_required_version,
+                        fallback: ['glib', 'libglib_dep'])
+ gobject_dep = dependency('gobject-2.0', version : glib_required_version,
+-- 
+2.20.1
+

Added: trunk/Tools/wpe/jhbuild-minimal.modules (0 => 264092)


--- trunk/Tools/wpe/jhbuild-minimal.modules	                        (rev 0)
+++ trunk/Tools/wpe/jhbuild-minimal.modules	2020-07-08 10:41:54 UTC (rev 264092)
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE moduleset SYSTEM "moduleset.dtd">
+<?xml-stylesheet type="text/xsl" href=""
+<moduleset>
+  <include href=""
+</moduleset>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to