Replaced variable names as overloads like stdout, stderr to _stdout, _stderr to avoid unnecesary bugs in the future

Added linking error prints - reported by STMicro David BELLEGARDE <david.bellegarde@st.com>

Modiffied compilation prompting to alling with linker's way of printing - now each issue will be printed in separate line with simple prefix like [DEBUG] Output:
pull/498/head
Przemek Wirkus 2014-09-19 11:30:35 +01:00
parent b2861e7625
commit 27fa463fcf
1 changed files with 35 additions and 29 deletions

View File

@ -14,22 +14,21 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
""" """
from os import stat, walk
from os.path import join, splitext, exists, relpath, dirname, basename, split
from shutil import copyfile
from copy import copy
from types import ListType
from inspect import getmro
from time import time
from workspace_tools.utils import run_cmd, mkdir, rel_path, ToolException, split_path import re
from workspace_tools.settings import BUILD_OPTIONS, MBED_ORG_USER from os import stat, walk
from copy import copy
from time import time, sleep
from types import ListType
from shutil import copyfile
from os.path import join, splitext, exists, relpath, dirname, basename, split
from inspect import getmro
from multiprocessing import Pool, cpu_count from multiprocessing import Pool, cpu_count
from time import sleep from workspace_tools.utils import run_cmd, mkdir, rel_path, ToolException, split_path
from workspace_tools.settings import BUILD_OPTIONS, MBED_ORG_USER
import workspace_tools.hooks as hooks import workspace_tools.hooks as hooks
import re
#Disables multiprocessing if set to higher number than the host machine CPUs #Disables multiprocessing if set to higher number than the host machine CPUs
CPU_COUNT_MIN = 1 CPU_COUNT_MIN = 1
@ -68,10 +67,10 @@ def print_notify_verbose(event):
def compile_worker(job): def compile_worker(job):
results = [] results = []
for command in job['commands']: for command in job['commands']:
_, stderr, rc = run_cmd(command, job['work_dir']) _, _stderr, _rc = run_cmd(command, job['work_dir'])
results.append({ results.append({
'code': rc, 'code': _rc,
'output': stderr, 'output': _stderr,
'command': command 'command': command
}) })
@ -573,18 +572,21 @@ class mbedToolchain:
return None return None
def compile_output(self, output=[]): def compile_output(self, output=[]):
rc = output[0] _rc = output[0]
stderr = output[1] _stderr = output[1]
command = output[2] command = output[2]
# Parse output for Warnings and Errors # Parse output for Warnings and Errors
self.parse_output(stderr) self.parse_output(_stderr)
self.debug("Return: %s" % rc) self.debug("Return: %s"% _rc)
self.debug("Output: %s" % stderr) for error_line in _stderr.splitlines():
self.debug("Output: %s"% error_line)
# Check return code # Check return code
if rc != 0: if _rc != 0:
raise ToolException(stderr) for line in _stderr.splitlines():
self.tool_error(line)
raise ToolException(_stderr)
def compile(self, cc, source, object, includes): def compile(self, cc, source, object, includes):
_, ext = splitext(source) _, ext = splitext(source)
@ -647,15 +649,19 @@ class mbedToolchain:
return bin return bin
def default_cmd(self, command): def default_cmd(self, command):
self.debug("Command: %s" % ' '.join(command)) self.debug("Command: %s"% ' '.join(command))
stdout, stderr, rc = run_cmd(command) _stdout, _stderr, _rc = run_cmd(command)
self.debug("Return: %s" % rc) self.debug("Return: %s"% _rc)
self.debug("Output: %s" % ' '.join(stdout))
if rc != 0: for output_line in _stdout.splitlines():
for line in stderr.splitlines(): self.debug("Output: %s"% output_line)
for error_line in _stderr.splitlines():
self.debug("Errors: %s"% error_line)
if _rc != 0:
for line in _stderr.splitlines():
self.tool_error(line) self.tool_error(line)
raise ToolException(stderr) raise ToolException(_stderr)
### NOTIFICATIONS ### ### NOTIFICATIONS ###
def info(self, message): def info(self, message):