<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>227492</bug_id>
          
          <creation_ts>2021-06-29 10:41:13 -0700</creation_ts>
          <short_desc>[GTK][WPE] built-product-archive not running in SDK runtime</short_desc>
          <delta_ts>2021-06-30 04:31:50 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philippe Normand">pnormand</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>clopez</cc>
    
    <cc>dpino</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1773454</commentid>
    <comment_count>0</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2021-06-29 10:41:13 -0700</bug_when>
    <thetext>How can this work without running in the SDK runtime?

build-webkit ends up bind-mounting WebKitBuild/GTK/Release as WebKitBuild/Release in the runtime. But built-product-archive runs on the host and uses what is in WebKitBuild/Release... So is the zip file containing some old build from the jhbuild times?

I have a patch locally fixing this but first I want to confirm if there&apos;s an issue or something I missed with the current setup.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1773531</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2021-06-29 14:04:05 -0700</bug_when>
    <thetext>This is how this works:

* built-product-archive gets the build directory on the variable _configurationBuildDirectory after calling the function webkitBuildDirectoryForConfigurationAndPlatform(configuration, platform, fullPlatform)

* This function ends calling the following perl script:
perl Tools/Scripts/webkit-build-directory --gtk --release --configuration

Which on the case of a flatpak-enabled build ends returning this:
/home/igalia/clopez/webkit/webkit-flatpak/WebKitBuild/GTK/Release



It took me a while to discover this, is far from obvious. Seems this built-product-archive script would benefit from a refactoring and a bit of love, like for example stop using global variables on it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1773535</commentid>
    <comment_count>2</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2021-06-29 14:06:02 -0700</bug_when>
    <thetext>That&apos;s the thing! Neither webkit-build-directory nor built-product-archive run from the SDK runtime!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1773538</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2021-06-29 14:08:37 -0700</bug_when>
    <thetext>(In reply to Philippe Normand from comment #2)
&gt; That&apos;s the thing! Neither webkit-build-directory nor built-product-archive
&gt; run from the SDK runtime!

That is right, but they don&apos;t need to do that AFAIK.

They only need to get the right build directory.

What built-product-archive does is simply to create a zip file with the contents of the WebKitBuild/GTK/Release directory
It just assumes the zip command is installed on the host (rather than in the container of the flatpak/SDK)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1773539</commentid>
    <comment_count>4</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2021-06-29 14:09:05 -0700</bug_when>
    <thetext>Ah, forgot that webkit-build-directory pulls in webkitdirs.pm which is flatpak-aware(?)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>