Currently a person must manually update the build location used by the Xcode workspace file, WebKit.xcworkspace, to build/debug/run WebKit each time they switch to a different branch in a Git branch build setup so that Xcode uses the branch-specific build location for WebKit (*). I propose we add a script, called update-Xcode-workspace-build-location (I am open to naming suggestions), that can update the build location in an Xcode workspace file and add a script to be used as a post-checkout Git hook that runs update-Xcode-workspace-build-location whenever a person switches to another branch. The script update-Xcode-workspace-build-location would modify the Xcode workspace file WebKit.xcworkspace to use as its build location a symbolic link, CurrentWebKitBuild, which points to the branch-specific build directory. The symbolic link CurrentWebKitBuild would be created in the top-level WebKit checkout directory (if it doesn't exist). (*) Alternatively a person must use a symbolic link for their Xcode build location and update the symbolic link each time they switch to a different branch to point to the branch-specific build directory.
Created attachment 207150 [details] Patch
How do I use the scripts? The following instructions only need to be performed once. 1. Run the script update-Xcode-workspace-build-location to create the symbolic link CurrentWebKitBuild and update the file WebKit.xcworkspace to use this symbolic link as its build location. 2. Copy the script update-Xcode-workspace-build-location-post-checkout to the .git/hooks directory in your top-level WebKit checkout directory as "post-checkout". 3. Done. The Git post-checkout script will run whenever you switch to a new branch and will update the symbolic link CurrentWebKitBuild to point to the branch-specific build location.
Comment on attachment 207150 [details] Patch Attachment 207150 [details] did not pass win-ews (win): Output: http://webkit-queues.appspot.com/results/1251896 New failing tests: dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.xhtml dom/svg/level3/xpath/XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR.svg dom/html/level2/events/dispatchEvent04.html dom/html/level2/html/HTMLSelectElement20.html dom/svg/level3/xpath/XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR.svg dom/svg/level3/xpath/XPathEvaluator_createExpression_NAMESPACE_ERR_02.svg dom/html/level1/core/documentinvalidcharacterexceptioncreateentref.html dom/html/level2/core/hc_namednodemapinvalidtype1.html dom/svg/level3/xpath/XPathEvaluator_evaluate_NAMESPACE_ERR.svg dom/html/level2/events/dispatchEvent01.html dom/xhtml/level1/core/hc_attrappendchild4.xhtml dom/html/level2/events/dispatchEvent03.html dom/html/level2/events/dispatchEvent02.html dom/html/level2/core/createDocumentType04.html dom/html/level1/core/documentinvalidcharacterexceptioncreateentref1.html dom/html/level1/core/documentinvalidcharacterexceptioncreatepi1.html dom/html/level2/events/dispatchEvent06.html css1/basic/comments.html dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.xhtml dom/html/level2/events/dispatchEvent07.html dom/html/level2/core/setAttributeNS10.html dom/html/level2/events/dispatchEvent05.html dom/html/level1/core/hc_attrappendchild2.html dom/html/level2/core/createAttributeNS06.html dom/html/level1/core/hc_attrappendchild4.html dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.xhtml dom/svg/level3/xpath/XPathEvaluator_createExpression_NAMESPACE_ERR_01.svg dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.xhtml dom/xhtml/level1/core/hc_attrappendchild2.xhtml dom/html/level1/core/documentinvalidcharacterexceptioncreatepi.html
Created attachment 207618 [details] Archive of layout-test-results from APPLE-EWS-3 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: APPLE-EWS-3 Port: win-future Platform: CYGWIN_NT-6.1-WOW64-1.7.20-0.266-5-3-i686-32bit
How does this differ from http://trac.webkit.org/wiki/UsingGitWithWebKit 's webKitBranchBuild thing?
(In reply to comment #5) > How does this differ from http://trac.webkit.org/wiki/UsingGitWithWebKit 's webKitBranchBuild thing? It doesn't differ. These scripts make it possible to use Xcode with a webKitBranchBuild setup.
Comment on attachment 207150 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=207150&action=review r=me with the grammar fixes in the ChangeLog and error message. > Tools/ChangeLog:10 > + location used by an Xcode workspace file and a post-checkout Git hook script that > + be used to run update-Xcode-workspace-build-location whenever a person switches Typo: …that *can* be used... > Tools/ChangeLog:18 > + Maybe add a reference to the wiki page like this? See also: <http://trac.webkit.org/wiki/UsingGitWithWebKit> > Tools/Scripts/update-Xcode-workspace-build-location:50 > + "no-symlink" => \$doNotUseSymlink, Getopt::Long has automatic negation recognition which would allow --symlink, --nosymlink and --no-symlink automatically. See "man Getopt::Long". "symlink+" => \$useSymlink, Then you can get rid of the negative logic required for $doNotUseSymlink. Not required to land this patch; for a future update. > Tools/Scripts/update-Xcode-workspace-build-location:57 > + --no-symlink Modify the Xcode workspace to point to the current WebKit build without using a symbolic link if you switch to $useSymlink, you should print out the default here. > Tools/Scripts/update-Xcode-workspace-build-location:112 > + print "Cannot find neither file \"$xcodeWorkspaceSettings\"\n"; Grammar issue. Should either be: Can find neither X nor Y. or: Cannot find either X or Y.
Is this needed now? Thanks!
We don't have any solution for quickly switching between branches without invalidating Xcode build data. There isn't a lot of talk about needing a fix though - not sure because this isn't a big problem in practice, or if people assume that it's unfixable.