Bug 117275 - [GTK][EFL] Use function jhbuildWrapperPrefixIfNeeded to run launcher
Summary: [GTK][EFL] Use function jhbuildWrapperPrefixIfNeeded to run launcher
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
: 116095 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-06-05 13:35 PDT by Diego Pino
Modified: 2014-01-07 04:48 PST (History)
4 users (show)

See Also:


Attachments
Patch (1.64 KB, patch)
2013-06-05 13:42 PDT, Diego Pino
mrobinson: review+
cgarcia: commit-queue-
Details | Formatted Diff | Diff
Patch (2.32 KB, patch)
2014-01-07 04:20 PST, Alberto Garcia
no flags Details | Formatted Diff | Diff
Patch (2.41 KB, patch)
2014-01-07 04:30 PST, Alberto Garcia
no flags Details | Formatted Diff | Diff
Patch (2.32 KB, patch)
2014-01-07 04:31 PST, Alberto Garcia
cgarcia: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Pino 2013-06-05 13:35:27 PDT
The code that runs the jhbuild-wrapper in './Tools/Scripts/run-launcher' composes the path and parameters by itself. There's a function, jhbuildWrapperPrefixIfNeeded(), in the Webkitdirs module that does that.
Comment 1 Diego Pino 2013-06-05 13:42:53 PDT
Created attachment 203879 [details]
Patch
Comment 2 Martin Robinson 2013-06-05 15:40:32 PDT
Comment on attachment 203879 [details]
Patch

Nice.
Comment 3 Carlos Garcia Campos 2013-06-05 23:51:19 PDT
*** Bug 116095 has been marked as a duplicate of this bug. ***
Comment 4 Carlos Garcia Campos 2013-06-06 00:08:03 PDT
Comment on attachment 203879 [details]
Patch

This patch doesn't work when not using jhbuild, see:

$ Tools/Scripts/run-launcher --gtk
Starting webkit launcher.
Use of uninitialized value $launcherPath in exec at Tools/Scripts/run-launcher line 87.
Can't exec "": No existe el archivo o el directorio at Tools/Scripts/run-launcher line 87.
Died at Tools/Scripts/run-launcher line 87.
Comment 5 Diego Pino 2013-06-06 00:35:59 PDT
OK, I think the reason is because the function jhbuildWrapperPrefixIfNeeded() tests first if the jhbuildPath exists. If not, returns an empty path.

What I don't understand is that running the script using jhbuildWrapperPrefixIfNeeded() and not using it builds the same path:

$ ./Tools/Scripts/run-launcher --gtk
without using jhbuildWrapperPrefixIfNeeded: /home/dpino/workspace/WebKit/Tools/jhbuild/jhbuild-wrapper
using jhbuildWrapperPrefixIfNeeded: /home/dpino/workspace/WebKit/Tools/jhbuild/jhbuild-wrapper

I could remove the checking of "jhbuildPath exists" in jhbuildWrapperPrefixIfNeeded() but that seems wrong.
Comment 6 Carlos Garcia Campos 2013-06-12 00:27:14 PDT
(In reply to comment #5)
> OK, I think the reason is because the function jhbuildWrapperPrefixIfNeeded() tests first if the jhbuildPath exists. If not, returns an empty path.

In case of empty path we need to use the launcher path directly.
Comment 7 Diego Pino 2013-06-12 01:28:04 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > OK, I think the reason is because the function jhbuildWrapperPrefixIfNeeded() tests first if the jhbuildPath exists. If not, returns an empty path.
> 
> In case of empty path we need to use the launcher path directly.

OK, so regardless the path is empty or not, it seems the launcher path is always the same. If that's the case what I could do is to add a buildLauncherPath() method to webkitdirs.pm and make the function jhbuildWrapperPrefixIfNeeded() to use buildLauncherPath() if the path is not empty. The patch proposed will use buildLauncherPath() instead of jhbuildWrapperPrefixIfNeeded(). 

What do you think?
Comment 8 Carlos Garcia Campos 2013-06-12 02:26:09 PDT
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > OK, I think the reason is because the function jhbuildWrapperPrefixIfNeeded() tests first if the jhbuildPath exists. If not, returns an empty path.
> > 
> > In case of empty path we need to use the launcher path directly.
> 
> OK, so regardless the path is empty or not, it seems the launcher path is always the same. If that's the case what I could do is to add a buildLauncherPath() method to webkitdirs.pm and make the function jhbuildWrapperPrefixIfNeeded() to use buildLauncherPath() if the path is not empty. The patch proposed will use buildLauncherPath() instead of jhbuildWrapperPrefixIfNeeded(). 
> 
> What do you think?

I don't think so, jhbuildWrapperPrefixIfNeeded() return the jhbuild prefix if needed. So we need to build the launcher path, Programs/GtkLauncher, for example, and if there's a jhbuild prefix, prepend it so what you run in the end is jhbuild run Programs/GtkLauncher and if there's not jhbuild prefix you run Programs/GtkLauncher directly.
Comment 9 Alberto Garcia 2014-01-07 04:20:45 PST
Created attachment 220510 [details]
Patch

(In reply to comment #5)
> OK, I think the reason is because the function
> jhbuildWrapperPrefixIfNeeded() tests first if the jhbuildPath
> exists. If not, returns an empty path.

That function returns an empty list, so when do you

($launcherPath, my @args) = jhbuildWrapperPrefixIfNeeded();

you're turning $launcherPath into an undefined variable, which you
then are trying to exec.

I reworked the script a bit, now there's a scalar variable for the
launcher command, an array for the jhbuild wrapper and its options and
@ARGV, with the command-line parameters set by the user, which I
decided to leave untouched.

Hope it's a bit clearer now.
Comment 10 Alberto Garcia 2014-01-07 04:30:03 PST
Created attachment 220511 [details]
Patch

There was actually a duplicate variable in that script, I updated the
patch to remove it as well.
Comment 11 Alberto Garcia 2014-01-07 04:31:13 PST
Created attachment 220512 [details]
Patch

Today is not my day. This is the correct one.
Comment 12 Carlos Garcia Campos 2014-01-07 04:37:16 PST
Comment on attachment 220512 [details]
Patch

Thank you very much!
Comment 13 Alberto Garcia 2014-01-07 04:48:34 PST
Committed r161419: <http://trac.webkit.org/changeset/161419>