Title: [282953] trunk/Tools
Revision
282953
Author
[email protected]
Date
2021-09-23 01:19:24 -0700 (Thu, 23 Sep 2021)

Log Message

[Flatpak] Use NUMBER_OF_PROCESSORS if already defined
https://bugs.webkit.org/show_bug.cgi?id=230638

Reviewed by Martin Robinson.

The environment variable NUMBER_OF_PROCESSORS can be defined to instruct the build system
to spawn as many concurrent build commands as specified. By default flatpak was using 3x the number
of processors in the local system. However we might prefer to provide a more convenient number
by using the environment variable. Note that this approach is better than passing -j as
--makeargs because cmake would have to be reconfigured everytime the number passed to -j changes.

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox): Use NUMBER_OF_PROCESSORS if already defined. Otherwise fallback
to 3x the number of processors.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (282952 => 282953)


--- trunk/Tools/ChangeLog	2021-09-23 08:18:45 UTC (rev 282952)
+++ trunk/Tools/ChangeLog	2021-09-23 08:19:24 UTC (rev 282953)
@@ -1,3 +1,20 @@
+2021-09-23  Sergio Villar Senin  <[email protected]>
+
+        [Flatpak] Use NUMBER_OF_PROCESSORS if already defined
+        https://bugs.webkit.org/show_bug.cgi?id=230638
+
+        Reviewed by Martin Robinson.
+
+        The environment variable NUMBER_OF_PROCESSORS can be defined to instruct the build system
+        to spawn as many concurrent build commands as specified. By default flatpak was using 3x the number
+        of processors in the local system. However we might prefer to provide a more convenient number
+        by using the environment variable. Note that this approach is better than passing -j as
+        --makeargs because cmake would have to be reconfigured everytime the number passed to -j changes.
+
+        * flatpak/flatpakutils.py:
+        (WebkitFlatpak.run_in_sandbox): Use NUMBER_OF_PROCESSORS if already defined. Otherwise fallback
+        to 3x the number of processors.
+
 2021-09-23  Chris Lord  <[email protected]>
 
         [GTK] Allow sending precise mouse wheel events in LayoutTests

Modified: trunk/Tools/flatpak/flatpakutils.py (282952 => 282953)


--- trunk/Tools/flatpak/flatpakutils.py	2021-09-23 08:18:45 UTC (rev 282952)
+++ trunk/Tools/flatpak/flatpakutils.py	2021-09-23 08:19:24 UTC (rev 282953)
@@ -882,8 +882,11 @@
             _log.debug('Enabling the icecream compiler')
             flatpak_command.extend([share_network_option, "--filesystem=home"])
 
-            n_cores = multiprocessing.cpu_count() * 3
-            _log.debug('Following icecream recommendation for the number of cores to use: %d' % n_cores)
+            try:
+                n_cores = os.environ["NUMBER_OF_PROCESSORS"]
+            except KeyError:
+                n_cores = multiprocessing.cpu_count() * 3
+                _log.debug('Following icecream recommendation for the number of cores to use: %d' % n_cores)
             toolchain_name = os.environ.get("CC", "gcc")
             try:
                 toolchain_path = os.environ.get("ICECC_VERSION_OVERRIDE", self.icc_version[toolchain_name])
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to