Changeset 233362 in webkit


Ignore:
Timestamp:
Jun 29, 2018 10:47:17 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK][WPE]: Add a way to setup our development environment inside flatpak
https://bugs.webkit.org/show_bug.cgi?id=186771

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-06-29
Reviewed by Carlos Alberto Lopez Perez.

Tools:

This patch introduce a way to setup the development environment inside flatpak[0]
removing the need for jhbuild when doing so. Anything needed to build/run minibrowser/ run
layout tests is provided either but the org.gnome.Sdk runtime or built with flatpak-builder.

The workflow is very similar to the "jhbuild based" one except that you should use update-webkit$PORTNAME-flatpak instead
of update-webkit$PORTNAME-libs and that script requires to specify a build configuration (--release is default).

Our scripts have been updated to be able to run inside that new build environment.

Since everything runs inside a flatpak sandbox, gdb needs to be run from within the sandbox, the script exposes a way to do it
easily with the --gdb option:

$ webkit-flatpak --gdb [-m COREDUMPCTL MATCHES]

The Layout test GDBCrashLogGenerator has been taugth how to use that and is able to retrieve stacktrace as with the jhbuild based workflow.

[0] http://flatpak.org

  • Scripts/build-webkit:
  • Scripts/generate-jsc-bundle:

(main):

  • Scripts/run-gtk-tests:
  • Scripts/run-minibrowser:
  • Scripts/run-webdriver-tests:
  • Scripts/run-webkit-tests:
  • Scripts/run-wpe-tests:
  • Scripts/update-webkitgtk-libs:
  • Scripts/update-webkitwpe-libs:
  • Scripts/webkit-flatpak: Added.
  • Scripts/webkitdirs.pm:

(getJhbuildPath):
(getFlatpakPath):
(inFlatpakSandbox):
(runInFlatpak):
(runInFlatpakIfAvalaible):
(wrapperPrefixIfNeeded):
(shouldUseFlatpak):

  • Scripts/webkitpy/port/base.py:

(Port._path_to_apache):
(Port._is_flatpak):
(Port._apache_config_file_name_for_platform):
(Port._should_use_flatpak):
(Port):
(Port._in_flatpak_sandbox):
(Port._should_use_jhbuild):

  • Scripts/webkitpy/port/gtk.py:

(GtkPort.setup_environ_for_server):

  • Scripts/webkitpy/port/linux_get_crash_log.py:

(GDBCrashLogGenerator._get_trace_from_systemd):
(GDBCrashLogGenerator.generate_crash_log):

  • Scripts/webkitpy/port/wpe.py:

(WPEPort.setup_environ_for_server):

  • Scripts/webkitpy/w3c/wpt_runner.py:

(main):

  • flatpak/files/default.xkm: Added.
  • flatpak/files/httpd-autogen.sh: Added.
  • flatpak/flatpakutils.py: Added.

(Colors):
(Console):
(Console.message):
(remove_extension_points):
(remove_comments):
(remove_comments._replacer):
(load_manifest):
(expand_manifest):
(FlatpakObject):
(FlatpakObject.init):
(FlatpakObject.flatpak):
(FlatpakPackages):
(FlatpakPackages.init):
(FlatpakPackages.detect_packages):
(FlatpakPackages.
detect_packages.in):
(FlatpakPackages.detect_runtimes):
(FlatpakPackages.
detect_apps):
(FlatpakPackages.iter):
(FlatpakRepos):
(FlatpakRepos.init):
(FlatpakRepos.update):
(FlatpakRepos.add):
(FlatpakRepo):
(FlatpakRepo.init):
(FlatpakRepo.repo_file):
(FlatpakPackage):
(FlatpakPackage.init):
(FlatpakPackage.str):
(FlatpakPackage.is_installed):
(FlatpakPackage.install):
(FlatpakPackage.update):
(WebkitFlatpak):
(WebkitFlatpak.load_from_args):
(WebkitFlatpak.init):
(WebkitFlatpak.check_flatpak):
(WebkitFlatpak.check_flatpak.comparable_version):
(WebkitFlatpak.clean_args):
(WebkitFlatpak.run_in_sandbox):
(WebkitFlatpak.run):
(WebkitFlatpak.has_environment):
(WebkitFlatpak.setup_dev_env):
(WebkitFlatpak.install_all):
(WebkitFlatpak.run_gdb):
(WebkitFlatpak.update_all):
(is_sandboxed):
(run_in_sandbox_if_available):

  • flatpak/org.webkit.GTK.yaml: Added.
  • flatpak/org.webkit.WPE.yaml: Added.
  • flatpak/org.webkit.WebKit.yaml: Added.
  • flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch: Added.
  • flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch: Added.

LayoutTests:

  • http/conf/flatpak-httpd.conf: Added. Apache configuration file to be used inside flaptak.
Location:
trunk
Files:
16 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r233361 r233362  
     12018-06-29  Thibault Saunier  <tsaunier@igalia.com>
     2
     3        [GTK][WPE]: Add a way to setup our development environment inside flatpak
     4        https://bugs.webkit.org/show_bug.cgi?id=186771
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        * http/conf/flatpak-httpd.conf: Added. Apache configuration file to be used inside flaptak.
     9
    1102018-06-29  David Fenton  <david_fenton@apple.com>
    211
  • trunk/Tools/ChangeLog

    r233339 r233362  
     12018-06-29  Thibault Saunier  <tsaunier@igalia.com>
     2
     3        [GTK][WPE]: Add a way to setup our development environment inside flatpak
     4        https://bugs.webkit.org/show_bug.cgi?id=186771
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        This patch introduce a way to setup the development environment inside flatpak[0]
     9        removing the need for jhbuild when doing so. Anything needed to build/run minibrowser/ run
     10        layout tests is provided either but the org.gnome.Sdk runtime or built with flatpak-builder.
     11
     12        The workflow is very similar to the "jhbuild based" one except that you should use update-webkit$PORTNAME-flatpak instead
     13        of update-webkit$PORTNAME-libs and that script requires to specify a build configuration (--release is default).
     14
     15        Our scripts have been updated to be able to run inside that new build environment.
     16
     17        Since everything runs inside a flatpak sandbox, gdb needs to be run from within the sandbox, the script exposes a way to do it
     18        easily with the `--gdb` option:
     19
     20          $ webkit-flatpak --gdb [-m COREDUMPCTL MATCHES]
     21
     22        The Layout test `GDBCrashLogGenerator` has been taugth how to use that and is able to retrieve stacktrace as with the jhbuild based workflow.
     23
     24        [0] http://flatpak.org
     25
     26        * Scripts/build-webkit:
     27        * Scripts/generate-jsc-bundle:
     28        (main):
     29        * Scripts/run-gtk-tests:
     30        * Scripts/run-minibrowser:
     31        * Scripts/run-webdriver-tests:
     32        * Scripts/run-webkit-tests:
     33        * Scripts/run-wpe-tests:
     34        * Scripts/update-webkitgtk-libs:
     35        * Scripts/update-webkitwpe-libs:
     36        * Scripts/webkit-flatpak: Added.
     37        * Scripts/webkitdirs.pm:
     38        (getJhbuildPath):
     39        (getFlatpakPath):
     40        (inFlatpakSandbox):
     41        (runInFlatpak):
     42        (runInFlatpakIfAvalaible):
     43        (wrapperPrefixIfNeeded):
     44        (shouldUseFlatpak):
     45        * Scripts/webkitpy/port/base.py:
     46        (Port._path_to_apache):
     47        (Port._is_flatpak):
     48        (Port._apache_config_file_name_for_platform):
     49        (Port._should_use_flatpak):
     50        (Port):
     51        (Port._in_flatpak_sandbox):
     52        (Port._should_use_jhbuild):
     53        * Scripts/webkitpy/port/gtk.py:
     54        (GtkPort.setup_environ_for_server):
     55        * Scripts/webkitpy/port/linux_get_crash_log.py:
     56        (GDBCrashLogGenerator._get_trace_from_systemd):
     57        (GDBCrashLogGenerator.generate_crash_log):
     58        * Scripts/webkitpy/port/wpe.py:
     59        (WPEPort.setup_environ_for_server):
     60        * Scripts/webkitpy/w3c/wpt_runner.py:
     61        (main):
     62        * flatpak/files/default.xkm: Added.
     63        * flatpak/files/httpd-autogen.sh: Added.
     64        * flatpak/flatpakutils.py: Added.
     65        (Colors):
     66        (Console):
     67        (Console.message):
     68        (remove_extension_points):
     69        (remove_comments):
     70        (remove_comments._replacer):
     71        (load_manifest):
     72        (expand_manifest):
     73        (FlatpakObject):
     74        (FlatpakObject.__init__):
     75        (FlatpakObject.flatpak):
     76        (FlatpakPackages):
     77        (FlatpakPackages.__init__):
     78        (FlatpakPackages.__detect_packages):
     79        (FlatpakPackages.__detect_packages.in):
     80        (FlatpakPackages.__detect_runtimes):
     81        (FlatpakPackages.__detect_apps):
     82        (FlatpakPackages.__iter__):
     83        (FlatpakRepos):
     84        (FlatpakRepos.__init__):
     85        (FlatpakRepos.update):
     86        (FlatpakRepos.add):
     87        (FlatpakRepo):
     88        (FlatpakRepo.__init__):
     89        (FlatpakRepo.repo_file):
     90        (FlatpakPackage):
     91        (FlatpakPackage.__init__):
     92        (FlatpakPackage.__str__):
     93        (FlatpakPackage.is_installed):
     94        (FlatpakPackage.install):
     95        (FlatpakPackage.update):
     96        (WebkitFlatpak):
     97        (WebkitFlatpak.load_from_args):
     98        (WebkitFlatpak.__init__):
     99        (WebkitFlatpak.check_flatpak):
     100        (WebkitFlatpak.check_flatpak.comparable_version):
     101        (WebkitFlatpak.clean_args):
     102        (WebkitFlatpak.run_in_sandbox):
     103        (WebkitFlatpak.run):
     104        (WebkitFlatpak.has_environment):
     105        (WebkitFlatpak.setup_dev_env):
     106        (WebkitFlatpak.install_all):
     107        (WebkitFlatpak.run_gdb):
     108        (WebkitFlatpak.update_all):
     109        (is_sandboxed):
     110        (run_in_sandbox_if_available):
     111        * flatpak/org.webkit.GTK.yaml: Added.
     112        * flatpak/org.webkit.WPE.yaml: Added.
     113        * flatpak/org.webkit.WebKit.yaml: Added.
     114        * flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch: Added.
     115        * flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch: Added.
     116
    11172018-06-28  Wenson Hsieh  <wenson_hsieh@apple.com>
    2118
  • trunk/Tools/Scripts/build-webkit

    r232583 r233362  
    4949sub writeCongrats();
    5050
     51checkRequiredSystemConfig();
     52setConfiguration();
     53
     54if (shouldUseFlatpak()) {
     55    print "Building flatpak based environment\n";
     56
     57    runInFlatpak("/app/webkit/Tools/Scripts/build-webkit");
     58}
     59
    5160my $originalWorkingDirectory = getcwd();
    5261chdirWebKit();
     
    168177}
    169178
    170 checkRequiredSystemConfig();
    171 setConfiguration();
    172179
    173180my $productDir = productDir();
  • trunk/Tools/Scripts/generate-jsc-bundle

    r231256 r233362  
    3636
    3737top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
     38sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'flatpak'))
    3839sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'jhbuild'))
    3940import jhbuildutils
     41import flatpakutils
    4042
    4143
     
    230232    configuration = options.configuration.lower()
    231233    if platform == 'gtk':
    232         jhbuildutils.enter_jhbuild_environment_if_available(platform)
     234        flatpakutils.run_in_sandbox_if_available(sys.argv)
     235        if not flatpakutils.is_sandboxed():
     236            jhbuildutils.enter_jhbuild_environment_if_available("gtk")
    233237    else:
    234238        raise NotImplementedError('Unsupported platform')
  • trunk/Tools/Scripts/run-gtk-tests

    r232672 r233362  
    2626
    2727top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))
     28sys.path.insert(0, os.path.join(top_level_directory, "Tools", "flatpak"))
    2829sys.path.insert(0, os.path.join(top_level_directory, "Tools", "jhbuild"))
    2930sys.path.insert(0, os.path.join(top_level_directory, "Tools", "glib"))
    3031import common
    3132import jhbuildutils
     33import flatpakutils
    3234from api_test_runner import TestRunner, add_options
    3335
     
    125127
    126128if __name__ == "__main__":
    127     if not jhbuildutils.enter_jhbuild_environment_if_available("gtk"):
    128         print "***"
    129         print "*** Warning: jhbuild environment not present. Run update-webkitgtk-libs before build-webkit to ensure proper testing."
    130         print "***"
     129    flatpakutils.run_in_sandbox_if_available(sys.argv)
     130    if not flatpakutils.is_sandboxed() and not jhbuildutils.enter_jhbuild_environment_if_available("gtk"):
     131        print '***'
     132        print '*** Warning: jhbuild environment not present and not running in flatpak.'
     133        print '*** Run update-webkitgtk-libs or update-webkitgtk-flatpak before build-webkit to ensure proper testing..'
     134        print '***'
    131135
    132136    option_parser = optparse.OptionParser(usage='usage: %prog [options] [test...]')
    133     add_options(option_parser);
     137    add_options(option_parser)
    134138    option_parser.add_option('--display-server', choices=['xvfb', 'xorg', 'weston', 'wayland'], default='xvfb',
    135139                             help='"xvfb": Use a virtualized X11 server. "xorg": Use the current X11 session. '
  • trunk/Tools/Scripts/run-minibrowser

    r232670 r233362  
    4646
    4747if (isGtk() || isWPE()) {
     48    runInFlatpakIfAvalaible("/app/webkit/Tools/Scripts/run-minibrowser");
     49
    4850    # Check to see that all the frameworks are built.
    4951    checkFrameworks();
  • trunk/Tools/Scripts/run-webdriver-tests

    r232670 r233362  
    6767if port.name() in ['gtk', 'wpe']:
    6868    import os
     69
    6970    top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
    70     sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'jhbuild'))
    71     import jhbuildutils
     71    sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'flatpak'))
     72    import flatpakutils
     73    flatpakutils.run_in_sandbox_if_available(sys.argv)
     74    if not flatpakutils.is_sandboxed():
     75        sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'jhbuild'))
     76        import jhbuildutils
    7277
    73     if not jhbuildutils.enter_jhbuild_environment_if_available(port.name()):
    74         print '***'
    75         print '*** Warning: jhbuild environment not present. Run update-webkitgtk-libs before build-webkit to ensure proper testing.'
    76         print '***'
     78        if not jhbuildutils.enter_jhbuild_environment_if_available(port.name()):
     79            print '***'
     80            print '*** Warning: jhbuild environment not present and not running in flatpak.'
     81            print '*** Run update-webkitgtk-libs or update-webkitgtk-flatpak before build-webkit to ensure proper testing..'
     82            print '***'
    7783
    7884port._display_server = options.display_server
  • trunk/Tools/Scripts/run-webkit-tests

    r161509 r233362  
    2929
    3030"""Wrapper around webkitpy/layout_tests/run_webkit_tests.py"""
     31import os
     32import sys
     33
    3134from webkitpy.common import multiprocessing_bootstrap
    3235
     36top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
     37sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'flatpak'))
     38import flatpakutils
     39flatpakutils.run_in_sandbox_if_available(sys.argv)
     40
    3341multiprocessing_bootstrap.run('webkitpy', 'layout_tests', 'run_webkit_tests.py')
  • trunk/Tools/Scripts/run-wpe-tests

    r232672 r233362  
    2525top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))
    2626sys.path.insert(0, os.path.join(top_level_directory, "Tools", "jhbuild"))
     27sys.path.insert(0, os.path.join(top_level_directory, "Tools", "flatpak"))
    2728sys.path.insert(0, os.path.join(top_level_directory, "Tools", "glib"))
    2829import jhbuildutils
     30import flatpakutils
    2931from api_test_runner import TestRunner, add_options
    3032
     
    4749
    4850if __name__ == "__main__":
    49     if not jhbuildutils.enter_jhbuild_environment_if_available("wpe"):
    50         print "***"
    51         print "*** Warning: jhbuild environment not present. Run update-webkitgtk-libs before build-webkit to ensure proper testing."
    52         print "***"
     51    flatpakutils.run_in_sandbox_if_available(sys.argv)
     52    if not flatpakutils.is_sandboxed() and not jhbuildutils.enter_jhbuild_environment_if_available("wpe"):
     53        print '***'
     54        print '*** Warning: jhbuild environment not present and not running in flatpak.'
     55        print '*** Run update-webkitgtk-libs or update-webkitgtk-flatpak before build-webkit to ensure proper testing..'
     56        print '***'
    5357
    5458    option_parser = optparse.OptionParser(usage='usage: %prog [options] [test...]')
  • trunk/Tools/Scripts/webkitdirs.pm

    r233303 r233362  
    16821682    my $relativeScriptsPath = relativeScriptsDir();
    16831683    if (isGtk() || isWPE()) {
     1684        if (inFlatpakSandbox()) {
     1685            return "Tools/Scripts/run-minibrowser";
     1686        }
    16841687        return "$relativeScriptsPath/run-minibrowser";
    16851688    } elsif (isAppleWebKit()) {
     
    19951998        push(@jhbuildPath, "DependenciesWPE");
    19961999    } else {
    1997         die "Cannot get JHBuild path for platform that isn't GTK+.\n";
     2000        die "Cannot get JHBuild path for platform that isn't GTK+ or WPE.\n";
    19982001    }
    19992002    return File::Spec->catdir(@jhbuildPath);
     2003}
     2004
     2005sub getFlatpakPath()
     2006{
     2007    my @flatpakBuildPath = File::Spec->splitdir(baseProductDir());
     2008    if (isGtk()) {
     2009        push(@flatpakBuildPath, "GTK");
     2010    } elsif (isWPE()) {
     2011        push(@flatpakBuildPath, "WPE");
     2012    } else {
     2013        die "Cannot get Flatpak path for platform that isn't GTK+ or WPE.\n";
     2014    }
     2015    my @configuration = configuration();
     2016    push(@flatpakBuildPath, "FlatpakTree$configuration");
     2017
     2018    return File::Spec->catdir(@flatpakBuildPath);
    20002019}
    20012020
     
    20222041}
    20232042
     2043sub inFlatpakSandbox()
     2044{
     2045    if (-f "/usr/manifest.json") {
     2046        return 1;
     2047    }
     2048
     2049    return 0;
     2050}
     2051
     2052sub runInFlatpak(@)
     2053{
     2054    my @arg = @_;
     2055    my @command = (File::Spec->catfile(sourceDir(), "Tools", "Scripts", "webkit-flatpak"));
     2056    exec @command, argumentsForConfiguration(), "--command", @_, argumentsForConfiguration(), @ARGV or die;
     2057}
     2058
     2059sub runInFlatpakIfAvalaible(@)
     2060{
     2061    if (inFlatpakSandbox()) {
     2062        return 0;
     2063    }
     2064
     2065    my @command = (File::Spec->catfile(sourceDir(), "Tools", "Scripts", "webkit-flatpak"));
     2066    if (system(@command, "--avalaible") != 0) {
     2067        return 0;
     2068    }
     2069
     2070    if (! -e getFlatpakPath()) {
     2071        return 0;
     2072    }
     2073
     2074    runInFlatpak(@_)
     2075}
     2076
    20242077sub wrapperPrefixIfNeeded()
    20252078{
     2079
    20262080    if (isAnyWindows() || isJSCOnly()) {
    20272081        return ();
     
    20482102{
    20492103    return ((isGtk() or isWPE()) and -e getJhbuildPath());
     2104}
     2105
     2106sub shouldUseFlatpak()
     2107{
     2108    return ((isGtk() or isWPE()) and ! inFlatpakSandbox() and -e getFlatpakPath());
    20502109}
    20512110
  • trunk/Tools/Scripts/webkitpy/port/base.py

    r232746 r233362  
    12261226        # The Apache binary path can vary depending on OS and distribution
    12271227        # See http://wiki.apache.org/httpd/DistrosDefaultLayout
    1228         for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]:
     1228        for path in ["/usr/sbin/httpd", "/usr/sbin/apache2", "/app/bin/httpd"]:
    12291229            if self._filesystem.exists(path):
    12301230                return path
     
    12511251    def _is_arch_based(self):
    12521252        return self._filesystem.exists('/etc/arch-release')
     1253
     1254    def _is_flatpak(self):
     1255        return self._filesystem.exists('/usr/manifest.json')
    12531256
    12541257    def _apache_version(self):
     
    12891292            if self._is_arch_based():
    12901293                return 'archlinux-httpd.conf'
     1294            if self._is_flatpak():
     1295                return 'flatpak-httpd.conf'
    12911296        # All platforms use apache2 except for CYGWIN (and Mac OS X Tiger and prior, which we no longer support).
    12921297        return 'apache' + self._apache_version() + '-httpd.conf'
     
    14411446        return True
    14421447
     1448    def _should_use_flatpak(self):
     1449        suffix = ""
     1450        if self.port_name:
     1451            suffix = self.port_name.upper()
     1452        return self._filesystem.exists(self.path_from_webkit_base('WebKitBuild', suffix, "FlatpakTree"))
     1453
     1454    def _in_flatpak_sandbox(self):
     1455        return os.path.exists("/usr/manifest.json")
     1456
    14431457    def _should_use_jhbuild(self):
     1458        if self._in_flatpak_sandbox():
     1459            return False
     1460
    14441461        suffix = ""
    14451462        if self.port_name:
  • trunk/Tools/Scripts/webkitpy/port/gtk.py

    r232786 r233362  
    123123        environment['TEST_RUNNER_TEST_PLUGIN_PATH'] = self._build_path('lib', 'plugins')
    124124        self._copy_value_from_environ_if_set(environment, 'WEBKIT_OUTPUTDIR')
     125        self._copy_value_from_environ_if_set(environment, 'WEBKIT_TOP_LEVEL')
    125126        self._copy_value_from_environ_if_set(environment, 'USE_PLAYBIN3')
    126127        self._copy_value_from_environ_if_set(environment, 'GST_DEBUG')
     
    129130
    130131        # Configure the software libgl renderer if jhbuild ready and we test inside a virtualized window system
    131         if self._driver_class() in [XvfbDriver, WestonDriver] and self._should_use_jhbuild():
    132             llvmpipe_libgl_path = self.host.executive.run_command(self._jhbuild_wrapper + ['printenv', 'LLVMPIPE_LIBGL_PATH'],
    133                                                                   ignore_errors=True).strip()
     132        if self._driver_class() in [XvfbDriver, WestonDriver] and (self._should_use_jhbuild() or self._is_flatpak()):
     133            if self._should_use_jhbuild():
     134                llvmpipe_libgl_path = self.host.executive.run_command(self._jhbuild_wrapper + ['printenv', 'LLVMPIPE_LIBGL_PATH'],
     135                                                                    ignore_errors=True).strip()
     136            else:  # in flatpak
     137                llvmpipe_libgl_path = "/app/softGL/lib"
     138
    134139            dri_libgl_path = os.path.join(llvmpipe_libgl_path, "dri")
    135140            if os.path.exists(os.path.join(llvmpipe_libgl_path, "libGL.so")) and os.path.exists(os.path.join(dri_libgl_path, "swrast_dri.so")):
     
    143148                    environment['LD_LIBRARY_PATH'] += ':%s' % os.environ.get('LD_LIBRARY_PATH')
    144149            else:
    145                 _log.warning("Can't find Gallium llvmpipe driver. Try to run update-webkitgtk-libs")
     150                _log.warning("Can't find Gallium llvmpipe driver. Try to run update-webkitgtk-libs or update-webkitgtk-flatpak")
    146151        if self.get_option("leaks"):
    147152            # Turn off GLib memory optimisations https://wiki.gnome.org/Valgrind.
  • trunk/Tools/Scripts/webkitpy/port/linux_get_crash_log.py

    r232786 r233362  
    5959        return (stdout.decode('utf8', 'ignore'), errors)
    6060
    61     def _get_trace_from_systemd(self, pid):
     61    def _get_trace_from_systemd(self, coredumpctl, pid):
    6262        # Letting up to 5 seconds for the backtrace to be generated on the systemd side
    6363        for try_number in range(5):
     
    6767
    6868            try:
    69                 info = self._executive.run_command(['coredumpctl', 'info', str(pid)], return_stderr=True)
     69                info = self._executive.run_command(coredumpctl + ['info', "--since=" + time.strftime("%a %Y-%m-%d %H:%M:%S %Z", time.localtime(self.newer_than))],
     70                    return_stderr=True)
    7071            except ScriptError, OSError:
    7172                continue
    7273
    73             if self.newer_than:
    74                 found_newer = False
    75                 # Coredumpctl will use the latest core dump with the specified PID
    76                 # assume it is the right one.
    77                 for timestamp in re.findall(r'Timestamp:.*(\d{4}-\d+-\d+ \d+:\d+:\d+)', info):
    78                     date = time.mktime(datetime.datetime.strptime(timestamp, "%Y-%m-%d %H:%M:%S").timetuple())
    79                     if date > self.newer_than:
    80                         found_newer = True
    81                         break
     74            found_newer = False
     75            # Coredumpctl will use the latest core dump with the specified PID
     76            # assume it is the right one.
     77            pids = re.findall(r'PID: (\d+) \(.*\)', info)
     78            if not pids:
     79                print(self.name + "\n" + info)
     80                continue
    8281
    83                 if not found_newer:
    84                     continue
     82            pid = pids[0]
    8583
    8684            temp_file = tempfile.NamedTemporaryFile()
    87             if self._executive.run_command(['coredumpctl', 'dump', pid, '--output', temp_file.name], return_exit_code=True):
     85            if self._executive.run_command(coredumpctl + ['dump', pid, '--output', temp_file.name], return_exit_code=True):
    8886                continue
    8987
     
    106104
    107105        # Poor man which, ignore any failure.
    108         try:
    109             coredumpctl = not self._executive.run_command(['coredumpctl', '--version'], return_exit_code=True)
    110         except:
    111             coredumpctl = False
     106        for coredumpctl in [['coredumpctl'], ['flatpak-spawn', '--host', 'coredumpctl'], []]:
     107            try:
     108                if not self._executive.run_command(coredumpctl, return_exit_code=True):
     109                    break
     110            except:
     111                continue
    112112
    113113        if log_directory:
     
    120120                    crash_log, errors = self._get_gdb_output(coredump_path)
    121121        elif coredumpctl:
    122             crash_log, errors = self._get_trace_from_systemd(pid_representation)
     122            crash_log, errors = self._get_trace_from_systemd(coredumpctl, pid_representation)
    123123
    124124        stderr_lines = errors + str(stderr or '<empty>').decode('utf8', 'ignore').splitlines()
  • trunk/Tools/Scripts/webkitpy/port/wpe.py

    r232786 r233362  
    7777        environment['TEST_RUNNER_TEST_PLUGIN_PATH'] = self._build_path('lib', 'plugins')
    7878        environment['WEBKIT_EXEC_PATH'] = self._build_path('bin')
     79        self._copy_value_from_environ_if_set(environment, 'WEBKIT_OUTPUTDIR')
     80        self._copy_value_from_environ_if_set(environment, 'WEBKIT_TOP_LEVEL')
     81        self._copy_value_from_environ_if_set(environment, 'USE_PLAYBIN3')
     82        self._copy_value_from_environ_if_set(environment, 'GST_DEBUG')
     83        self._copy_value_from_environ_if_set(environment, 'GST_DEBUG_DUMP_DOT_DIR')
     84        self._copy_value_from_environ_if_set(environment, 'GST_DEBUG_FILE')
    7985        return environment
    8086
  • trunk/Tools/Scripts/webkitpy/w3c/wpt_runner.py

    r232930 r233362  
    5454    if port.name() in ['gtk', 'wpe']:
    5555        filesystem = host.filesystem
     56
    5657        top_level_directory = filesystem.normpath(filesystem.join(filesystem.dirname(__file__), '..', '..', '..', '..'))
     58        sys.path.insert(0, filesystem.join(top_level_directory, 'Tools', 'flatpak'))
     59        import flatpakutils
     60        flatpakutils.run_in_sandbox_if_available(sys.argv)
     61
    5762        sys.path.insert(0, filesystem.join(top_level_directory, 'Tools', 'jhbuild'))
    5863        import jhbuildutils
    5964
    60         if not jhbuildutils.enter_jhbuild_environment_if_available(port.name()):
     65        if flatpakutils.is_sandboxed() and not jhbuildutils.enter_jhbuild_environment_if_available(port.name()):
    6166            _log.warning('jhbuild environment not present. Run update-webkitgtk-libs before build-webkit to ensure proper testing.')
    6267
Note: See TracChangeset for help on using the changeset viewer.