Skip to content
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

BlockDevices: specify mbed namespace where needed #14031

Merged
merged 2 commits into from
Feb 4, 2021

Conversation

facchinm
Copy link
Contributor

Summary of changes

Including any of these headers outside mbed namespace (or with MBED_NO_GLOBAL_USING_DIRECTIVE macro) would trigger compilation errors.
Since most of them were already ported to the full mbed:: specifier, apply this to all missing arguments.

Please not that this in not needed by other blockdevices since they are already under mbed namespace.

Impact of changes

Migration actions required

Documentation


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


@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Dec 11, 2020
@ciarmcom ciarmcom requested review from a team December 11, 2020 14:00
@ciarmcom
Copy link
Member

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

@evedon
Copy link
Contributor

evedon commented Dec 11, 2020

#13568 is also addressing namespace issues and there is some overlap.
But otherwise, code change looks good

@facchinm
Copy link
Contributor Author

@evedon sorry, missed that one 🙂 Happy to rebase as soon as it gets merged (or merge them together)

@mergify
Copy link

mergify bot commented Jan 5, 2021

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

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 5, 2021

@evedon sorry, missed that one 🙂 Happy to rebase as soon as it gets merged (or merge them together)

As it is not proceeding. I requested confirmation if it goes ahead or we shall make this PR to include both and fix it altogether?

@facchinm
Copy link
Contributor Author

facchinm commented Jan 5, 2021

@0xc0170 I'm merging the two patches and force pushing here

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

One question: TaskBase is in the events namespace. Should also PolledQueue to be or TaskBase should be changed?

Otherwise LGTM

@facchinm
Copy link
Contributor Author

facchinm commented Jan 5, 2021

One question: TaskBase is in the events namespace. Should also PolledQueue to be or TaskBase should be changed?

Ah, good question... I just really rebased both the patches and applied the one from #13568 as-is.
Tomorrow I'll check if namespacing TaskBase is also needed.

@facchinm
Copy link
Contributor Author

facchinm commented Jan 8, 2021

I can confirm that this patch is enough to include PolledQueue without any other action needed.
Sample project:

mbed_app.json

{
  "macros": [
    "MBED_NO_GLOBAL_USING_DIRECTIVE"
  ],
  "target_overrides": {
....

main.cpp

#include "mbed.h"
#include <PolledQueue.h>
int main() {}

This compiles with this branch while breaks on master
Should this be added to the testsuite @0xc0170 ?

@ciarmcom ciarmcom added the stale Stale Pull Request label Jan 19, 2021
@ciarmcom
Copy link
Member

This pull request has automatically been marked as stale because it has had no recent activity. @ARMmbed/mbed-os-core, please complete review of the changes to move the PR forward. Thank you for your contributions.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 19, 2021

I am now going through stale issues, this one I've missed as well.

Should this be added to the testsuite @0xc0170 ?

Yes, we should test MBED_NO_GLOBAL_USING_DIRECTIVE. Would you be able to add a test case?

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 20, 2021

Started CI to get early results.

@mbed-ci
Copy link

mbed-ci commented Jan 20, 2021

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_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️

@ciarmcom ciarmcom removed the stale Stale Pull Request label Jan 20, 2021
@ciarmcom ciarmcom added the stale Stale Pull Request label Jan 31, 2021
@ciarmcom
Copy link
Member

This pull request has automatically been marked as stale because it has had no recent activity. @facchinm, please carry out any necessary work to get the changes merged. Thank you for your contributions.

@facchinm
Copy link
Contributor Author

facchinm commented Feb 1, 2021

I think CI failure is totally unrelated with the commit (it breaks on DISCO_L475VG_IOT01A while compiling NFC_EEPROM example, the error is [Fatal Error] EEPROMDriver.cpp@18,10: m24sr_driver.h: No such file or directory ).
We'll add tests as per @0xc0170 request

@LDong-Arm
Copy link
Contributor

I think CI failure is totally unrelated with the commit (it breaks on DISCO_L475VG_IOT01A while compiling NFC_EEPROM example, the error is [Fatal Error] EEPROMDriver.cpp@18,10: m24sr_driver.h: No such file or directory ).
We'll add tests as per @0xc0170 request

It should be fixed by #14092 (merged a moment ago), CI needs a rerun.

@pennam
Copy link
Contributor

pennam commented Feb 2, 2021

@0xc0170 we are trying to find out the best way to test this issue. As this is not a runtime error adding a greentea test may not be the best option.
On master branch running mbed compile --library -D MBED_NO_GLOBAL_USING_DIRECTIVE build breaks compiling PolledQueue.cpp; moreover on this branch running mbed test with
MBED_NO_GLOBAL_USING_DIRECTIVE` a lot of test cases are failing to build.

Do you think is worth to add this build check into CI?

Verifying that all tests builds correctly with MBED_NO_GLOBAL_USING_DIRECTIVE active should give us the best coverage.

mbed_test_build_failures.log

@pennam
Copy link
Contributor

pennam commented Feb 2, 2021

rebased to rerun CI

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 2, 2021

Ci started

@ciarmcom ciarmcom removed the stale Stale Pull Request label Feb 2, 2021
@mbed-ci
Copy link

mbed-ci commented Feb 2, 2021

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-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️

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.

8 participants