xref: /aosp_15_r20/external/libchrome/build/get_landmines.py (revision 635a864187cb8b6c713ff48b7e790a6b21769273)
1*635a8641SAndroid Build Coastguard Worker#!/usr/bin/env python
2*635a8641SAndroid Build Coastguard Worker# Copyright 2013 The Chromium Authors. All rights reserved.
3*635a8641SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be
4*635a8641SAndroid Build Coastguard Worker# found in the LICENSE file.
5*635a8641SAndroid Build Coastguard Worker
6*635a8641SAndroid Build Coastguard Worker"""
7*635a8641SAndroid Build Coastguard WorkerThis file emits the list of reasons why a particular build needs to be clobbered
8*635a8641SAndroid Build Coastguard Worker(or a list of 'landmines').
9*635a8641SAndroid Build Coastguard Worker"""
10*635a8641SAndroid Build Coastguard Worker
11*635a8641SAndroid Build Coastguard Workerimport sys
12*635a8641SAndroid Build Coastguard Worker
13*635a8641SAndroid Build Coastguard Workerimport landmine_utils
14*635a8641SAndroid Build Coastguard Worker
15*635a8641SAndroid Build Coastguard Worker
16*635a8641SAndroid Build Coastguard Workerhost_os = landmine_utils.host_os
17*635a8641SAndroid Build Coastguard Worker
18*635a8641SAndroid Build Coastguard Worker
19*635a8641SAndroid Build Coastguard Workerdef print_landmines():
20*635a8641SAndroid Build Coastguard Worker  """
21*635a8641SAndroid Build Coastguard Worker  ALL LANDMINES ARE EMITTED FROM HERE.
22*635a8641SAndroid Build Coastguard Worker  """
23*635a8641SAndroid Build Coastguard Worker  # DO NOT add landmines as part of a regular CL. Landmines are a last-effort
24*635a8641SAndroid Build Coastguard Worker  # bandaid fix if a CL that got landed has a build dependency bug and all bots
25*635a8641SAndroid Build Coastguard Worker  # need to be cleaned up. If you're writing a new CL that causes build
26*635a8641SAndroid Build Coastguard Worker  # dependency problems, fix the dependency problems instead of adding a
27*635a8641SAndroid Build Coastguard Worker  # landmine.
28*635a8641SAndroid Build Coastguard Worker  #
29*635a8641SAndroid Build Coastguard Worker  # Before adding or changing a landmine consider the consequences of doing so.
30*635a8641SAndroid Build Coastguard Worker  # Doing so will wipe out every output directory on every Chrome developer's
31*635a8641SAndroid Build Coastguard Worker  # machine. This can be particularly problematic on Windows where the directory
32*635a8641SAndroid Build Coastguard Worker  # deletion may well fail (locked files, command prompt in the directory,
33*635a8641SAndroid Build Coastguard Worker  # etc.), and generated .sln and .vcxproj files will be deleted.
34*635a8641SAndroid Build Coastguard Worker  #
35*635a8641SAndroid Build Coastguard Worker  # This output directory deletion will be repeated when going back and forth
36*635a8641SAndroid Build Coastguard Worker  # across the change that added the landmine, adding to the cost. There are
37*635a8641SAndroid Build Coastguard Worker  # usually less troublesome alternatives.
38*635a8641SAndroid Build Coastguard Worker
39*635a8641SAndroid Build Coastguard Worker  if host_os() == 'win':
40*635a8641SAndroid Build Coastguard Worker    print('Compile on cc_unittests fails due to symbols removed in r185063.')
41*635a8641SAndroid Build Coastguard Worker  if host_os() == 'linux':
42*635a8641SAndroid Build Coastguard Worker    print('Builders switching from make to ninja will clobber on this.')
43*635a8641SAndroid Build Coastguard Worker  if host_os() == 'mac':
44*635a8641SAndroid Build Coastguard Worker    print('Switching from bundle to unbundled dylib (issue 14743002).')
45*635a8641SAndroid Build Coastguard Worker  if host_os() in ('win', 'mac'):
46*635a8641SAndroid Build Coastguard Worker    print('Improper dependency for create_nmf.py broke in r240802, '
47*635a8641SAndroid Build Coastguard Worker           'fixed in r240860.')
48*635a8641SAndroid Build Coastguard Worker  if host_os() == 'win':
49*635a8641SAndroid Build Coastguard Worker    print('Switch to VS2015 Update 3, 14393 SDK')
50*635a8641SAndroid Build Coastguard Worker  print('Need to clobber everything due to an IDL change in r154579 (blink)')
51*635a8641SAndroid Build Coastguard Worker  print('Need to clobber everything due to gen file moves in r175513 (Blink)')
52*635a8641SAndroid Build Coastguard Worker  print('Clobber to get rid of obselete test plugin after r248358')
53*635a8641SAndroid Build Coastguard Worker  print('Clobber to rebuild GN files for V8')
54*635a8641SAndroid Build Coastguard Worker  print('Clobber to get rid of stale generated mojom.h files')
55*635a8641SAndroid Build Coastguard Worker  print('Need to clobber everything due to build_nexe change in nacl r13424')
56*635a8641SAndroid Build Coastguard Worker  print('[chromium-dev] PSA: clobber build needed for IDR_INSPECTOR_* compil...')
57*635a8641SAndroid Build Coastguard Worker  print('blink_resources.grd changed: crbug.com/400860')
58*635a8641SAndroid Build Coastguard Worker  print('ninja dependency cycle: crbug.com/408192')
59*635a8641SAndroid Build Coastguard Worker  print('Clobber to fix missing NaCl gyp dependencies (crbug.com/427427).')
60*635a8641SAndroid Build Coastguard Worker  print('Another clobber for missing NaCl gyp deps (crbug.com/427427).')
61*635a8641SAndroid Build Coastguard Worker  print('Clobber to fix GN not picking up increased ID range (crbug.com/444902)')
62*635a8641SAndroid Build Coastguard Worker  print('Remove NaCl toolchains from the output dir (crbug.com/456902)')
63*635a8641SAndroid Build Coastguard Worker  if host_os() == 'win':
64*635a8641SAndroid Build Coastguard Worker    print('Clobber to delete stale generated files (crbug.com/510086)')
65*635a8641SAndroid Build Coastguard Worker  if host_os() == 'mac':
66*635a8641SAndroid Build Coastguard Worker    print('Clobber to get rid of evil libsqlite3.dylib (crbug.com/526208)')
67*635a8641SAndroid Build Coastguard Worker  if host_os() == 'mac':
68*635a8641SAndroid Build Coastguard Worker    print('Clobber to remove libsystem.dylib. See crbug.com/620075')
69*635a8641SAndroid Build Coastguard Worker  if host_os() == 'mac':
70*635a8641SAndroid Build Coastguard Worker    print('Clobber to get past mojo gen build error (crbug.com/679607)')
71*635a8641SAndroid Build Coastguard Worker  if host_os() == 'win':
72*635a8641SAndroid Build Coastguard Worker    print('Clobber Windows to fix strange PCH-not-rebuilt errors.')
73*635a8641SAndroid Build Coastguard Worker  print('CLobber all to fix GN breakage (crbug.com/736215)')
74*635a8641SAndroid Build Coastguard Worker  print('The Great Blink mv for source files (crbug.com/768828)')
75*635a8641SAndroid Build Coastguard Worker
76*635a8641SAndroid Build Coastguard Workerdef main():
77*635a8641SAndroid Build Coastguard Worker  print_landmines()
78*635a8641SAndroid Build Coastguard Worker  return 0
79*635a8641SAndroid Build Coastguard Worker
80*635a8641SAndroid Build Coastguard Worker
81*635a8641SAndroid Build Coastguard Workerif __name__ == '__main__':
82*635a8641SAndroid Build Coastguard Worker  sys.exit(main())
83