-
Notifications
You must be signed in to change notification settings - Fork 126
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
RFC: Clean workspace command and/or update option #310
Comments
My first instincts are against this feature request.
For Linux users (macOS ought to work too, unless its BSD
You need to run it from the top level directory in the installation. I can come up with a Windows equivalent if there's interest. |
+1 ! Especially dangerous on Linux systems that have no standard/built-in concept of a "Trash". Stay safe:
Without going that far, I think one new feature and one change would make cleaning much easier:
Related: projects root should be configurable #237
This looks safer because in this case west knows exactly which repos have been removed. There is still the risk of deleting a local branch that hasn't been shared or backed up anywhere. |
Yet:
So @bjda can you elaborate on what happened to you? |
Fetching and using the new
Funny enough it did find a spurious "net-tools" directory leftover, I guess from its older location UPDATE: this scans only the top level. A more generic version would be much more complicated - and better implemented in west itself. |
Unrelated, but I personally think this sort of guard rail is not a good idea. Primarily because your muscle memory starts to rely on it, with potentially disastrous results on an unfamiliar server. It also can mess up expectations for things like scripts executed with
You didn't, but here's one: #311
I would also like some more information, as 'leftover' (meaning 'projects in the old manifest not known to the new one') projects should have no effect if your repositories and build directory are clean.
It can't do what you want, I don't think. West only parses the manifest file, exactly as it is on disk, so So the only thing west could do to find "unknown" repositories is crawl the entire directory tree rooted at The "west never touches your manifest repository" guarantee was a design decision. Its main drawback is that it prevents features like this, but the benefits outweigh that drawback IMO..
So
As far as I can tell, this is one of the main reasons why the This use of symlinks is one of the main reasons we didn't use repo for zephyr: symlinks don't work on Windows :). |
Yep, it got moved in zephyr d3977996088a356107257adb828be649ec2fa7e3. The old one got left behind because west forgot it existed when you pulled zephyr to at least that version. Moving projects around in a west manifest will always cause this sort of situation. Note that nordic downstream does have a way to compare upstream and downstream: (^^ @bjda you may be interested in that as well) At some point, I expect that extension to mature to the point that we can merge it into mainline zephyr as a |
@marc-hb When the issues have occured until now, I have just reinitialized to fix it and moved on. When there is time, I will try to reproduce the errors and post some specific examples |
@bjda please reopen if you can post some specific examples of incorrect behavior. In the meantime, I believe |
I have on multiple occasions had trouble compiling applications after checking out different versions and
west update
ing our multi-repo downstream (nRF Connect SDK), because of leftover repos and files. It has been fixable by deleting all the repos except the manifest repo, and runningwest update
. This is especially prominent when using a single workspace and jumping significantly forward/backward in time.I propose we introduce a
west clean
command that approximates a fresh workspace, without re-downloading all the repos. The steps could be:git clean -fdx
in each project folder.Alternatively – or complementarily – adding this functionality as an option in
west update
could be useful. Then,west update --clean
could be used to bring the rest of the workspace in line with the manifest repo with a single command.There are several points of discussion, including but probably not limited to:
clean
,reset
or something elseThe text was updated successfully, but these errors were encountered: