Only disable parallel gyp execution in case it doesn't work
authorPiotr Tworek <p.tworek@samsung.com>
Mon, 9 Feb 2015 13:45:05 +0000 (14:45 +0100)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
Currently we always disable parallel gyp execution when running gyp
inside of GBS. This done because on some targets (TV 2.2.1) parallel
excution does not work due to broken python multiprocessing support.
The problem is, parallel execution works fine on Mobile or TV 3.0 and
disabling it meks gyp runs longer than necessary.

This patch uses an alternative solution. Only disable parallel gyp mode
in case gyp run in parallel such mode. I've tested it on both Mobile 2.4
and TV 2.2.1 targets and both work fine with such solution. The
difference is, Mobile 2.4 gyp run is now faster than previously.
Reviewed by: Antonio Gomes, Kamil Klimek, Piotr Grad, SeungSeop Park

Change-Id: Iff360c20b30435dd96255b393057ea3acfa9fa95
Signed-off-by: Piotr Tworek <p.tworek@samsung.com>
tizen_src/build/gyp_chromiumefl
tizen_src/build/gyp_chromiumefl.sh

index c0d563300a2f0e7d4492e9787e759cba57e3e027..113fcee27417a0115ed309e7d585f357aeeb61ce 100755 (executable)
@@ -161,12 +161,6 @@ if __name__ == '__main__':
   args.extend(['--format=ninja'])
   args.append("--check")
 
-  # gyp on gbs fails with multiprocessing.SemLock() not implemented
-  # disabling parallel gyp for gbs
-  gbs_build = os.environ.get('BUILDING_WITH_GBS')
-  if gbs_build:
-    args.append("--no-parallel")
-
   # TODO(b.kelemen): remove the condition once gyp_trunk.py has landed.
   if os.path.exists(os.path.join(script_dir, 'gyp_trunk.py')):
     # gyp_trunk works on sys.argv so we merge |args| back.
@@ -178,6 +172,10 @@ if __name__ == '__main__':
 
 
   print 'Updating projects from gyp files...'
+  try:
+    sys.exit(gyp.main(args))
+  except ImportError:
+    print ("Multiprocessing supported seems broken, disabling parallel gyp execution")
+    args.append("--no-parallel")
 
-  # Off we go...
   sys.exit(gyp.main(args))
index c00f2ce27c3fe4194a231405205058b37ca502ff..d418c10b6cd4ee50bf57f6be528aba7e7d9dc6a0 100755 (executable)
@@ -89,7 +89,6 @@ add_gbs_flags() {
   ADDITIONAL_GYP_PARAMETERS+="-Dtarget_arch=$host_arch
                               -Dhost_arch=$host_arch
                               -Dsysroot=
-                              --no-parallel
                              "
   # TODO(b.kelemen): ideally crosscompile should also support system libs.
   # Unfortunately the gbs root doesn't contain everything chromium needs.