WebKit Bugzilla
Attachment 343154 Details for
Bug 185643
: run-gtk-tests (glib/common.py) cannot determine build directory when webKitBranchBuild=true
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
wk-branch.diff (text/plain), 8.16 KB, created by
Carlos Garcia Campos
on 2018-06-20 05:56:19 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2018-06-20 05:56:19 PDT
Size:
8.16 KB
patch
obsolete
>diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 1dabf1fdad7..d6d627da565 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,23 @@ >+2018-06-20 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ run-gtk-tests (glib/common.py) cannot determine build directory when webKitBranchBuild=true >+ https://bugs.webkit.org/show_bug.cgi?id=185643 >+ >+ Reviewed by Frédéric Wang. >+ >+ Check if webKitBranchBuild is true in git config to add the branch name to the build path. >+ >+ * Scripts/webkitpy/common/checkout/scm/git.py: >+ (Git.read_git_config): Add output_type parameter. >+ (Git.read_config): Call read_git_config with cws and executive. >+ (Git._upstream_branch): Use read_config(). >+ (Git._assert_can_squash): Ditto. >+ (Git.remote_branch_ref): Ditto. >+ * Scripts/webkitpy/common/checkout/scm/scm_unittest.py: >+ (GitSVNTest.test_read_git_config): >+ * glib/common.py: >+ (get_build_path): >+ > 2018-06-20 Rob Buis <rbuis@igalia.com> > > [GTK] ASSERTION FAILED: url == m_string in UserAgentQuirks test >diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/git.py b/Tools/Scripts/webkitpy/common/checkout/scm/git.py >index 8d30ee41eab..eac451f950f 100644 >--- a/Tools/Scripts/webkitpy/common/checkout/scm/git.py >+++ b/Tools/Scripts/webkitpy/common/checkout/scm/git.py >@@ -136,13 +136,22 @@ class Git(SCM, SVNRepository): > return filepath.replace(root_end_with_slash, '') > > @classmethod >- def read_git_config(cls, key, cwd=None, executive=None): >+ def read_git_config(cls, key, output_type=None, cwd=None, executive=None): > # FIXME: This should probably use cwd=self.checkout_root. > # Pass --get-all for cases where the config has multiple values > # Pass the cwd if provided so that we can handle the case of running webkit-patch outside of the working directory. > # FIXME: This should use an Executive. > executive = executive or Executive() >- return executive.run_command([cls.executable_name, "config", "--get-all", key], ignore_errors=True, cwd=cwd).rstrip('\n') >+ cmd = [cls.executable_name, "config", "--get-all"] >+ if output_type == bool: >+ cmd.append("--bool") >+ elif output_type == int: >+ cmd.append("--int") >+ cmd.append(key) >+ return executive.run_command(cmd, ignore_errors=True, cwd=cwd).rstrip('\n') >+ >+ def read_config(self, key, output_type=None): >+ return self.read_git_config(key, output_type, self.checkout_root, self._executive) > > @staticmethod > def commit_success_regexp(): >@@ -193,7 +202,7 @@ class Git(SCM, SVNRepository): > > def _upstream_branch(self): > current_branch = self._current_branch() >- return self._branch_from_ref(self.read_git_config('branch.%s.merge' % current_branch, cwd=self.checkout_root, executive=self._executive).strip()) >+ return self._branch_from_ref(self.read_config('branch.%s.merge' % current_branch).strip()) > > def merge_base(self, git_commit): > if git_commit: >@@ -406,7 +415,7 @@ class Git(SCM, SVNRepository): > self._run_git(['checkout', 'HEAD'] + file_paths) > > def _assert_can_squash(self, has_working_directory_changes): >- squash = self.read_git_config('webkit-patch.commit-should-always-squash', cwd=self.checkout_root, executive=self._executive) >+ squash = self.read_config('webkit-patch.commit-should-always-squash') > should_squash = squash and squash.lower() == "true" > > if not should_squash: >@@ -518,7 +527,7 @@ class Git(SCM, SVNRepository): > > def remote_branch_ref(self): > # Use references so that we can avoid collisions, e.g. we don't want to operate on refs/heads/trunk if it exists. >- remote_branch_refs = self.read_git_config('svn-remote.svn.fetch', cwd=self.checkout_root, executive=self._executive) >+ remote_branch_refs = self.read_config('svn-remote.svn.fetch') > if not remote_branch_refs: > remote_master_ref = 'refs/remotes/origin/master' > if not self.branch_ref_exists(remote_master_ref): >diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py b/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py >index 2fa58ba0c00..ec189b575c2 100644 >--- a/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py >+++ b/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py >@@ -1142,6 +1142,49 @@ class GitSVNTest(SCMTest): > run_command(['git', 'config', key, value]) > self.assertEqual(self.scm.read_git_config(key), value) > >+ value = 'true' >+ run_command(['git', 'config', key, value]) >+ self.assertEqual(self.scm.read_git_config(key), value) >+ >+ value = 'yes' >+ run_command(['git', 'config', key, value]) >+ self.assertEqual(self.scm.read_git_config(key), value) >+ self.assertEqual(self.scm.read_git_config(key, bool), 'true') >+ >+ value = 'oN' >+ run_command(['git', 'config', key, value]) >+ self.assertEqual(self.scm.read_git_config(key), value) >+ self.assertEqual(self.scm.read_git_config(key, bool), 'true') >+ >+ value = '1' >+ run_command(['git', 'config', key, value]) >+ self.assertEqual(self.scm.read_git_config(key), value) >+ self.assertEqual(self.scm.read_git_config(key, bool), 'true') >+ >+ value = 'false' >+ run_command(['git', 'config', key, value]) >+ self.assertEqual(self.scm.read_git_config(key), value) >+ >+ value = 'no' >+ run_command(['git', 'config', key, value]) >+ self.assertEqual(self.scm.read_git_config(key), value) >+ self.assertEqual(self.scm.read_git_config(key, bool), 'false') >+ >+ value = 'oFf' >+ run_command(['git', 'config', key, value]) >+ self.assertEqual(self.scm.read_git_config(key), value) >+ self.assertEqual(self.scm.read_git_config(key, bool), 'false') >+ >+ value = '0' >+ run_command(['git', 'config', key, value]) >+ self.assertEqual(self.scm.read_git_config(key), value) >+ self.assertEqual(self.scm.read_git_config(key, bool), 'false') >+ >+ value = '1k' >+ run_command(['git', 'config', key, value]) >+ self.assertEqual(self.scm.read_git_config(key), value) >+ self.assertEqual(self.scm.read_git_config(key, int), '1024') >+ > def test_local_commits(self): > test_file = os.path.join(self.git_checkout_path, 'test_file') > write_into_file_at_path(test_file, 'foo') >diff --git a/Tools/glib/common.py b/Tools/glib/common.py >index 8a7b2fb465b..453078272f5 100644 >--- a/Tools/glib/common.py >+++ b/Tools/glib/common.py >@@ -21,6 +21,15 @@ import select > import subprocess > import sys > >+tools_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'Tools', 'Scripts')) >+if tools_dir not in sys.path: >+ sys.path.insert(0, tools_dir) >+ >+from webkitpy.common.checkout.scm import Git >+from webkitpy.common.checkout.scm.detection import SCMDetector >+from webkitpy.common.system.executive import Executive >+from webkitpy.common.system.filesystem import FileSystem >+ > top_level_dir = None > build_dir = None > library_build_dir = None >@@ -75,9 +84,19 @@ def get_build_path(fatal=True): > if is_valid_build_directory(build_dir): > return build_dir > >+ base_build_dir = top_level_path('WebKitBuild') >+ >+ scm = SCMDetector(FileSystem(), Executive()).default_scm() >+ if isinstance(scm, Git): >+ is_branch_build = scm.read_config('core.webKitBranchBuild', bool) >+ if is_branch_build and is_branch_build.lower() == 'true': >+ current_branch = scm._current_branch() >+ if current_branch != 'master': >+ base_build_dir = os.path.join(base_build_dir, scm._current_branch()) >+ > global build_types > for build_type in build_types: >- build_dir = top_level_path('WebKitBuild', build_type) >+ build_dir = os.path.join(base_build_dir, build_type) > if is_valid_build_directory(build_dir): > return build_dir > >@@ -90,7 +109,7 @@ def get_build_path(fatal=True): > if is_valid_build_directory(build_dir): > return build_dir > >- build_dir = top_level_path("WebKitBuild") >+ build_dir = base_build_dir > if is_valid_build_directory(build_dir): > return build_dir >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185643
:
341184
|
341187
| 343154 |
343203