skelterjohn/go-gb

gb -N leaves can leave .a files when project reorganised

kortschak opened this issue · 2 comments

When a projects topology is reorganised, .a files may be left behind. These taint the build space and can block a build. Obviously this can be avoided by 'find . -name "*.a" -delete', but including that functionality in 'gb -N' would be nice.

I don't see an easy way to do this without adding a lot of infrastructure to the build process...

If you're reorganizing something that doesn't get installed, 'gb -c' should do the trick - any _obj folders will get tossed (if this is not happening it's a bug, and please let me know).

But as far as removing things installed to $GOROOT/pkg or $GOPATH/pkg, I don't think it's a good idea to give -N more power than it already has. Currently -N can't ruin anything that -i doesn't already ruin (in terms of deleting/overwriting files that belong to something else), so it's "safe", sorta. Letting it remove more files seems dangerous.

In the mean time, running 'gb -N' before a reorg of an installed project is a good idea (though I'm sure that was obvious to you, in retrospect).

Sorry, this is going to be a won't-fix.

Fair enough. In retrospect, -N prior to reorg would have been good. Cheers and thanks for a very useful tool.