Skip to content

Refactoring \nanostack --> moving it inside \connectivity. #13363

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
Aug 7, 2020

Conversation

ashok-rao
Copy link
Contributor

@ashok-rao ashok-rao commented Jul 28, 2020

Summary of changes

Mbed OS will soon be changing directory structure to the below:

connectivity
├── netsocket
├── lwipstack
├── nanostack
│   ├── mbed_lib.json // nanostack-interface's mbed_lib.json
│   ├── include
│   │   └── nanostack // headers from features/netsocket/nanostack-interface
│   ├── source        // sources from features/netsocket/nanostack-interface
│   ├── coap-service  // used by Thread only - deprecate?
│   ├── mbed-mesh-api
│   ├── nanostack-hal-mbed-cmsis-rtos // HAL porting layer for Nanostack on mbed with CMSIS-RTOS
│   ├── sal-stack-nanostack
│   └── sal-stack-nanostack-eventloop
├── cellular                // previously in features/cellular/framework/
├── ...

This PR is a part of a wider \connectivity refactoring and implements the above new directory structure for \nanostack.

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)
[x] Tests / results supplied as part of this PR

Build successes:

  • K64F::GCC_ARM::MBED-BUILD
  • K64F::GCC_ARM::MBED-OS-TESTS-NETWORK-INTERFACE
  • K64F::GCC_ARM::MBED-OS-TESTS-NETWORK-L3IP

Build skips:

  • K64F::GCC_ARM::MBED-OS-TESTS-NETWORK-EMAC
  • K64F::GCC_ARM::MBED-OS-TESTS-NETWORK-MULTIHOMING
  • K64F::GCC_ARM::MBED-OS-TESTS-NETWORK-WIFI

Reviewers


@LDong-Arm @evedon @gpsimenos

@ashok-rao
Copy link
Contributor Author

For some reason git didn't track these 4 files and shows them as deleted rather than renamed. Any thoughts why? And are these files necessary to be present? @LDong-Arm .. any thoughts?

        deleted:    features/nanostack/sal-stack-nanostack-eventloop/.cproject
        deleted:    features/nanostack/sal-stack-nanostack-eventloop/.project
        deleted:    features/nanostack/sal-stack-nanostack-eventloop/.settings/org.eclipse.cdt.codan.core.prefs
        deleted:    features/nanostack/sal-stack-nanostack-eventloop/.settings/org.eclipse.cdt.core.prefs

@mergify mergify bot added the needs: work label Jul 28, 2020
@mergify
Copy link

mergify bot commented Jul 28, 2020

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

@ashok-rao ashok-rao force-pushed the nanostack-refactor branch 2 times, most recently from 8f7c80d to 270e2c2 Compare July 28, 2020 14:45
@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Jul 28, 2020
@ciarmcom ciarmcom requested review from evedon, gpsimenos, LDong-Arm and a team July 28, 2020 15:00
@ciarmcom
Copy link
Member

@ashok-rao, thank you for your changes.
@evedon @gpsimenos @LDong-Arm @ARMmbed/mbed-os-maintainers please review.

@LDong-Arm
Copy link
Contributor

For some reason git didn't track these 4 files and shows them as deleted rather than renamed. Any thoughts why? And are these files necessary to be present? @LDong-Arm .. any thoughts?

        deleted:    features/nanostack/sal-stack-nanostack-eventloop/.cproject
        deleted:    features/nanostack/sal-stack-nanostack-eventloop/.project
        deleted:    features/nanostack/sal-stack-nanostack-eventloop/.settings/org.eclipse.cdt.codan.core.prefs
        deleted:    features/nanostack/sal-stack-nanostack-eventloop/.settings/org.eclipse.cdt.core.prefs

Discussed offline:
Those are IDE files that shouldn't have been there in the first place.
git didn't track them because when you do mbed import, Mbed CLI adds patterns for IDE files to .git/info/exclude which is a local/non-committable equivalent to .gitignore.

@mergify mergify bot removed the needs: review label Jul 28, 2020
@ashok-rao
Copy link
Contributor Author

astyle failed again for the below. This file has not been touched as part of this PR. Only moved to the new location. Why astyle fails now?

--- a/connectivity/nanostack/sal-stack-nanostack-eventloop/source/event.c
+++ b/connectivity/nanostack/sal-stack-nanostack-eventloop/source/event.c
@@ -197,7 +197,7 @@ void event_core_free_push(arm_event_storage_t *free)
             timer_sys_event_free(free);
             break;
         case ARM_LIB_EVENT_USER:
-            // No need set state to UNQUEUED - we forget about it.
+        // No need set state to UNQUEUED - we forget about it.
         default:
             break;
     }

@LDong-Arm
Copy link
Contributor

astyle failed again for the below. This file has not been touched as part of this PR. Only moved to the new location. Why astyle fails now?

Moved is considered changed too. I believe we should add the path to sal-stack-nanostack-eventloop to .astyleignore because it's imported from https://github.com/ARMmbed/sal-stack-nanostack-eventloop and thus not part of the Mbed OS project. It was probably missing before.

@ashok-rao ashok-rao force-pushed the nanostack-refactor branch from 270e2c2 to 84782a9 Compare July 28, 2020 15:24
@evedon
Copy link
Contributor

evedon commented Jul 28, 2020

Some scripts have lost execution permission.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 28, 2020

Some scripts have lost execution permission.

What is being used to move the files, out of curiosity, that permissions are being changed?

@LDong-Arm
Copy link
Contributor

Some scripts have lost execution permission.

What is being used to move the files, out of curiosity, that permissions are being changed?

Very same question from me - it has happened a lot in directory restructure PRs. It'd be good to identify the root cause.
@ashok-rao and @rajkan01 use Windows machines and have both encountered this issue - maybe permissions get changed when moving files on Windows?

@ashok-rao
Copy link
Contributor Author

Some scripts have lost execution permission.

Hmm. Strange. I haven't changed any permissions.

Some scripts have lost execution permission.

What is being used to move the files, out of curiosity, that permissions are being changed?

@0xc0170 : I'm moving them on a Windows machine from terminal. Is that what you were asking?

@ashok-rao
Copy link
Contributor Author

Travis failed with this below. The MeshInterface.h is moved to \connectivity\netsocket\include\netsocket as part of PR #13335 Question: Does this mean nanostack-libservice will need to be built again or make the change in mbed-os\connectivity\nanostack\ according to @rajkan01's PR above?

[Fatal Error] MeshInterfaceNanostack.h@21,27: MeshInterface.h: No such file or directory
[ERROR] In file included from ./connectivity/nanostack/mbed-mesh-api/source/CallbackHandler.cpp:17:0:
./connectivity/nanostack/mbed-mesh-api/mbed-mesh-api/MeshInterfaceNanostack.h:21:27: fatal error: MeshInterface.h: No such file or directory

@LDong-Arm
Copy link
Contributor

@ashok-rao To fix the Travis failure you need to rename features/nanostack -> connectivity/nanostack in .travis.yml.

@mergify
Copy link

mergify bot commented Jul 29, 2020

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

@ashok-rao ashok-rao force-pushed the nanostack-refactor branch 4 times, most recently from 0d5e604 to 42953c3 Compare July 31, 2020 16:12
Copy link
Contributor

@gpsimenos gpsimenos left a comment

Choose a reason for hiding this comment

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

LGTM

@ashok-rao ashok-rao force-pushed the nanostack-refactor branch from 42953c3 to ce3d999 Compare August 5, 2020 15:59
@mergify mergify bot dismissed adbridge’s stale review August 5, 2020 15:59

Pull request has been modified.

Copy link
Contributor

@LDong-Arm LDong-Arm left a comment

Choose a reason for hiding this comment

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

LGTM

@ashok-rao
Copy link
Contributor Author

@adbridge .. ready for CI, Thanks!

@adbridge
Copy link
Contributor

adbridge commented Aug 6, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Aug 6, 2020

Jenkins CI Test : ❌ FAILED

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-GCC_ARM
jenkins-ci/mbed-os-ci_build-ARM

@adbridge
Copy link
Contributor

adbridge commented Aug 6, 2020

@ashok-rao these errors look related:

#### STDOUT ####
Building project mbed-os-example-blinky-baremetal (K66F, ARMC6)
Scan: mbed-os-example-blinky-baremetal
Compile [  0.6%]: Nanostack.cpp
[Fatal Error] Nanostack.h@21,10: 'OnboardNetworkStack.h' file not found
[ERROR] In file included from ./mbed-os/connectivity/nanostack/source/Nanostack.cpp:20:
./mbed-os/connectivity/nanostack/include/nanostack-interface/Nanostack.h:21:10: fatal error: 'OnboardNetworkStack.h' file not found
#include "OnboardNetworkStack.h"
         ^~~~~~~~~~~~~~~~~~~~~~~

@LDong-Arm
Copy link
Contributor

@ashok-rao The error is because you moved Nanostack.cpp from features/nanostack/nanostack-interface (which has an mbed_lib.json) into connectivity/nanostack/source (which doesn't have an mbed_lib.json). This sort of things have cause problems many times during the restructuring work.

To fix it, just move connectivity/nanostack/include/nanostack-interface/mbed_lib.json to connectivity/nanostack/mbed_lib.json

@adbridge
Copy link
Contributor

adbridge commented Aug 6, 2020

CI restarted

@mbed-ci
Copy link

mbed-ci commented Aug 6, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 3 | 🔒 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_cloud-client-pytest ✔️
jenkins-ci/mbed-os-ci_wisun-mesh-test ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

@adbridge adbridge merged commit f7e60be into ARMmbed:master Aug 7, 2020
@mbedmain mbedmain added release-version: 6.2.1 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Aug 16, 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.

9 participants