Bug 53590 - Can't exec "WebKit/Tools/Scripts/print-vse-failure-logs"
Summary: Can't exec "WebKit/Tools/Scripts/print-vse-failure-logs"
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 53591
  Show dependency treegraph
 
Reported: 2011-02-02 06:35 PST by A. Farber
Modified: 2011-03-15 23:01 PDT (History)
7 users (show)

See Also:


Attachments
changed WebKit/Tools/Scripts/webkitdirs.pm , 1 line added (72), 1 line changed (975). (60.95 KB, patch)
2011-02-19 10:21 PST, Felipe
abarth: review-
Details | Formatted Diff | Diff
This is the patch (733 bytes, patch)
2011-02-22 16:26 PST, Felipe
eric: review-
Details | Formatted Diff | Diff
snapshot of the failed builds (1.52 MB, image/bmp)
2011-03-10 22:53 PST, gecwebkit
no flags Details
patch (1.30 KB, patch)
2011-03-15 07:09 PDT, Felipe
aroben: review-
Details | Formatted Diff | Diff
patch (1.18 KB, patch)
2011-03-15 17:39 PDT, Felipe
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description A. Farber 2011-02-02 06:35:43 PST
Hello,

I've followed and re-checked the steps for building with
VC++ 2005 Express at http://webkit.org/building/tools.html
and have run  ~/WebKit/Tools/Scripts/update-webkit
numerous times at my both WinXP SP3 PCs,
but the builds always fail with:

afarber@AFARBER-DT:~> ./WebKit/Tools/Scripts/build-webkit
WebKitSupportLibrary is up-to-date.
Building results into: /home/afarber/WebKit/WebKitBuild
WEBKITOUTPUTDIR is set to: C:\cygwin\home\afarber\WebKit\WebKitBuild
WEBKITLIBRARIESDIR is set to: C:\cygwin\home\afarber\WebKit\WebKitLibraries\win
/cygdrive/c/Program Files/Microsoft Visual Studio
8/Common7/IDE/VCExpress.exe win\WebKit.vcproj\WebKit.sln /build
Release
Can't exec "WebKit/Tools/Scripts/print-vse-failure-logs":
No such file or directory at ./WebKit/Tools/Scripts/build-webkit line 573.
===== BUILD FAILED ======
Please ensure you have run WebKit/Tools/Scripts/update-webkit to
install dependencies.
You can view build errors by checking the BuildLog.htm files located at:
/home/afarber/WebKit/WebKitBuild/obj/<project>/<config>.

To workaround the logging error above I've just replaced
the path by hardcoded one in build-webkit script:

           #system(File::Spec->catfile($scriptDir, "print-vse-failure-logs"));
           system("/home/afarber/WebKit/Tools/Scripts/print-vse-failure-logs");

Regards
Alex
Comment 1 Adam Roben (:aroben) 2011-02-02 07:09:22 PST
Maybe we should just use an absolute path instead of a relative path.
Comment 2 Felipe 2011-02-18 17:34:31 PST
The error seems to occur in module webkitdirs.pm, function relativeScriptsDir, line 974:

my $scriptDir = File::Spec->catpath("", File::Spec->abs2rel(dirname($0), getcwd()), "");

Function 'dirname' already returns a relative path (at least in Cygwin), but this path is relative to the "first path", from that the user calls build-webkit. Functions like 'chdir' don't change this path.

E.g., if you run build-webkit from ~ (home), 'dirname($0)' (from webkitdirs) will return 'WebKit/Tools/Scripts' (path relative to ~). But 'getcwd()' will return '/home/<user>/WebKit', not '/home/<user>', because working directory has changed before by 'chdirWebKit()' (in build-webkit, from webkitdirs).
Comment 3 Felipe 2011-02-19 06:17:35 PST
Na, Na. The bug, in true, is the use of $0 in relativeScriptsDir. xD
Variable $0 doesn't change when working directory is changed.
I suggest to declare an $absoluteScriptsDir in webkitdirs.pm, that will be used by relativeScriptsDir :

my $absoluteScriptsDir = File::Spec->rel2abs(dirname($0), getcwd());

sub relativeScriptsDir()
{
    my $scriptDir = File::Spec->catpath("", File::Spec->abs2rel($absoluteScriptsDir, getcwd()), "");
    if ($scriptDir eq "") {
        $scriptDir = ".";
    }
    return $scriptDir;
}

I tested it and it seems ok. :)
Comment 4 Felipe 2011-02-19 10:21:27 PST
Created attachment 83079 [details]
changed WebKit/Tools/Scripts/webkitdirs.pm , 1 line added (72), 1 line changed (975).
Comment 5 WebKit Review Bot 2011-02-19 10:24:13 PST
Attachment 83079 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files']" exit_code: 1

Total errors found: 0 in 0 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Adam Roben (:aroben) 2011-02-21 07:58:45 PST
Felipe, thanks for working on the issue you're seeing. Please file a new bug for your issue, since it is quite different from the one originally reported here by A. Farber.
Comment 7 Adam Barth 2011-02-21 12:36:00 PST
Comment on attachment 83079 [details]
changed WebKit/Tools/Scripts/webkitdirs.pm , 1 line added (72), 1 line changed (975).

This does not appear to be a patch.  Please create a patch using ./Tools/Script/svn-create-patch.  Also, you'll need to write a ChangeLog, as described in http://www.webkit.org/coding/contributing.html
Comment 8 Felipe 2011-02-22 16:26:31 PST
Created attachment 83410 [details]
This is the patch

Sorry, I was not attempt in how to create a patch.
This is the desired patch, and I checked old as obsolete.
Comment 9 Adam Roben (:aroben) 2011-02-23 07:57:23 PST
Comment on attachment 83410 [details]
This is the patch

View in context: https://bugs.webkit.org/attachment.cgi?id=83410&action=review

> Tools/Scripts/webkitdirs.pm:72
> +my $absoluteScriptsDir = File::Spec->rel2abs(dirname($0), getcwd());

I don't think the getcwd() is needed.

Maybe it would be better to use $FindBin::Bin instead?
Comment 10 Eric Seidel (no email) 2011-02-24 02:55:51 PST
Comment on attachment 83410 [details]
This is the patch

Needs a ChangeLog.  webkit-patch upload should automatically create on for you.
Comment 11 Felipe 2011-02-24 18:20:25 PST
>I don't think the getcwd() is needed.
>
>Maybe it would be better to use $FindBin::Bin instead?

It appears ok to me.  Only a risk : FindBin might never be called before webkitdirs.pm by a module/script that was not in Scripts directory, because $FindBin::Bin is valued only once.
Comment 12 gecwebkit 2011-03-10 22:53:56 PST
Created attachment 85436 [details]
snapshot of the failed builds
Comment 13 gecwebkit 2011-03-10 23:28:30 PST
with reference to bug no. 53590 which has been observed on Windows XP SP3,we would like to state that the same was tried on windows XP SP2. And the same error was encountered with the difference in the line number.In the original bug report(on Windows XP SP3) it is stated as line number 573 while the build on windows XP SP2 established on line 596.

The build was tried on two PCs with windows XP SP2.
The attachment is the snapshot of both the cygwin shells showing build failed(differentiated by observing the user name).
Comment 14 Adam Roben (:aroben) 2011-03-11 05:39:02 PST
Comment on attachment 83410 [details]
This is the patch

Please write a ChangeLog for this patch and resubmit it. <http://www.webkit.org/coding/contributing.html> will tell you how to do so.
Comment 15 Felipe 2011-03-15 07:09:50 PDT
Created attachment 85801 [details]
patch
Comment 16 Adam Roben (:aroben) 2011-03-15 09:09:53 PDT
Comment on attachment 85801 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=85801&action=review

> Tools/ChangeLog:8
> +        * Scripts/webkitdirs.pm:

It would be good to add a function-level comment explaining this change. Something like:

(relativeScriptsDir): Ensure we use the directory that contains webkitdirs.pm, not the one that contains the original script that was invoked.

> Tools/Scripts/webkitdirs.pm:1
> -# Copyright (C) 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
> +# Copyright (C) 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.

Please undo this change.
Comment 17 Felipe 2011-03-15 17:39:57 PDT
Created attachment 85886 [details]
patch

Sorry, my editor has added a BOM automatically in the files.
Comment 18 WebKit Commit Bot 2011-03-15 23:00:59 PDT
Comment on attachment 85886 [details]
patch

Clearing flags on attachment: 85886

Committed r81219: <http://trac.webkit.org/changeset/81219>
Comment 19 WebKit Commit Bot 2011-03-15 23:01:09 PDT
All reviewed patches have been landed.  Closing bug.