Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Issue 159803: Add hook to clobber header files generated by grit on Windows.... (Closed)

Created:
11 years, 4 months ago by Paweł Hajdan Jr.
Modified:
9 years, 7 months ago
Reviewers:
tony
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Add hook to clobber header files generated by grit on Windows. This workarounds build problem with IncrediBuild. TEST=none http://crbug.com/17706 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=22325

Patch Set 1 #

Total comments: 1

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -0 lines) Patch
M DEPS View 1 chunk +5 lines, -0 lines 0 comments Download
A build/win/clobber_generated_headers.py View 1 1 chunk +49 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Paweł Hajdan Jr.
11 years, 4 months ago (2009-08-03 19:02:10 UTC) #1
tony
http://codereview.chromium.org/159803/diff/1/3 File build/win/clobber_generated_headers.py (right): http://codereview.chromium.org/159803/diff/1/3#newcode29 Line 29: 'global_intermediate', 'chrome') Is this the right path for ...
11 years, 4 months ago (2009-08-03 19:15:40 UTC) #2
Paweł Hajdan Jr.
Good catch. I tested that now it removes the correct file.
11 years, 4 months ago (2009-08-03 20:34:35 UTC) #3
tony
LGTM!
11 years, 4 months ago (2009-08-03 20:47:26 UTC) #4
jam
11 years, 4 months ago (2009-08-11 02:45:05 UTC) #5
I just synced.  Before I did though, I removed all the files in my Debug
directory because I hadn't synced in a few days.  I got all these warnings
at the end.  The script shouldn't output these harmless warnings because
they lead to confusion and don't give any useful information.

________ running 'a:\depot_tools\python\python.exe
src/build/win/clobber_generated_headers.py A:\chrome2\src\webkit\glue\
devtools_strings.gr
d A:\chrome2\src\chrome\common\common_resources.grd
A:\chrome2\src\chrome\renderer\renderer_resources.grd
A:\chrome2\src\chrome\app\generate
d_resources.grd A:\chrome2\src\chrome\app\theme\theme_resources.grd
A:\chrome2\src\app\resources\app_strings.grd' in 'a:\chrome2'
Could not remove
src/build/win\..\..\chrome\Debug\obj\global_intermediate\src\grit/common_resources.h.
Continuing.
Could not remove
src/build/win\..\..\chrome\Release\obj\global_intermediate\src\grit/common_resources.h.
Continuing.
Could not remove
src/build/win\..\..\chrome\Debug\obj\global_intermediate\src\grit/renderer_resources.h.
Continuing.
Could not remove
src/build/win\..\..\chrome\Release\obj\global_intermediate\src\grit/renderer_resources.h.
Continuing.
Could not remove
src/build/win\..\..\chrome\Debug\obj\global_intermediate\src\grit/generated_resources.h.
Continuing.
Could not remove
src/build/win\..\..\chrome\Release\obj\global_intermediate\src\grit/generated_resources.h.
Continuing.
Could not remove
src/build/win\..\..\chrome\Debug\obj\global_intermediate\src\grit/theme_resources.h.
Continuing.
Could not remove
src/build/win\..\..\chrome\Debug\obj\global_intermediate\src\grit/theme_resources_map.h.
Continuing.
Could not remove
src/build/win\..\..\chrome\Release\obj\global_intermediate\src\grit/theme_resources.h.
Continuing.
Could not remove
src/build/win\..\..\chrome\Release\obj\global_intermediate\src\grit/theme_resources_map.h.
Continuing.
Could not remove
src/build/win\..\..\chrome\Debug\obj\global_intermediate\src\grit/app_strings.h.
Continuing.
Could not remove
src/build/win\..\..\chrome\Release\obj\global_intermediate\src\grit/app_strings.h.
Continuing.

a:\chrome2\src\chrome>

On Mon, Aug 3, 2009 at 12:02 PM, <phajdan.jr@chromium.org> wrote:

>
> Reviewers: tony,
>
> Description:
> Add hook to clobber header files generated by grit on Windows.
>
> This workarounds build problem with IncrediBuild.
>
> TEST=none
> http://crbug.com/17706
>
> Please review this at http://codereview.chromium.org/159803
>
> SVN Base: http://src.chromium.org/svn/trunk/src/
>
> Affected files:
>  M     DEPS
>  A     build/win/clobber_generated_headers.py
>
>
> Index: DEPS
> ===================================================================
> --- DEPS        (revision 22292)
> +++ DEPS        (working copy)
> @@ -134,4 +134,9 @@
>     "pattern": "\\.gypi?$|[/\\\\]src[/\\\\]tools[/\\\\]gyp[/\\\\]",
>     "action": ["python", "src/tools/gyp/gyp_chromium"],
>   },
> +  {
> +    # Workaround IncrediBuild problem. http://crbug.com/17706.
> +    "pattern": "\\.grd$",
> +    "action": ["python", "src/build/win/clobber_generated_headers.py",
> "$matching_files"],
> +  },
>  ]
> Index: build/win/clobber_generated_headers.py
> ===================================================================
> --- build/win/clobber_generated_headers.py      (revision 0)
> +++ build/win/clobber_generated_headers.py      (revision 0)
> @@ -0,0 +1,36 @@
> +#!/usr/bin/python
> +# Copyright (c) 2009 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.
> +
> +# This script helps workaround IncrediBuild problem on Windows.
> +# See http://crbug.com/17706.
> +
> +import os
> +import sys
> +
> +_SRC_PATH = os.path.join(os.path.dirname(__file__), '..', '..')
> +
> +sys.path.append(os.path.join(_SRC_PATH, 'tools', 'grit'))
> +import grit.grd_reader
> +
> +# We need to apply the workaround only on Windows.
> +if os.name != 'nt':
> +  sys.exit(0)
> +
> +for path in sys.argv[1:]:
> +  path = os.path.join('src', path)
> +  root = grit.grd_reader.Parse(path)
> +  output_files = [node.GetOutputFilename() for node in
> root.GetOutputFiles()]
> +  output_headers = [file for file in output_files if file.endswith('.h')]
> +  for build_type in ('Debug', 'Release'):
> +    build_path = os.path.join(_SRC_PATH, 'chrome', build_type)
> +    intermediate_path = os.path.join(build_path, 'obj',
> +                                     'global_intermediate', 'chrome')
> +    for header in output_headers:
> +      full_path = os.path.join(intermediate_path, header)
> +      try:
> +        os.remove(full_path)
> +        print 'Clobbered ' + full_path
> +      except OSError:
> +        print 'Could not remove ' + full_path + '. Continuing.'
> \ No newline at end of file
>
>
>

Powered by Google App Engine
This is Rietveld 408576698