Skip to content

Relocated libraries in features/frameworks #13430

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 6 commits into from
Sep 7, 2020

Conversation

LDong-Arm
Copy link
Contributor

@LDong-Arm LDong-Arm commented Aug 14, 2020

Summary of changes

As per the directory restructure plan, we get rid of features/frameworks by relocating libraries inside.

This PR covers the following:

  • mbed-trace -> platform/mbed-trace and refactored
  • mbed-client-randlib -> platform/randlib (shortened) and refactored.
    Note: The include path is still include/mbed-client-randlib/ because it's mirrored as a standalone repo and we want to avoid breaking changes. Is that still in use? @0xc0170

Greentea frameworks libraries will be covered separately.

Impact of changes

None

Migration actions required

None

Documentation

None


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@ARMmbed/mbed-os-core @andypowers @jamesbeyond @rajkan01


@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Aug 14, 2020
@ciarmcom ciarmcom requested review from andypowers, jamesbeyond, rajkan01 and a team August 14, 2020 11:30
@ciarmcom
Copy link
Member

@LDong-Arm, thank you for your changes.
@jamesbeyond @andypowers @rajkan01 @ARMmbed/mbed-os-maintainers @ARMmbed/mbed-os-core please review.

@LDong-Arm
Copy link
Contributor Author

LDong-Arm commented Aug 14, 2020

@0xc0170 Spell checks failed for mbed-trace and mbed-client-randlib. Should we fix them here and port them to their own repos? Or exclude them from the check?
Also their restructure (e.g. adding include/) need to be ported to their standalone repos.

Copy link
Contributor

@rajkan01 rajkan01 left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify
Copy link

mergify bot commented Aug 21, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 21, 2020

I've merged couple of Prs, they caused a conflict here.

@LDong-Arm LDong-Arm force-pushed the refactor_frameworks branch 2 times, most recently from bf64c15 to e05f2b2 Compare August 21, 2020 14:42
@LDong-Arm
Copy link
Contributor Author

Rebased

@LDong-Arm
Copy link
Contributor Author

Now Travis spell check passes

@LDong-Arm
Copy link
Contributor Author

Travis Pytest failed with

$ arm-none-eabi-gcc --version
The program 'arm-none-eabi-gcc' is currently not installed. To run 'arm-none-eabi-gcc' please ask your administrator to install the package 'gcc-arm-none-eabi'
The command "arm-none-eabi-gcc --version" failed and exited with 127 during .

@evedon
Copy link
Contributor

evedon commented Aug 24, 2020

Travis Pytest failed with

$ arm-none-eabi-gcc --version
The program 'arm-none-eabi-gcc' is currently not installed. To run 'arm-none-eabi-gcc' please ask your administrator to install the package 'gcc-arm-none-eabi'
The command "arm-none-eabi-gcc --version" failed and exited with 127 during .

@0xc0170 Any idea what is the issue here? Re-start CI?

@0Grit
Copy link

0Grit commented Aug 24, 2020

Why is the cli client deprecated and removed?

If goal is to migrate away from the monolithic codebase I am okay with the removal BUT only if there is an useable NPM like package lookup and import tool in the works.

@evedon
Copy link
Contributor

evedon commented Aug 24, 2020

Why is the cli client deprecated and removed?

If goal is to migrate away from the monolithic codebase I am okay with the removal BUT only if there is an useable NPM like package lookup and import tool in the works.

I agree that the deprecation and removal of mbed-client-cli should be done in a different PR and discuss there.

@evedon evedon force-pushed the refactor_frameworks branch from e06298f to 95071e5 Compare August 24, 2020 14:52
@mergify
Copy link

mergify bot commented Aug 25, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@evedon evedon force-pushed the refactor_frameworks branch from 95071e5 to b6810af Compare August 25, 2020 11:09
@evedon
Copy link
Contributor

evedon commented Aug 25, 2020

PR is ready for CI

@adbridge
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Aug 25, 2020

Jenkins CI Test : ❌ FAILED

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-ARM
jenkins-ci/mbed-os-ci_build-GCC_ARM

* Move mbed-client-randlib/ headers into include/
  (Note: we don't rename it to "randlib" because this library
   is mirrored to https://github.com/ARMmbed/mbed-client-randlib,
   and "mbed-client-randlib" may be reference by some projects)
* Move the standalone local unit test into tests/unit
The library "drivers" is a core one available to bare metal.
It should not depend on mbed-trace which is an optional library.
Comment on lines 27 to +36
#if (DEVICE_SPI || DEVICE_QSPI)

#include "features/frameworks/mbed-trace/mbed-trace/mbed_trace.h"
#if MBED_CONF_MBED_TRACE_ENABLE
#include "mbed-trace/mbed_trace.h"
#define TRACE_GROUP "SFDP"
#else // MBED_CONF_MBED_TRACE_ENABLE
#define tr_info(...)
#define tr_error(...)
#define tr_debug(...)
#endif // MBED_CONF_MBED_TRACE_ENABLE
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As something in drivers (a "core" library available for bare metal), mbed-trace shouldn't be a strict requirement. I made this change to fix bare metal build. @evedon @rajkan01

@evedon
Copy link
Contributor

evedon commented Sep 3, 2020

@adbridge PR ready for re-run of CI

@mergify mergify bot added needs: CI and removed needs: work labels Sep 3, 2020
@adbridge
Copy link
Contributor

adbridge commented Sep 4, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Sep 4, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-ARM ✔️
jenkins-ci/mbed-os-ci_build-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 4, 2020

mbed-client-randlib -> platform/randlib (shortened) and refactored.
Note: The include path is still include/mbed-client-randlib/ because it's mirrored as a standalone repo and we want to avoid breaking changes. Is that still in use? @0xc0170

@artokin can you review this part? where is this one used and how? Just wondering if it fits platform folder?

Copy link
Contributor

@artokin artokin left a comment

Choose a reason for hiding this comment

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

What is the purpose of renamed include directories? Why they need to be changed?

@@ -114,6 +114,7 @@ set(unittest-includes-base
"${PROJECT_SOURCE_DIR}/../features"
"${PROJECT_SOURCE_DIR}/../platform/include"
"${PROJECT_SOURCE_DIR}/../platform/include/platform"
"${PROJECT_SOURCE_DIR}/../platform/mbed-trace/include"
Copy link
Contributor

@artokin artokin Sep 4, 2020

Choose a reason for hiding this comment

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

Why the mbed-trace directory is renamed as include? (in mbed-trace and randlib)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We still have mbed-trace/mbed_trace.h inside include/. The change is to do with include path namespacing in the new build system being developed.

@LDong-Arm
Copy link
Contributor Author

What is the purpose of renamed include directories? Why they need to be changed?

We are implementing a new build system where only include of each library is in the include paths - not its subdirectories, not source directories, etc. This gives better encapsulation and namespaces compared to the current build system. We have done this for most other libraries already.

For example include/mbed-trace/mbed_trace.h translates to #include "mbed-trace/mbed_trace.h" to follow the <library name>/<header>.h rule. The none-namespaced #include "mbed_trace.h" will not be supported anymore in the near future.

@LDong-Arm
Copy link
Contributor Author

LDong-Arm commented Sep 4, 2020

Discussed with @artokin offline: Yes there are projects using the upstream repos mbed-trace and mbed-client-randlib. But at this stage our directory structure changes are non-breaking, because the current build system doesn't distinguish include paths. So alignment with the upstream is unlike to be problematic (or even urgent).

Hopefully it's all good?

@0xc0170 0xc0170 merged commit 41f2ee5 into ARMmbed:master Sep 7, 2020
@mergify mergify bot removed the ready for merge label Sep 7, 2020
@LDong-Arm LDong-Arm deleted the refactor_frameworks branch September 7, 2020 08:57
@mbedmain mbedmain added release-version: 6.3.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Sep 14, 2020
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.

10 participants