RESOLVED FIXED 117275
[GTK][EFL] Use function jhbuildWrapperPrefixIfNeeded to run launcher
https://bugs.webkit.org/show_bug.cgi?id=117275
Summary [GTK][EFL] Use function jhbuildWrapperPrefixIfNeeded to run launcher
Diego Pino
Reported 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.
Attachments
Patch (1.64 KB, patch)
2013-06-05 13:42 PDT, Diego Pino
mrobinson: review+
cgarcia: commit-queue-
Patch (2.32 KB, patch)
2014-01-07 04:20 PST, Alberto Garcia
no flags
Patch (2.41 KB, patch)
2014-01-07 04:30 PST, Alberto Garcia
no flags
Patch (2.32 KB, patch)
2014-01-07 04:31 PST, Alberto Garcia
cgarcia: review+
Diego Pino
Comment 1 2013-06-05 13:42:53 PDT
Martin Robinson
Comment 2 2013-06-05 15:40:32 PDT
Comment on attachment 203879 [details] Patch Nice.
Carlos Garcia Campos
Comment 3 2013-06-05 23:51:19 PDT
*** Bug 116095 has been marked as a duplicate of this bug. ***
Carlos Garcia Campos
Comment 4 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.
Diego Pino
Comment 5 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.
Carlos Garcia Campos
Comment 6 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.
Diego Pino
Comment 7 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?
Carlos Garcia Campos
Comment 8 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.
Alberto Garcia
Comment 9 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.
Alberto Garcia
Comment 10 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.
Alberto Garcia
Comment 11 2014-01-07 04:31:13 PST
Created attachment 220512 [details] Patch Today is not my day. This is the correct one.
Carlos Garcia Campos
Comment 12 2014-01-07 04:37:16 PST
Comment on attachment 220512 [details] Patch Thank you very much!
Alberto Garcia
Comment 13 2014-01-07 04:48:34 PST
Note You need to log in before you can comment on or make changes to this bug.