Skip to content

Fix CI for branch feature-public-headers #11093

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 10 commits into from
Jul 26, 2019
Merged

Fix CI for branch feature-public-headers #11093

merged 10 commits into from
Jul 26, 2019

Conversation

gpsimenos
Copy link
Contributor

@gpsimenos gpsimenos commented Jul 23, 2019

Description

This PR fixes build errors in the "Feature public headers" PR.

  • Update an include path for rtos_idle.h in NRFCordioHCIDriver.cpp
  • Move all USB source files directly under drivers/usb/
  • Add missing include for us_ticker

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

@ciarmcom ciarmcom requested a review from a team July 23, 2019 13:02
@ciarmcom
Copy link
Member

@gpsimenos, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@mbed-ci
Copy link

mbed-ci commented Jul 23, 2019

Test run: FAILED

Summary: 4 of 4 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_unittests
  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-IAR
  • jenkins-ci/mbed-os-ci_build-ARM

@gpsimenos gpsimenos changed the title Fix rtos include path in NRFCordioHCIDriver Fix build errors Jul 24, 2019
@evedon evedon changed the title Fix build errors Fix CI for branch feature-public-headers Jul 24, 2019
@mbed-ci
Copy link

mbed-ci commented Jul 24, 2019

Test run: FAILED

Summary: 4 of 4 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_unittests
  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-IAR

gpsimenos and others added 4 commits July 24, 2019 17:10
Add missing header file inclusion.
The "bare-metal" profile which is defined in
mbed-os/platform/bare_metal/mbed_lib.json only includes only the
`platform` and `drivers` dirs in the build.

The problem is due to the fact that USB related modules are now
included in the build as part of the `drivers` library.
They previously were not included given they were outside the `drivers`
directory (in the `usb` dir).

The solution is to stick an mbed_lib.json file under
`mbed-os/drivers/source/usb` in order to make it a library so it does
not get automatically included given the `requires` statement in
mbed-os/platform/bare_metal/mbed_lib.json
The Cmake file described hardcoded the relative path to the source file
being tested. Changed it to be the new location of the source file.
@mbed-ci
Copy link

mbed-ci commented Jul 25, 2019

Test run: FAILED

Summary: 3 of 11 test jobs failed
Build number : 3
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_mbed2-build-ARM
  • jenkins-ci/mbed-os-ci_mbed2-build-GCC_ARM
  • jenkins-ci/mbed-os-ci_mbed2-build-IAR

Modify compilation API to provide a list of paths to exclude from
the build.
@hugueskamba
Copy link
Collaborator

@madchutney @mark-edgeworth
Here is the commit made to modify the tool:
2c0f1e0

@SeppoTakalo @evedon could you please trigger the CI test again? Thanks.

@mbed-ci
Copy link

mbed-ci commented Jul 26, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 4
Build artifacts

@evedon evedon merged commit 1168a66 into ARMmbed:feature-public-headers Jul 26, 2019
@evedon evedon removed the needs: CI label Jul 26, 2019
@hugueskamba hugueskamba deleted the feature-public-headers branch July 26, 2019 12:14
# a compilation queue.
compile_queue = (
files_to_compile
if not exclude_paths
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the ternary operator here makes the code more difficult to read, a simple if then else would be clearer IMO.

if not exclude_paths
else [
file_to_compile
for exclude_path in exclude_paths
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this list comprehension does what you want. It works ok when there is a single exclude path, but when there are multiple exclude paths the file to compile with be included once for every exclude path.

I don't think it would be a bad idea to break out this functionality into a small function and unit test.

Copy link
Contributor

Choose a reason for hiding this comment

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

The scope of this change is to provide a short-term workaround to maintain Mbed OS 2 compatibility until legacy build support is removed.
If the current code works when there is a single exclude path then let's add a comment to that effect and let's convert exclude_paths to a single exclude_path.

@@ -397,14 +397,27 @@ def get_arch_file(self, objects):

# THIS METHOD IS BEING CALLED BY THE MBED ONLINE BUILD SYSTEM
# ANY CHANGE OF PARAMETERS OR RETURN VALUES WILL BREAK COMPATIBILITY
def compile_sources(self, resources, inc_dirs=None):
def compile_sources(self, resources, inc_dirs=None, exclude_paths=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

This addition of the exclude_paths parameter will mean that it will be included the statement:

    # THIS METHOD IS BEING CALLED BY THE MBED ONLINE BUILD SYSTEM
    # ANY CHANGE OF PARAMETERS OR RETURN VALUES WILL BREAK COMPATIBILITY

It would be possible to remove this parameter when legacy build support is removed but I'm sure by then we would have forgotten. My suggestion would be to create a private function which has this parameter but leave this interface as it is, e.g.

def compile_legacy_sources(self, resources, inc_dirs=None, exclude_paths=None)
    return _compile_sources(resources, inc_dirs=inc_dirs, exclude_paths=exclude_paths)

def compile_sources(self, resources, inc_dirs=None)
    return _compile_sources(resources, inc_dirs=inc_dirs)

def _compile_sources(self, resources, inc_dirs=None, exclude_paths=None)
    ...

I would also ask whether there is a different between dirs and paths the two different terminologies in the parameter list might be confusing.

evedon pushed a commit that referenced this pull request Aug 1, 2019
* Fix rtos include path in NRFCordioHCIDriver
* Flatten USB driver directory structure
* Add missing include for us_ticker
* Add more missing includes for us_ticker
* Fix mbed_hal_fpga_ci_test_shield/uart test
* Fix bare-metal build
* Fix Watchdog UNITTEST
* Fix Mbed OS 2 build for Public/Internal headers relocating
evedon pushed a commit that referenced this pull request Aug 2, 2019
* Fix rtos include path in NRFCordioHCIDriver
* Flatten USB driver directory structure
* Add missing include for us_ticker
* Add more missing includes for us_ticker
* Fix mbed_hal_fpga_ci_test_shield/uart test
* Fix bare-metal build
* Fix Watchdog UNITTEST
* Fix Mbed OS 2 build for Public/Internal headers relocating
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants