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

Waf add submodulesclean #25196

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

hendjoshsr71
Copy link
Member

This adds a waf command and completions for the submodulesync script.
Simpler version of #23898 since it doesn't mess with normal distclean

Note : I called it submodulesclean to be more in common with other projects but am not tied to it.

To Fix: I couldn't get ./waf --help to show the submodulesclean command ?

@magicrub
Copy link
Contributor

magicrub commented Oct 6, 2023

I've totally punted on all this and added "rm build -rf; rm modules -rf" to that shell script on any long-term branch I use. Going from old to new releases is painful

@hendjoshsr71
Copy link
Member Author

I've totally punted on all this and added "rm build -rf; rm modules -rf" to that shell script on any long-term branch I use. Going from old to new releases is painful

Do you find the rm modules -rf necessary often? IE above and beyond the sync script?

I could make submodulesync and submodulesclean where clean also removes.

@hendjoshsr71
Copy link
Member Author

Added a submodulesclean and sync

wscript Outdated Show resolved Hide resolved
@Ryanf55
Copy link
Collaborator

Ryanf55 commented Jan 15, 2024

I love the idea of adding the submodule sync as a function in waf! I'm opposed to calling deleting trees of files clean, and would prefer more scare language like force-clean that scare developers enough to the read the help text before accidentally deleting untracked changes in their modules. I regularly work on stuff in the modules folder for DDS.

@hendjoshsr71 hendjoshsr71 force-pushed the pr/waf_add_submodulesclean branch from cb44ac9 to c5b421b Compare January 16, 2024 01:20
@hendjoshsr71
Copy link
Member Author

I love the idea of adding the submodule sync as a function in waf! I'm opposed to calling deleting trees of files clean, and would prefer more scare language like force-clean that scare developers enough to the read the help text before accidentally deleting untracked changes in their modules. I regularly work on stuff in the modules folder for DDS.

Sure I've done this. Though I preferred submoduleclean to match the other autopilot firmware options

@MichelleRos
Copy link
Contributor

Do you find the rm modules -rf necessary often? IE above and beyond the sync script?

I do. To the point that I've added a git alias for it. Switching between old branches and current master is what does it most often. The submodule sync usually doesn't work for me. It's also quite slow and spits way too much stuff to the terminal, so if the normal git surf (git submodule --update --recursive --force) doesn't work then I just do the rm -rf modules and then git surf to get the modules back. Doesn't need the syncing at all.

Might be better to just do git surf after the rm bit rather than the submodule syncing here?
I don't think I've found a case where I need a submodule sync after having deleted the whole modules folder.

@tridge tridge merged commit f1ca5be into ArduPilot:master Jan 16, 2024
91 checks passed
@Ryanf55
Copy link
Collaborator

Ryanf55 commented Jan 21, 2024

Eh, doesn't seem like submodulesclean works. It made the situation worse.

ryan@B650-970:~/Dev/ros2_ws/src/ardupilot$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   modules/ChibiOS (new commits)

no changes added to commit (use "git add" and/or "git commit -a")
ryan@B650-970:~/Dev/ros2_ws/src/ardupilot$ ./waf sub
sub                    submodule_force_clean  submodulesync          
ryan@B650-970:~/Dev/ros2_ws/src/ardupilot$ ./waf sub
sub                    submodule_force_clean  submodulesync          
ryan@B650-970:~/Dev/ros2_ws/src/ardupilot$ ./waf submodule_force_clean 
Submodule 'modules/lwip' (https://github.com/ArduPilot/lwip.git) registered for path 'modules/lwip'
fatal: not a git repository: /home/ryan/Dev/ros2_ws/src/ardupilot/modules/lwip/../../.git/modules/modules/lwip
Failed to clone 'modules/lwip'. Retry scheduled
BUG: submodule considered for cloning, doesn't need cloning any more?
Submodule path 'modules/ChibiOS': checked out '6a85082c715457d1e0cc9627f9939f349de1143e'
Submodule path 'modules/CrashDebug': checked out '599965086437137ec0fe66e185611f43f335f889'
Submodule path 'modules/CrashDebug/CrashCatcher': checked out '4cf6e11df3a081b0f573a7834ed8e1e4000af73e'
Submodule path 'modules/CrashDebug/CrashCatcher/CppUTest': checked out '011f371fdb5d7e441fb023be67295783e053df4a'
Submodule path 'modules/CrashDebug/mri': checked out 'b35c89451b41a45b7f5b580acaff555315ac88e2'
Submodule path 'modules/CrashDebug/mri/CppUTest': checked out '011f371fdb5d7e441fb023be67295783e053df4a'
Submodule path 'modules/DroneCAN/DSDL': checked out 'de93d9c8bb76de1b093050e3a31e4d4ce539c577'
Submodule path 'modules/DroneCAN/dronecan_dsdlc': checked out 'ebaf96860a11a4cc43c01df6b651df143c6cde2d'
Submodule path 'modules/DroneCAN/libcanard': checked out '22102c717db29cc2a2c2869ff80f3e4389704d89'
Submodule path 'modules/DroneCAN/libcanard/drivers/avr/avr-can-lib': checked out '9c6bc9118de66d6edaf1b8539e2b9717ba26d123'
Submodule path 'modules/DroneCAN/pydronecan': checked out '19fdf2e5b383243ccdb1094edae0603cf11469e8'
Submodule path 'modules/Micro-CDR': checked out '3d1b17703c7cf4f22def2910bc845bdb5152d7b5'
Submodule path 'modules/Micro-XRCE-DDS-Client': checked out '97175304425c5bee87c6fddd99de1ef8d0c394dc'
Submodule path 'modules/gbenchmark': checked out 'd572f4777349d43653b21d6c2fc63020ab326db2'
Submodule path 'modules/gsoap': checked out 'e1f690585d4803402584962bfaa8240ecaf1db30'
Submodule path 'modules/gtest': checked out 'c5fed93f941865a0e912e9baf46ded713506590a'
fatal: could not get a repository handle for submodule 'modules/lwip'
Synchronizing submodule url for 'modules/ChibiOS'
Synchronizing submodule url for 'modules/CrashDebug'
Synchronizing submodule url for 'modules/CrashDebug/CrashCatcher'
Synchronizing submodule url for 'modules/CrashDebug/CrashCatcher/CppUTest'
Synchronizing submodule url for 'modules/CrashDebug/mri'
Synchronizing submodule url for 'modules/CrashDebug/mri/CppUTest'
Synchronizing submodule url for 'modules/DroneCAN/DSDL'
Synchronizing submodule url for 'modules/DroneCAN/dronecan_dsdlc'
Synchronizing submodule url for 'modules/DroneCAN/libcanard'
Synchronizing submodule url for 'modules/DroneCAN/libcanard/drivers/avr/avr-can-lib'
Synchronizing submodule url for 'modules/DroneCAN/pydronecan'
Synchronizing submodule url for 'modules/Micro-CDR'
Synchronizing submodule url for 'modules/Micro-XRCE-DDS-Client'
Synchronizing submodule url for 'modules/gbenchmark'
Synchronizing submodule url for 'modules/gsoap'
Synchronizing submodule url for 'modules/gtest'
Synchronizing submodule url for 'modules/lwip'
fatal: not a git repository: modules/lwip/../../.git/modules/modules/lwip
Submodule path 'modules/ChibiOS': checked out '6a85082c715457d1e0cc9627f9939f349de1143e'
Submodule path 'modules/CrashDebug': checked out '599965086437137ec0fe66e185611f43f335f889'
Submodule path 'modules/CrashDebug/CrashCatcher': checked out '4cf6e11df3a081b0f573a7834ed8e1e4000af73e'
Submodule path 'modules/CrashDebug/CrashCatcher/CppUTest': checked out '011f371fdb5d7e441fb023be67295783e053df4a'
Submodule path 'modules/CrashDebug/mri': checked out 'b35c89451b41a45b7f5b580acaff555315ac88e2'
Submodule path 'modules/CrashDebug/mri/CppUTest': checked out '011f371fdb5d7e441fb023be67295783e053df4a'
Submodule path 'modules/DroneCAN/DSDL': checked out 'de93d9c8bb76de1b093050e3a31e4d4ce539c577'
Submodule path 'modules/DroneCAN/dronecan_dsdlc': checked out 'ebaf96860a11a4cc43c01df6b651df143c6cde2d'
Submodule path 'modules/DroneCAN/libcanard': checked out '22102c717db29cc2a2c2869ff80f3e4389704d89'
Submodule path 'modules/DroneCAN/libcanard/drivers/avr/avr-can-lib': checked out '9c6bc9118de66d6edaf1b8539e2b9717ba26d123'
Submodule path 'modules/DroneCAN/pydronecan': checked out '19fdf2e5b383243ccdb1094edae0603cf11469e8'
Submodule path 'modules/Micro-CDR': checked out '3d1b17703c7cf4f22def2910bc845bdb5152d7b5'
Submodule path 'modules/Micro-XRCE-DDS-Client': checked out '97175304425c5bee87c6fddd99de1ef8d0c394dc'
Submodule path 'modules/gbenchmark': checked out 'd572f4777349d43653b21d6c2fc63020ab326db2'
Submodule path 'modules/gsoap': checked out 'e1f690585d4803402584962bfaa8240ecaf1db30'
Submodule path 'modules/gtest': checked out 'c5fed93f941865a0e912e9baf46ded713506590a'
fatal: could not get a repository handle for submodule 'modules/lwip'
Synchronizing submodule url for 'modules/ChibiOS'
Synchronizing submodule url for 'modules/CrashDebug'
Synchronizing submodule url for 'modules/CrashDebug/CrashCatcher'
Synchronizing submodule url for 'modules/CrashDebug/CrashCatcher/CppUTest'
Synchronizing submodule url for 'modules/CrashDebug/mri'
Synchronizing submodule url for 'modules/CrashDebug/mri/CppUTest'
Synchronizing submodule url for 'modules/DroneCAN/DSDL'
Synchronizing submodule url for 'modules/DroneCAN/dronecan_dsdlc'
Synchronizing submodule url for 'modules/DroneCAN/libcanard'
Synchronizing submodule url for 'modules/DroneCAN/libcanard/drivers/avr/avr-can-lib'
Synchronizing submodule url for 'modules/DroneCAN/pydronecan'
Synchronizing submodule url for 'modules/Micro-CDR'
Synchronizing submodule url for 'modules/Micro-XRCE-DDS-Client'
Synchronizing submodule url for 'modules/gbenchmark'
Synchronizing submodule url for 'modules/gsoap'
Synchronizing submodule url for 'modules/gtest'
Synchronizing submodule url for 'modules/lwip'
fatal: not a git repository: modules/lwip/../../.git/modules/modules/lwip
Submodule path 'modules/ChibiOS': checked out '6a85082c715457d1e0cc9627f9939f349de1143e'
Submodule path 'modules/CrashDebug': checked out '599965086437137ec0fe66e185611f43f335f889'
Submodule path 'modules/CrashDebug/CrashCatcher': checked out '4cf6e11df3a081b0f573a7834ed8e1e4000af73e'
Submodule path 'modules/CrashDebug/CrashCatcher/CppUTest': checked out '011f371fdb5d7e441fb023be67295783e053df4a'
Submodule path 'modules/CrashDebug/mri': checked out 'b35c89451b41a45b7f5b580acaff555315ac88e2'
Submodule path 'modules/CrashDebug/mri/CppUTest': checked out '011f371fdb5d7e441fb023be67295783e053df4a'
Submodule path 'modules/DroneCAN/DSDL': checked out 'de93d9c8bb76de1b093050e3a31e4d4ce539c577'
Submodule path 'modules/DroneCAN/dronecan_dsdlc': checked out 'ebaf96860a11a4cc43c01df6b651df143c6cde2d'
Submodule path 'modules/DroneCAN/libcanard': checked out '22102c717db29cc2a2c2869ff80f3e4389704d89'
Submodule path 'modules/DroneCAN/libcanard/drivers/avr/avr-can-lib': checked out '9c6bc9118de66d6edaf1b8539e2b9717ba26d123'
Submodule path 'modules/DroneCAN/pydronecan': checked out '19fdf2e5b383243ccdb1094edae0603cf11469e8'
Submodule path 'modules/Micro-CDR': checked out '3d1b17703c7cf4f22def2910bc845bdb5152d7b5'
Submodule path 'modules/Micro-XRCE-DDS-Client': checked out '97175304425c5bee87c6fddd99de1ef8d0c394dc'
Submodule path 'modules/gbenchmark': checked out 'd572f4777349d43653b21d6c2fc63020ab326db2'
Submodule path 'modules/gsoap': checked out 'e1f690585d4803402584962bfaa8240ecaf1db30'
Submodule path 'modules/gtest': checked out 'c5fed93f941865a0e912e9baf46ded713506590a'
fatal: could not get a repository handle for submodule 'modules/lwip'
Synchronizing submodule url for 'modules/ChibiOS'
Synchronizing submodule url for 'modules/CrashDebug'
Synchronizing submodule url for 'modules/CrashDebug/CrashCatcher'
Synchronizing submodule url for 'modules/CrashDebug/CrashCatcher/CppUTest'
Synchronizing submodule url for 'modules/CrashDebug/mri'
Synchronizing submodule url for 'modules/CrashDebug/mri/CppUTest'
Synchronizing submodule url for 'modules/DroneCAN/DSDL'
Synchronizing submodule url for 'modules/DroneCAN/dronecan_dsdlc'
Synchronizing submodule url for 'modules/DroneCAN/libcanard'
Synchronizing submodule url for 'modules/DroneCAN/libcanard/drivers/avr/avr-can-lib'
Synchronizing submodule url for 'modules/DroneCAN/pydronecan'
Synchronizing submodule url for 'modules/Micro-CDR'
Synchronizing submodule url for 'modules/Micro-XRCE-DDS-Client'
Synchronizing submodule url for 'modules/gbenchmark'
Synchronizing submodule url for 'modules/gsoap'
Synchronizing submodule url for 'modules/gtest'
Synchronizing submodule url for 'modules/lwip'
fatal: not a git repository: modules/lwip/../../.git/modules/modules/lwip
'submodule_force_clean' finished successfully (3.857s)
ryan@B650-970:~/Dev/ros2_ws/src/ardupilot$ git status
fatal: not a git repository: modules/lwip/../../.git/modules/modules/lwip

@hendjoshsr71 hendjoshsr71 deleted the pr/waf_add_submodulesclean branch April 6, 2024 03:31
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