Skip to content

[Tools] mbed Online Build System support and improvements #2180

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

Merged
merged 2 commits into from
Jul 19, 2016

Conversation

screamerbg
Copy link
Contributor

@screamerbg screamerbg commented Jul 15, 2016

  • added/improved chroot support globally
  • added RESPONSE_FILES flag to support optional response files (on linux the cmd param length is 2 megabytes). Default True
  • added unified handling for archive and link response file (similar to includes)
  • added COMPILE_C_AS_CPP flag to support compiling of c files as cpp. Default False
  • added mbedToolchain.init() for post init hooks
  • added support to identify compiler warning/error column (supports ARMCC, GCC and IAR). Errors/warnings now report file@line,col
  • added global TOOLCHAIN_PATHS which allows overriding/changing of the toolchain paths. Also simplified ARM-related paths
  • added target.json to mbed library release (by @0xc0170)
  • added caching to mbedToolchain.need_update() to reduce IO hits
  • improved run_cmd() performance by removing unnecessary check about the command being executed (should be checked once in the relevant toolchain instead)
  • migrated compile_worker() to utils.py for lightweight thread initialization
  • removed remnants of Goanna support (should be reimplemented as hooks to compile/link/archive instead)
  • fixes for Python 2.7 compatibility (by @0xc0170)
  • fixes for Exporters (by @0xc0170)

@screamerbg screamerbg force-pushed the online-build-system branch 2 times, most recently from cb18774 to 3906136 Compare July 15, 2016 23:17


if self.stat_cache.has_key(d):
if self.stat_cache[d] >= target_mod_time:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be:

if self.stat_cache.has_key(d) and self.stat_cache[d] >= target_mod_time:

unless you are planning on adding an else case to the second if.

@screamerbg screamerbg force-pushed the online-build-system branch from 3906136 to f31ea23 Compare July 15, 2016 23:22
config = Config(self.target, prj_paths)
for src in ['lib', 'src']:
resources = reduce(add, [self.__scan_and_copy(join(path, src), trg_path) for path in prj_paths])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the

from operators import add

from the top of this file. It's no longer needed/wanted.

@screamerbg screamerbg force-pushed the online-build-system branch from f31ea23 to 7307f64 Compare July 15, 2016 23:35
@screamerbg
Copy link
Contributor Author

@mbed-bot: TEST

HOST_OSES=Windows
BUILD_TOOLCHAINS=GCC_ARM,ARM,IAR
TARGETS=K64F,LPC1768,NUCLEO_F411RE

@screamerbg screamerbg changed the title Patches related mbed online build system support mbed Online Build System support Jul 15, 2016
@screamerbg screamerbg changed the title mbed Online Build System support mbed Online Build System support and improvements Jul 15, 2016
@screamerbg screamerbg changed the title mbed Online Build System support and improvements [Tools] mbed Online Build System support and improvements Jul 15, 2016
@theotherjimmy
Copy link
Contributor

I want to test it before I give it 👍 , but these changes look fine to me.

@screamerbg
Copy link
Contributor Author

@mbed-bot: TEST

HOST_OSES=windows
BUILD_TOOLCHAINS=GCC_ARM,ARM,IAR
TARGETS=K64F,LPC1768

@screamerbg screamerbg force-pushed the online-build-system branch from 7307f64 to 5d3c973 Compare July 16, 2016 17:18
@mbed-bot
Copy link

[Build ${MBED_BUILD_ID}]
FAILURE: Something went wrong when building and testing.

1 similar comment
@mbed-bot
Copy link

[Build ${MBED_BUILD_ID}]
FAILURE: Something went wrong when building and testing.

@bridadan
Copy link
Contributor

@mbed-bot: TEST

HOST_OSES=windows
BUILD_TOOLCHAINS=GCC_ARM,ARM,IAR
TARGETS=K64F,LPC1768

@mbed-bot
Copy link

[Build 638]
FAILURE: Something went wrong when building and testing.

@bridadan
Copy link
Contributor

Looks like there's build failures for K64F with the RTOS for toolchains ARM and IAR:

Building library RTX (K64F, ARM)
Scan: rtx
Scan: mbed
Scan: rtos
Compile: HAL_CM.c
[Warning] rt_HAL_CM.h@209,0:  #3731-D: intrinsic is deprecated
[Warning] rt_HAL_CM.h@212,0:  #3731-D: intrinsic is deprecated
[Warning] rt_HAL_CM.h@214,0:  #3731-D: intrinsic is deprecated
[Warning] rt_HAL_CM.h@216,0:  #3731-D: intrinsic is deprecated
Compile: RTX_Conf_CM.c
Compile: HAL_CM4.c
[Warning] rt_HAL_CM.h@209,0:  #3731-D: intrinsic is deprecated
[Warning] rt_HAL_CM.h@212,0:  #3731-D: intrinsic is deprecated
[Warning] rt_HAL_CM.h@214,0:  #3731-D: intrinsic is deprecated
[Warning] rt_HAL_CM.h@216,0:  #3731-D: intrinsic is deprecated
[Error] HAL_CM4.c@167,0: A1854E: Unknown opcode 'VSTMDBEQ', maybe wrong target CPU?
[Error] HAL_CM4.c@187,0: A1854E: Unknown opcode 'VLDMIANE', maybe wrong target CPU?
[Error] HAL_CM4.c@250,0: A1854E: Unknown opcode 'VSTMDBEQ', maybe wrong target CPU?
[Error] HAL_CM4.c@269,0: A1854E: Unknown opcode 'VLDMIANE', maybe wrong target CPU?

@screamerbg
Copy link
Contributor Author

@bridadan Hold on 2min

@screamerbg screamerbg force-pushed the online-build-system branch 3 times, most recently from 54f500a to a36c8d1 Compare July 16, 2016 23:36
@screamerbg
Copy link
Contributor Author

@mbed-bot: TEST

HOST_OSES=windows
BUILD_TOOLCHAINS=GCC_ARM,ARM,IAR
TARGETS=K64F,LPC1768,NUCLEO_F411RE

@mbed-bot
Copy link

[Build 642]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 18, 2016

Some of this changes are part of the #2175 (the release PR).

This patch (=1 commit) should be split (based on the list in the first message, there would be set of commits).

@screamerbg
Copy link
Contributor Author

screamerbg commented Jul 18, 2016

@0xc0170 Agreed that the patch is big, but unfortunately the intermediate commits contained integration code which was later removed. Additionally some of the commits contained information about the online build system set up, which should rather stay in mbed's kitchen.

Due to time constraints I don't think I'll be able to split it into separate patches as you suggested. I'd rather use the time to document which methods are used by the online build system, which might break it if changed.

@@ -98,7 +95,7 @@ def generate(self, progen_build=False):
project_data['common']['macros'].pop(i)
i += 1
project_data['common']['macros'].append('__ASSERT_MSG')
project_data['common']['build_dir'] = join(project_data['common']['build_dir'], 'uvision4')
project_data['common']['build_dir'] = project_data['common']['build_dir'] + '\\' + 'uvision4'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why \\ instead of join ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is part of the release branch (as I noted above). this will get rebased and those changes will be removed. The reason is that for keil it needs to be windows paths. It was join, but then keil reported an error if I tested this in the online compiler)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @0xc0170 stumbled upon bug in uVision that '/' is not accepted as valid path separator.

@bogdanm
Copy link
Contributor

bogdanm commented Jul 18, 2016

This kind of patch (that contains unrelated changes in a single commit) is hard to follow and understand. There are some changes (for example https://github.com/mbedmicro/mbed/pull/2180/files#diff-486f048c4c5775670840b518bf8b0ad5R630) that are not commented and that I don't understand. I understand we're in a hurry, but I personally don't feel ready to accept this patch.

@bogdanm
Copy link
Contributor

bogdanm commented Jul 19, 2016

#2175 has been merged, can you please rebase?

@screamerbg screamerbg force-pushed the online-build-system branch from ec60314 to 782c933 Compare July 19, 2016 10:06
@screamerbg
Copy link
Contributor Author

screamerbg commented Jul 19, 2016

@bogdanm now rebased. Reduced from 18 to 12 files :)

* added/improved global chroot support
* added RESPONSE_FILES flag to support optional response files (on linux the cmd param length is 2 megabytes). Default True
* added unified handling for archive and link response file (similar to includes)
* added COMPILE_C_AS_CPP flag to support compiling of c files as cpp. Default False
* added mbedToolchain.init() for post __init__ hooks
* added caching to mbedToolchain.need_update() to reduce IO hits
* added support to identify compiler warning/error column (supports ARMCC, GCC and IAR). Errors/warnings now report file@line,col
* added global TOOLCHAIN_PATHS which allows overriding/changing of the toolchain paths. Also simplified ARM-related paths
* added target.json to mbed library release (by @0xc0170)* migrated compile_worker() to utils.py for lightweight thread initialization
* improved run_cmd() performance by removing unnecessary check about the command being executed (should be checked once in the relevant toolchain instead)
* removed remnants of Goanna support (should be reimplemented as hooks to compile/link/archive instead)
* fixes for Python 2.7 compatibility (by @0xc0170)
* fixes for Exporters (by @0xc0170)
@screamerbg screamerbg force-pushed the online-build-system branch from 782c933 to ad87f9d Compare July 19, 2016 10:16
@screamerbg
Copy link
Contributor Author

@mbed-bot: TEST

HOST_OSES=windows
BUILD_TOOLCHAINS=GCC_ARM,ARM,IAR
TARGETS=K64F,LPC1768,NUCLEO_F411RE

@mbed-bot
Copy link

[Build 652]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@mbed-bot
Copy link

[Build 653]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@@ -61,6 +61,9 @@ class Target:
# need to be computed differently than regular attributes
__cumulative_attributes = ['extra_labels', 'macros', 'device_has', 'features']

# List of targets that were added dynamically using "add_py_targets" (see below)
__py_targets = set()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__py_targets is no longer needed. Please remove it.

@bogdanm
Copy link
Contributor

bogdanm commented Jul 19, 2016

There are still loads of changes that I don't understand here, but the tests pass, so I'm going to merge this in. Keeping a close eye on it in case it breaks things.

@bogdanm bogdanm merged commit fd757d3 into master Jul 19, 2016
@bogdanm bogdanm deleted the online-build-system branch July 19, 2016 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants