Bug 227492

Summary: [GTK][WPE] built-product-archive not running in SDK runtime
Product: WebKit Reporter: Philippe Normand <pnormand>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: clopez, dpino
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Philippe Normand 2021-06-29 10:41:13 PDT
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's an issue or something I missed with the current setup.
Comment 1 Carlos Alberto Lopez Perez 2021-06-29 14:04:05 PDT
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.
Comment 2 Philippe Normand 2021-06-29 14:06:02 PDT
That's the thing! Neither webkit-build-directory nor built-product-archive run from the SDK runtime!
Comment 3 Carlos Alberto Lopez Perez 2021-06-29 14:08:37 PDT
(In reply to Philippe Normand from comment #2)
> That's the thing! Neither webkit-build-directory nor built-product-archive
> run from the SDK runtime!

That is right, but they don'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)
Comment 4 Philippe Normand 2021-06-29 14:09:05 PDT
Ah, forgot that webkit-build-directory pulls in webkitdirs.pm which is flatpak-aware(?)