Bug 40207

Summary: VCSUtils.pm functions return wrong value when current dir is not in WebKit
Product: WebKit Reporter: Jeff Johnson <opendarwin>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: UNCONFIRMED ---    
Severity: Normal CC: zoltan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: https://trac.webkit.org/browser/trunk/WebKitTools/Scripts/VCSUtils.pm

Description Jeff Johnson 2010-06-05 18:53:37 PDT
For ease of use, I have my local WebKit/WebKitTools/Scripts directory in my $PATH, so that for example I can just do "build-webkit" from the command line to build Webkit. However, this means that my current working directory could be anywhere on my local filesystem, not necessarily in the WebKit directory. The problem is that a number of functions in WebKitTools/Scripts/VCSUtils.pm return the wrong value when a script is run while the cwd is not WebKit.

I've discovered that this bug is the underlying cause of another bug:

https://bugs.webkit.org/show_bug.cgi?id=26642

If you run the set-webkit-configuration script while the current working directory is WebKit, it works fine. However, if you run the script while the current working directory is $HOME, for example, the script doesn't work right, which leads to the bug above.

Some of the functions that return the wrong values are isGit(), gitBranch(), and isGitBranchBuild().

The correct behavior would be to start with the directory of the running script itself instead of the current working directory. It seems that "wekitdirs.pm" is able to find the baseProductDir just fine, even if a script such as build-webkit is run while the cwd is $HOME.