New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: fix toolchain extend inc paths #4749

Merged
merged 1 commit into from Jul 13, 2017

Conversation

Projects
None yet
5 participants
@0xc0170
Member

0xc0170 commented Jul 12, 2017

inc paths might be a list or might not be (just single string). If they don't, we are ending up with non valid include paths (one letter include paths).
This as result would not compile.

As inc_dirs might be just D:/SomePath, extend this would lead to producing [D, :, S..........] thus we were not able to compile with tools/build.py for instance. This is an example I was seeing
[DEBUG] INC DIRS: ['C', ':', '\\', 'C', 'o', 'd', 'e', '\\', 'm', 'b', 'e', 'd', '-', 'o', 's', '\\', 'B', 'U', 'I', 'L', 'D', '\\', 'm', 'b', 'e', 'd', '\\', '.', 't', 'e', 'm', 'p', '\\', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'N', 'U', 'C', 'L', 'E', 'O', '_', 'F', '4', '1', '1', 'R', 'E', '\\', 'T', 'O', 'O', 'L', 'C', 'H', 'A', 'I', 'N', '_', 'I', 'A', 'R']

@jeromecoutant This should fix the issue you were seeing today with IAR

@theotherjimmy please review, we handle inc dirs in scan resources similarly, might be better to always consider this as a list, or hack like this. You can take this patch and just push to my branch.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jul 12, 2017

Without this patch, we would get

[DEBUG] Return: 3
Traceback (most recent call last):
  File "tools/build.py", line 212, in <module>
    build_profile=profile)
  File "mbed-os\tools\build_api.py", line 1014, in build_mbed_libs
    objects = toolchain.compile_sources(resources, tmp_path)
  File "mbed-os\tools\toolchains\__init__.py", line 908, in compile_sources
    return self.compile_seq(queue, objects)
  File "mbed-os\tools\toolchains\__init__.py", line 922, in compile_seq
    res['command']
  File "mbed-os\tools\toolchains\__init__.py", line 1064, in compile_output
    raise ToolException(_stderr)
ToolException

@bridadan This looks similar to what we seen with CI in the last 2 days, this might fix it ! However I wonder why this problem has not been seen earlier.

@jeromecoutant

This comment has been minimized.

Contributor

jeromecoutant commented Jul 12, 2017

Verified
Thx

@0xc0170 0xc0170 requested a review from theotherjimmy Jul 12, 2017

tools/toolchains/__init__.py Outdated
@@ -863,7 +863,10 @@ def compile_sources(self, resources, inc_dirs=None):
inc_paths = resources.inc_dirs
if inc_dirs is not None:
inc_paths.extend(inc_dirs)
if type(inc_dirs) == ListType:

This comment has been minimized.

@theotherjimmy

theotherjimmy Jul 12, 2017

Contributor

A more current pythonic way to do this is:

if isinstance(inc_dirs, list):

Please use that form.

This comment has been minimized.

@0xc0170

0xc0170 Jul 12, 2017

Member

will update

This comment has been minimized.

@theotherjimmy

theotherjimmy Jul 12, 2017

Contributor

Thanks!

@theotherjimmy

Meant to request changes. :(

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jul 12, 2017

I think that the confusion came from the fact that the argument is plural, implying an unordered set of include directories.

tools: fix toolchain extend inc paths
inc paths might be a list or might not be (just single string). If they don't, we are ending up with non valid include paths (one letter include paths).
This as result would not compile.

@0xc0170 0xc0170 force-pushed the 0xc0170:fix_inc_paths branch to 441fda9 Jul 12, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jul 12, 2017

Fixed, rebased

@theotherjimmy

Awesome. Thanks!

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jul 12, 2017

/morph test

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jul 12, 2017

/morph export-build

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Jul 12, 2017

@mbed-bot

This comment has been minimized.

mbed-bot commented Jul 12, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph export-build

Output

mbed Build Number: 86

All exports and builds passed!

@mbed-bot

This comment has been minimized.

mbed-bot commented Jul 12, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 794

Test failed!

@studavekar

This comment has been minimized.

Collaborator

studavekar commented Jul 13, 2017

/morph test

@mbed-bot

This comment has been minimized.

mbed-bot commented Jul 13, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 795

All builds and test passed!

@0xc0170 0xc0170 merged commit 8148329 into ARMmbed:master Jul 13, 2017

5 checks passed

Cam-CI uvisor Build & Test Success
Details
ci/morph-export-build Job has completed
Details
ci/morph-test Job has completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@0xc0170 0xc0170 deleted the 0xc0170:fix_inc_paths branch Jul 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment