From 3c39a9028dd0604bddee50fd86ec67a4d0caa262 Mon Sep 17 00:00:00 2001 From: Jarred Nicholls <jarred.nicholls@gmail.com> Date: Fri, 10 Oct 2014 09:26:12 -0400 Subject: [PATCH] <third_party/WebKit> FIXUP: Prevent a python IOError on Windows The bison script for compiling grammars suffers from the MAX_PATH IOError issue on Windows. This occurs when doing a shadow build that results in large relative paths in the generated GYP actions. Change-Id: Ic875a818ee0cda85efcb3ccebaf885872aed8746 Reviewed-by: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Jarred Nicholls <jarred.nicholls@gmail.com> --- .../WebKit/Source/build/scripts/rule_bison.py | 5 +++-- .../WebKit/Source/build/scripts/utilities.py | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 chromium/third_party/WebKit/Source/build/scripts/utilities.py diff --git a/chromium/third_party/WebKit/Source/build/scripts/rule_bison.py b/chromium/third_party/WebKit/Source/build/scripts/rule_bison.py index 870f3b56f28..e72e87e56fe 100755 --- a/chromium/third_party/WebKit/Source/build/scripts/rule_bison.py +++ b/chromium/third_party/WebKit/Source/build/scripts/rule_bison.py @@ -41,11 +41,12 @@ import os import os.path import subprocess import sys +from utilities import abs assert len(sys.argv) == 3 or len(sys.argv) == 4 -inputFile = sys.argv[1] -outputDir = sys.argv[2] +inputFile = abs(sys.argv[1]) +outputDir = abs(sys.argv[2]) bisonExe = 'bison' if len(sys.argv) > 3: bisonExe = sys.argv[3] diff --git a/chromium/third_party/WebKit/Source/build/scripts/utilities.py b/chromium/third_party/WebKit/Source/build/scripts/utilities.py new file mode 100644 index 00000000000..f236b04cc77 --- /dev/null +++ b/chromium/third_party/WebKit/Source/build/scripts/utilities.py @@ -0,0 +1,10 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os + +def abs(filename): + # open, abspath, etc. are all limited to the 260 char MAX_PATH and this causes + # problems when we try to resolve long relative paths in the WebKit directory structure. + return os.path.normpath(os.path.join(os.getcwd(), filename)) -- GitLab