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

tools-exporters! - Clean exports with git #2692

Closed

Conversation

theotherjimmy
Copy link
Contributor

Note: This is a proposal with a bit of code.

So the idea is to clean the files that are generated by an export with
the git clean command. This has a benefit for the UX: it tells you when
it removes something. In this way, you know that the clean flag worked,
and you will know immediately if it did something wrong.

An example export with a clean from within mbed-os-example-blinky after
a previous export (or two):

$ mbed export -c -i gcc_arm -m K64F
Removing Makefile
Removing mbed-os-example-blinky.uvopt
Removing mbed-os-example-blinky.uvproj
Removing mbed_config.h
Build Options: debug-info
Scan: .
Scan: FEATURE_COMMON_PAL
Scan: FEATURE_UVISOR
Scan: FEATURE_BLE
Scan: FEATURE_CLIENT
Scan: FEATURE_IPV6
Scan: FEATURE_IPV4
Scan: FEATURE_STORAGE

@theotherjimmy
Copy link
Contributor Author

theotherjimmy commented Sep 13, 2016

Hmmmmm. need to rebase, seems this contains the toolchain-polymorphic stuff too. Done

It was possible to remove an entire project if clean was specified on
the command line. That's a Bad Thing(tm).
Also tells you what it's removing
@theotherjimmy
Copy link
Contributor Author

@0xc0170 @screamerbg @sarahmarshy Could you take a look?

@bridadan
Copy link
Contributor

One thing worth noting here: the tools in the mbed-os repository (to my knowledge) have never had an explicit dependency on SCM tools. It was aware of them, but it never actually invoked them directly.

I don't necessarily have a problem with how this is implemented. I would prefer not to add a dependency on git, but it's hard to deny that this implementation is very clean and easy to understand.

I just wanted to bring the addition of the dependency up to just keep things clear. I would say I'd give a solid +0.5 for that reason 😄

@sarahmarshy
Copy link
Contributor

sarahmarshy commented Sep 13, 2016

The quickstart video suggests installing git and mercurial, so I feel like users should have it installed.

Though this also suggests installing one or the other, so I suppose it isn't necessary. I think we could add the call in a try block. If it fails, warn the user that their directory will not be cleaned as they don't have git installed.

At worst, their directory would not be cleaned, but they could continue exporting. As it is, the command could fail with a traceback? Or it might simply print a windows command error, but the user might not associate it with their clean flag.

@@ -200,8 +200,7 @@ def main():

# Clean Export Directory
if options.clean:
if exists(EXPORT_DIR):
rmtree(EXPORT_DIR)
Popen(["git", "clean", "-fe", "mbed-os"]).wait()
Copy link
Contributor

@sarahmarshy sarahmarshy Sep 13, 2016

Choose a reason for hiding this comment

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

What about:

try:
    subprocess.check_call(["git", "clean", "-fe", "mbed-os"])
except subprocess.CalledProcessError:
    print "Warning: your directory will not be cleaned. Please install git to use the clean flag."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. will do.

@screamerbg
Copy link
Contributor

This should be rather a switch to mbed CLI which can clean the whole code during import (not just mbed OS)

@theotherjimmy
Copy link
Contributor Author

Sounds good.

@theotherjimmy
Copy link
Contributor Author

Closing.

artokin added a commit to artokin/mbed-os that referenced this pull request Sep 23, 2021
…..225a4af

225a4af Remove files from tests folder
58d2c8f Merge remote-tracking branch 'origin/release_internal' into release_external
921b4b3 Wi-SUN FAN 1.1 dynamic MDR data request enabler
b8722e8 Corrected BR removing of waiting list entry when supplicant is in key storage
0d54d7a Adjust trace levels (ARMmbed#2692)
681d9ea Added reset for pan id and version to BR network start
30d4fb2 Renaming and cleaning ws bootstrap (ARMmbed#2688)
e0da19d Add Wi-SUN host configuration (ARMmbed#2690)
50ecc3d Refactoring Wi-SUN stack (ARMmbed#2686)
9d2386d Renamed operation mode to operating mode.
2f755bc RF config resolver and some refactoring (ARMmbed#2683)
86c6d19 Fixed WS IE PCAP read operation wrong length usage.
cd3a4c2 Config: Remove additional HAVE_WS_ROUTER (ARMmbed#2684)
cdd7f2d Added API for configure supported Phy capability.
a00a3c0 Wi-SUN FAN 1.1 PCAP IE update
2d063d3 Moved State machine and timer functions to own files
edb8bec Corrected system time check function return values
85358a6 Moved Wi-SUN Bootstrap Event handling to separate device handlers
61cbdde MAC to support mode switch on single channel (ARMmbed#2678)
1006d29 Added storing of PAN ID to NVM in BBR
7bf0028 Corrected system time jump detection on BR startup
e60974d Split Wi-SUN bootstrap to device types
a3f3412 MAC data req: API to support mode switch (ARMmbed#2674)
cad5122 Removed automatic network size configuration (ARMmbed#2673)
35d3132 MAC: Callback set to resolve PHY mode ID (ARMmbed#2672)
0c5faca Added support for large system time changes (e.g. due to NTP) (ARMmbed#2670)
c94b306 LFN version and LGTK Hash IE advertisment and learn
8e07511 Use FAN version constant  instead of pure number
a5566b2 Channel Plan 2 validation and FAN 1.0 reject
42dba41 Wi-Sun IE FAN 1.1 update
1d56070 EU channel plan ids (FAN 1.1) supported (ARMmbed#2668)
fc4f41f Add test API empty function
37efc7e Add version 1.1 basic support
e1558fb Implemented mode switch PHR build and parse (ARMmbed#2665)
cbd8a15 Corrected frame counter storing threshold check
37f7ae9 Time configuration distribution using DHCPv6 vendor data
7415bc7 Added checks for Border Router frame counter space exhaustion (ARMmbed#2660)
f1a65ec Mode switch PHY API (ARMmbed#2663)
e54231b Do not check buffer age when virtual RF driver used (ARMmbed#2662)
cc8c7bd arm_network_certificate_chain_set() returns -2 when PANA is disabled
319dd91 Fix dubious semicolon in #define
2ff51ab Remove extra '\n' in traces
19376c8 Simplify array indexes
c808661 Fix ASAN warnings about overflows in bit shifts
f998008 Fix use-after-free in mac_helper_coordinator_address_set()
4d04541 Wi-SUN header and Paylod IE element lenght future proof update.
935898b Medium network PAN_TIMEOUT changed to 30 minutes
1af7cfe Updated nanostack to be compatible with mbed TLS 3.0 (ARMmbed#2657)
29744e0 If Router Solicitation creation fails no longer tries to retry the RS right away (ARMmbed#2655)
2b889e9 Added automatic test procedure triggering during bootstrap
ed9eb05 GTKs are removed only when fresh GTK hash is received
81ecdc2 Added empty function for test procedure trigger
14439b4 Added support for triggering test procedures
b8a67a9 Update CHANGELOG.md for Nanostack 14.0.0 (ARMmbed#2649)

git-subtree-dir: features/nanostack/sal-stack-nanostack
git-subtree-split: 225a4af
artokin added a commit to artokin/mbed-os that referenced this pull request Sep 23, 2021
…..225a4af

225a4af Remove files from tests folder
58d2c8f Merge remote-tracking branch 'origin/release_internal' into release_external
921b4b3 Wi-SUN FAN 1.1 dynamic MDR data request enabler
b8722e8 Corrected BR removing of waiting list entry when supplicant is in key storage
0d54d7a Adjust trace levels (ARMmbed#2692)
681d9ea Added reset for pan id and version to BR network start
30d4fb2 Renaming and cleaning ws bootstrap (ARMmbed#2688)
e0da19d Add Wi-SUN host configuration (ARMmbed#2690)
50ecc3d Refactoring Wi-SUN stack (ARMmbed#2686)
9d2386d Renamed operation mode to operating mode.
2f755bc RF config resolver and some refactoring (ARMmbed#2683)
86c6d19 Fixed WS IE PCAP read operation wrong length usage.
cd3a4c2 Config: Remove additional HAVE_WS_ROUTER (ARMmbed#2684)
cdd7f2d Added API for configure supported Phy capability.
a00a3c0 Wi-SUN FAN 1.1 PCAP IE update
2d063d3 Moved State machine and timer functions to own files
edb8bec Corrected system time check function return values
85358a6 Moved Wi-SUN Bootstrap Event handling to separate device handlers
61cbdde MAC to support mode switch on single channel (ARMmbed#2678)
1006d29 Added storing of PAN ID to NVM in BBR
7bf0028 Corrected system time jump detection on BR startup
e60974d Split Wi-SUN bootstrap to device types
a3f3412 MAC data req: API to support mode switch (ARMmbed#2674)
cad5122 Removed automatic network size configuration (ARMmbed#2673)
35d3132 MAC: Callback set to resolve PHY mode ID (ARMmbed#2672)
0c5faca Added support for large system time changes (e.g. due to NTP) (ARMmbed#2670)
c94b306 LFN version and LGTK Hash IE advertisment and learn
8e07511 Use FAN version constant  instead of pure number
a5566b2 Channel Plan 2 validation and FAN 1.0 reject
42dba41 Wi-Sun IE FAN 1.1 update
1d56070 EU channel plan ids (FAN 1.1) supported (ARMmbed#2668)
fc4f41f Add test API empty function
37efc7e Add version 1.1 basic support
e1558fb Implemented mode switch PHR build and parse (ARMmbed#2665)
cbd8a15 Corrected frame counter storing threshold check
37f7ae9 Time configuration distribution using DHCPv6 vendor data
7415bc7 Added checks for Border Router frame counter space exhaustion (ARMmbed#2660)
f1a65ec Mode switch PHY API (ARMmbed#2663)
e54231b Do not check buffer age when virtual RF driver used (ARMmbed#2662)
cc8c7bd arm_network_certificate_chain_set() returns -2 when PANA is disabled
319dd91 Fix dubious semicolon in #define
2ff51ab Remove extra '\n' in traces
19376c8 Simplify array indexes
c808661 Fix ASAN warnings about overflows in bit shifts
f998008 Fix use-after-free in mac_helper_coordinator_address_set()
4d04541 Wi-SUN header and Paylod IE element lenght future proof update.
935898b Medium network PAN_TIMEOUT changed to 30 minutes
1af7cfe Updated nanostack to be compatible with mbed TLS 3.0 (ARMmbed#2657)
29744e0 If Router Solicitation creation fails no longer tries to retry the RS right away (ARMmbed#2655)
2b889e9 Added automatic test procedure triggering during bootstrap
ed9eb05 GTKs are removed only when fresh GTK hash is received
81ecdc2 Added empty function for test procedure trigger
14439b4 Added support for triggering test procedures
b8a67a9 Update CHANGELOG.md for Nanostack 14.0.0 (ARMmbed#2649)

git-subtree-dir: features/nanostack/sal-stack-nanostack
git-subtree-split: 225a4af
artokin added a commit to artokin/mbed-os that referenced this pull request Sep 23, 2021
…a3c5c5..225a4af

225a4af Remove files from tests folder
58d2c8f Merge remote-tracking branch 'origin/release_internal' into release_external
921b4b3 Wi-SUN FAN 1.1 dynamic MDR data request enabler
b8722e8 Corrected BR removing of waiting list entry when supplicant is in key storage
0d54d7a Adjust trace levels (ARMmbed#2692)
681d9ea Added reset for pan id and version to BR network start
30d4fb2 Renaming and cleaning ws bootstrap (ARMmbed#2688)
e0da19d Add Wi-SUN host configuration (ARMmbed#2690)
50ecc3d Refactoring Wi-SUN stack (ARMmbed#2686)
9d2386d Renamed operation mode to operating mode.
2f755bc RF config resolver and some refactoring (ARMmbed#2683)
86c6d19 Fixed WS IE PCAP read operation wrong length usage.
cd3a4c2 Config: Remove additional HAVE_WS_ROUTER (ARMmbed#2684)
cdd7f2d Added API for configure supported Phy capability.
a00a3c0 Wi-SUN FAN 1.1 PCAP IE update
2d063d3 Moved State machine and timer functions to own files
edb8bec Corrected system time check function return values
85358a6 Moved Wi-SUN Bootstrap Event handling to separate device handlers
61cbdde MAC to support mode switch on single channel (ARMmbed#2678)
1006d29 Added storing of PAN ID to NVM in BBR
7bf0028 Corrected system time jump detection on BR startup
e60974d Split Wi-SUN bootstrap to device types
a3f3412 MAC data req: API to support mode switch (ARMmbed#2674)
cad5122 Removed automatic network size configuration (ARMmbed#2673)
35d3132 MAC: Callback set to resolve PHY mode ID (ARMmbed#2672)
0c5faca Added support for large system time changes (e.g. due to NTP) (ARMmbed#2670)
c94b306 LFN version and LGTK Hash IE advertisment and learn
8e07511 Use FAN version constant  instead of pure number
a5566b2 Channel Plan 2 validation and FAN 1.0 reject
42dba41 Wi-Sun IE FAN 1.1 update
1d56070 EU channel plan ids (FAN 1.1) supported (ARMmbed#2668)
fc4f41f Add test API empty function
37efc7e Add version 1.1 basic support
e1558fb Implemented mode switch PHR build and parse (ARMmbed#2665)
cbd8a15 Corrected frame counter storing threshold check
37f7ae9 Time configuration distribution using DHCPv6 vendor data
7415bc7 Added checks for Border Router frame counter space exhaustion (ARMmbed#2660)
f1a65ec Mode switch PHY API (ARMmbed#2663)
e54231b Do not check buffer age when virtual RF driver used (ARMmbed#2662)
cc8c7bd arm_network_certificate_chain_set() returns -2 when PANA is disabled
319dd91 Fix dubious semicolon in #define
2ff51ab Remove extra '\n' in traces
19376c8 Simplify array indexes
c808661 Fix ASAN warnings about overflows in bit shifts
f998008 Fix use-after-free in mac_helper_coordinator_address_set()
4d04541 Wi-SUN header and Paylod IE element lenght future proof update.
935898b Medium network PAN_TIMEOUT changed to 30 minutes
1af7cfe Updated nanostack to be compatible with mbed TLS 3.0 (ARMmbed#2657)
29744e0 If Router Solicitation creation fails no longer tries to retry the RS right away (ARMmbed#2655)
2b889e9 Added automatic test procedure triggering during bootstrap
ed9eb05 GTKs are removed only when fresh GTK hash is received
81ecdc2 Added empty function for test procedure trigger
14439b4 Added support for triggering test procedures
b8a67a9 Update CHANGELOG.md for Nanostack 14.0.0 (ARMmbed#2649)

git-subtree-dir: connectivity/nanostack/sal-stack-nanostack
git-subtree-split: 225a4af
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.

4 participants