[Flatpak] HTTP layout tests broken due to missing CGI.pm in the sandbox
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jul 2018 12:45:03 +0000 (12:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jul 2018 12:45:03 +0000 (12:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187384

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-07-09
Reviewed by Philippe Normand.

And make it usable inside the sandbox even when
perl is launched "tainted" (as the PERL5LIB won't
work otherwise).

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox):
* flatpak/org.webkit.WebKit.yaml:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233639 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/flatpak/flatpakutils.py
Tools/flatpak/org.webkit.WebKit.yaml

index 273c296..bd9c304 100644 (file)
@@ -1,5 +1,20 @@
 2018-07-09  Thibault Saunier  <tsaunier@igalia.com>
 
+        [Flatpak] HTTP layout tests broken due to missing CGI.pm in the sandbox
+        https://bugs.webkit.org/show_bug.cgi?id=187384
+
+        Reviewed by Philippe Normand.
+
+        And make it usable inside the sandbox even when
+        perl is launched "tainted" (as the PERL5LIB won't
+        work otherwise).
+
+        * flatpak/flatpakutils.py:
+        (WebkitFlatpak.run_in_sandbox):
+        * flatpak/org.webkit.WebKit.yaml:
+
+2018-07-09  Thibault Saunier  <tsaunier@igalia.com>
+
         [WPE][GTK] Mount /dev/shm on /run/shm in sandbox
         https://bugs.webkit.org/show_bug.cgi?id=187400
 
index d26926c..12006ae 100644 (file)
@@ -654,6 +654,9 @@ class WebkitFlatpak:
         with tempfile.NamedTemporaryFile(mode="w") as tmpscript:
             flatpak_command = ["flatpak", "build", "--die-with-parent",
                 "--bind-mount=/run/shm=/dev/shm",
+                # Workaround for https://webkit.org/b/187384 to have our own perl modules usable inside the sandbox
+                # as setting the PERL5LIB envvar won't work inside apache (and for scripts using `perl -T``).
+                "--bind-mount=/etc/perl=%s" % os.path.join(self.flatpak_build_path, "files/lib/perl"),
                 "--bind-mount=/run/host/%s=%s" % (tempfile.gettempdir(), tempfile.gettempdir()),
                 "--bind-mount=%s=%s" % (self.sandbox_source_root, self.source_root),
                 # We mount WebKitBuild/PORTNAME/BuildType to /app/webkit/WebKitBuild/BuildType
index d834b11..874f566 100644 (file)
@@ -201,5 +201,16 @@ modules:
     config-opts:
       - --disable-doc
 
+  - name: perl-cgi-pm
+    buildsystem: simple
+    build-commands:
+      - perl Makefile.PL PREFIX=/app LIB=/app/lib/perl/
+      - make install
+    sources:
+      - type: archive
+        url: https://cpan.metacpan.org/authors/id/L/LE/LEEJO/CGI-4.38.tar.gz
+        sha256: 8c58f4a529bb92a914b22b7e64c5e31185c9854a4070a6dfad44fe5cc248e7d4
+
+
   # Port specific components.
   - %(PORTNAME)s.yaml