... |
... |
@@ -19,6 +19,7 @@ |
19
|
19
|
# Tiago Gomes <tiago gomes codethink co uk>
|
20
|
20
|
|
21
|
21
|
import os
|
|
22
|
+import sys
|
22
|
23
|
from collections import Mapping, OrderedDict
|
23
|
24
|
from pluginbase import PluginBase
|
24
|
25
|
from . import utils
|
... |
... |
@@ -38,6 +39,7 @@ from ._loader import Loader |
38
|
39
|
from .element import Element
|
39
|
40
|
from ._message import Message, MessageType
|
40
|
41
|
from ._includes import Includes
|
|
42
|
+from ._platform import Platform
|
41
|
43
|
|
42
|
44
|
|
43
|
45
|
# Project Configuration file
|
... |
... |
@@ -140,6 +142,7 @@ class Project(): |
140
|
142
|
profile_start(Topics.LOAD_PROJECT, self.directory.replace(os.sep, '-'))
|
141
|
143
|
self._load(parent_loader=parent_loader, tempdir=tempdir)
|
142
|
144
|
profile_end(Topics.LOAD_PROJECT, self.directory.replace(os.sep, '-'))
|
|
145
|
+ self.platform = Platform.get_platform()
|
143
|
146
|
|
144
|
147
|
self._partially_loaded = True
|
145
|
148
|
|
... |
... |
@@ -594,7 +597,7 @@ class Project(): |
594
|
597
|
# Based on some testing (mainly on AWS), maximum effective
|
595
|
598
|
# max-jobs value seems to be around 8-10 if we have enough cores
|
596
|
599
|
# users should set values based on workload and build infrastructure
|
597
|
|
- output.base_variables['max-jobs'] = str(min(len(os.sched_getaffinity(0)), 8))
|
|
600
|
+ output.base_variables['max-jobs'] = self.platform.get_cpu_count()
|
598
|
601
|
|
599
|
602
|
# Export options into variables, if that was requested
|
600
|
603
|
output.options.export_variables(output.base_variables)
|