Changeset 264092 in webkit


Ignore:
Timestamp:
Jul 8, 2020, 3:41:54 AM (5 years ago)
Author:
clopez@igalia.com
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.
Location:
trunk/Tools
Files:
5 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r264065 r264092  
     12020-07-08  Carlos Alberto Lopez Perez  <clopez@igalia.com>
     2
     3        [JHBuild] Add support for using a minimal moduleset
     4        https://bugs.webkit.org/show_bug.cgi?id=213614
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        This patch introduces a way of specifying a moduleset other than the default
     9        via the environment variable WEBKIT_JHBUILD_MODULESET and adds a minimal moduleset
     10        that allows building WebKit with it. This minimal moduleset includes the libraries
     11        needed for building WebKit on Ubuntu-18.04, and those libraries are only build if
     12        needed since they include the <pkg-config> entries that tells JHBuild to not build
     13        them if those are already installed system wide. So this minimal moduleset should
     14        work also on newer versions of Ubuntu or even other distributions.
     15
     16        Currently a recipe for newer libsoup than the one shipped by Ubuntu-18.04 is included
     17        since we need this to have support for SameSite cookie support.
     18        The minimal moduleset is shared between WPE and GTK to reduce code duplication.
     19
     20        To use this, you have to export on the build environment:
     21        WEBKIT_JHBUILD=1
     22        WEBKIT_JHBUILD_MODULESET=minimal
     23
     24        * Scripts/update-webkit-libs-jhbuild:
     25        (getJhbuildIncludedFilePaths):
     26        (jhbuildModulesetNameChanged):
     27        (jhbuildConfigurationChanged):
     28        (saveJhbuildMd5):
     29        (saveJhbuildModulesetName):
     30        (saveJhbuildConfig):
     31        (deleteJhbuildMd5):
     32        (deleteJhbuildModulesetName):
     33        (deleteJhbuildConfig):
     34        * Scripts/webkitdirs.pm:
     35        (getJhbuildModulesetName):
     36        * gtk/jhbuild-minimal.modules: Added.
     37        * jhbuild/jhbuild-minimal.modules: Added.
     38        * jhbuild/jhbuildrc_common.py:
     39        (init):
     40        * jhbuild/patches/libsoup-lower-glib-dependency-to-2.38.patch: Added.
     41        * wpe/jhbuild-minimal.modules: Added.
     42
    1432020-07-08  Philippe Normand  <pnormand@igalia.com>
    244
  • trunk/Tools/Scripts/update-webkit-libs-jhbuild

    r260565 r264092  
    4949{
    5050    my $jhbuildFile = shift;
     51    die "Can't find file $jhbuildFile" if ! -e $jhbuildFile;
    5152    my $dom = XML::LibXML->load_xml(location => $jhbuildFile);
    5253    my @includes;
     
    9697}
    9798
     99sub jhbuildModulesetNameChanged()
     100{
     101    my $jhBuildModulesetNameFile = join('/', getJhbuildPath(), $platform, 'moduleset.name');
     102    my $previousModulesetName;
     103    open(my $FH, '<', $jhBuildModulesetNameFile) or return 1;
     104    {
     105        local $/; # localized slurp mode
     106        $previousModulesetName = <$FH>;
     107    }
     108    close($FH);
     109    return $previousModulesetName ne getJhbuildModulesetName();
     110}
     111
    98112sub jhbuildConfigurationChanged()
    99113{
    100     my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, 'jhbuild.modules');
    101     my @jhbuildFiles = qw(jhbuildrc jhbuild.modules);
     114    my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, getJhbuildModulesetName());
     115    my @jhbuildFiles = ('jhbuildrc', getJhbuildModulesetName());
    102116    push(@jhbuildFiles, getJhbuildIncludedFilePaths($jhbuildMain));
    103117
     
    107121        }
    108122    }
     123    return jhbuildModulesetNameChanged();
    109124}
    110125
     
    126141    # Save md5sum for jhbuild-related files.saveJhbuildMd5();
    127142    my $jhbuildPath = getJhbuildPath();
    128     my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, 'jhbuild.modules');
    129     my @jhbuildFiles = qw(jhbuildrc jhbuild.modules);
     143    my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, getJhbuildModulesetName());
     144    my @jhbuildFiles = ('jhbuildrc', getJhbuildModulesetName());
    130145    push(@jhbuildFiles, getJhbuildIncludedFilePaths($jhbuildMain));
    131146
     
    134149        saveMd5File($file);
    135150    }
     151}
     152
     153sub saveJhbuildModulesetName() {
     154    my $jhBuildPlatformDir = join('/', getJhbuildPath(), $platform);
     155    (-d $jhBuildPlatformDir) || mkpath $jhBuildPlatformDir;
     156    my $jhBuildModulesetNameFile = join('/', $jhBuildPlatformDir, 'moduleset.name');
     157    open(FH, '>', $jhBuildModulesetNameFile);
     158    print FH getJhbuildModulesetName();
     159    close(FH);
     160}
     161
     162sub saveJhbuildConfig() {
     163    saveJhbuildMd5();
     164    saveJhbuildModulesetName();
    136165}
    137166
     
    142171    }
    143172
    144     my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, 'jhbuild.modules');
    145     my @jhbuildFiles = qw(jhbuildrc jhbuild.modules);
     173    my $jhbuildMain = join('/', sourceDir(), 'Tools', $platform, getJhbuildModulesetName());
     174    my @jhbuildFiles = ('jhbuildrc', getJhbuildModulesetName());
    146175    push(@jhbuildFiles, getJhbuildIncludedFilePaths($jhbuildMain));
    147176
     
    150179        unlink($md5File) if -e $md5File;
    151180    }
     181}
     182
     183sub deleteJhbuildModulesetName() {
     184    my $jhBuildModulesetNameFile = join('/', jhbuildPath, $platform, 'moduleset.name');
     185    unlink($jhBuildModulesetNameFile) if -e $jhBuildModulesetNameFile;
     186}
     187
     188sub deleteJhbuildConfig() {
     189    deleteJhbuildMd5();
     190    deleteJhbuildModulesetName();
    152191}
    153192
     
    194233print "Updating " . $prettyPlatform{$platform} . " port dependencies using jhbuild...\n";
    195234if (runJhbuild("build") == 0) {
    196     saveJhbuildMd5();
     235    saveJhbuildConfig();
    197236} else {
    198     deleteJhbuildMd5();
     237    deleteJhbuildConfig();
    199238    die "Failed to build " . $prettyPlatform{$platform} . " port dependencies with jhbuild\n";
    200239}
  • trunk/Tools/Scripts/webkitdirs.pm

    r263742 r264092  
    21092109}
    21102110
     2111
     2112sub getJhbuildModulesetName()
     2113{
     2114    if (defined($ENV{'WEBKIT_JHBUILD_MODULESET'})) {
     2115        return 'jhbuild-' . $ENV{'WEBKIT_JHBUILD_MODULESET'} . '.modules';
     2116    }
     2117    return 'jhbuild.modules';
     2118}
     2119
     2120
    21112121sub getUserFlatpakPath()
    21122122{
  • trunk/Tools/jhbuild/jhbuildrc_common.py

    r259867 r264092  
    4444    jhbuildrc_globals["build_policy"] = 'updated'
    4545
    46     __moduleset_file_uri = 'file://' + os.path.join(__tools_directory, 'jhbuild.modules')
     46    __moduleset_file_name = 'jhbuild.modules'
     47    if 'WEBKIT_JHBUILD_MODULESET' in os.environ:
     48        __moduleset_file_name = 'jhbuild-%s.modules' % os.environ['WEBKIT_JHBUILD_MODULESET']
     49    __moduleset_file_path = os.path.join(__tools_directory, __moduleset_file_name)
     50    if not os.path.isfile(__moduleset_file_path):
     51        raise RuntimeError("Can't find the moduleset in path %s" % __moduleset_file_path)
     52    __moduleset_file_uri = 'file://' + __moduleset_file_path
     53
    4754    __extra_modulesets = os.environ.get("WEBKIT_EXTRA_MODULESETS", "").split(",")
    4855    jhbuildrc_globals["moduleset"] = [__moduleset_file_uri, ]
     
    5158
    5259    __extra_modules = os.environ.get("WEBKIT_EXTRA_MODULES", "").split(",")
    53     jhbuildrc_globals["modules"] = ['webkit' + jhbuild_platform + '-testing-dependencies', ]
     60
     61    base_dependency_suffix = 'testing'
     62    if 'WEBKIT_JHBUILD_MODULESET' in os.environ:
     63        base_dependency_suffix = os.environ['WEBKIT_JHBUILD_MODULESET']
     64
     65    jhbuildrc_globals["modules"] = ['webkit' + jhbuild_platform + '-' + base_dependency_suffix + '-dependencies', ]
    5466    if __extra_modules != ['']:
    5567        jhbuildrc_globals["modules"].extend(__extra_modules)
Note: See TracChangeset for help on using the changeset viewer.