-
Notifications
You must be signed in to change notification settings - Fork 246
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
Bug/remove unused vendor libraries #198 #480
Bug/remove unused vendor libraries #198 #480
Conversation
gene@precision5510:~/go/src/github.com/status-im/status-go/vendor$ ../list-orphaned-vendor-libraries.sh 2>/dev/null github.com/cnf github.com/eapache github.com/Gustav-Simonsson github.com/microsoft github.com/pkg gene@precision5510:~/go/src/github.com/status-im/status-go/vendor$ cloc `../list-orphaned-vendor-libraries.sh 2>/dev/null` 52 text files. 50 unique files. 16 files ignored. http://cloc.sourceforge.net v 1.60 T=0.11 s (317.2 files/s, 42684.4 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Go 33 571 573 3679 YAML 3 2 0 19 ------------------------------------------------------------------------------- SUM: 36 573 573 3698 ------------------------------------------------------------------------------- gene@precision5510:~/go/src/github.com/status-im/status-go/vendor$ du -k `../list-orphaned-vendor-libraries.sh 2>/dev/null` | cut -f 1 - | paste -s -d+ - | bc 872 gene@precision5510:~/go/src/github.com/status-im/status-go/vendor$ git rm `../list-orphaned-vendor-libraries.sh 2>/dev/null`fatal: not removing 'github.com/cnf' recursively without -r gene@precision5510:~/go/src/github.com/status-im/status-go/vendor$ git rm -r `../list-orphaned-vendor-libraries.sh 2>/dev/null` rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/cl.go' rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/context.go' rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/device.go' rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/device12.go' rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/image.go' rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/kernel.go' rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/kernel10.go' rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/kernel12.go' rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/platform.go' rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/program.go' rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/queue.go' rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/types.go' rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/types12.go' rm 'vendor/github.com/Gustav-Simonsson/go-opencl/cl/types_darwin.go' rm 'vendor/github.com/cnf/structhash/.travis.yml' rm 'vendor/github.com/cnf/structhash/LICENSE' rm 'vendor/github.com/cnf/structhash/README.md' rm 'vendor/github.com/cnf/structhash/doc.go' rm 'vendor/github.com/cnf/structhash/structhash.go' rm 'vendor/github.com/eapache/go-resiliency/.gitignore' rm 'vendor/github.com/eapache/go-resiliency/.travis.yml' rm 'vendor/github.com/eapache/go-resiliency/LICENSE' rm 'vendor/github.com/eapache/go-resiliency/README.md' rm 'vendor/github.com/eapache/go-resiliency/batcher/README.md' rm 'vendor/github.com/eapache/go-resiliency/batcher/batcher.go' rm 'vendor/github.com/eapache/go-resiliency/breaker/README.md' rm 'vendor/github.com/eapache/go-resiliency/breaker/breaker.go' rm 'vendor/github.com/eapache/go-resiliency/deadline/README.md' rm 'vendor/github.com/eapache/go-resiliency/deadline/deadline.go' rm 'vendor/github.com/eapache/go-resiliency/retrier/README.md' rm 'vendor/github.com/eapache/go-resiliency/retrier/backoffs.go' rm 'vendor/github.com/eapache/go-resiliency/retrier/classifier.go' rm 'vendor/github.com/eapache/go-resiliency/retrier/retrier.go' rm 'vendor/github.com/eapache/go-resiliency/semaphore/README.md' rm 'vendor/github.com/eapache/go-resiliency/semaphore/semaphore.go' rm 'vendor/github.com/microsoft/go-winio/.gitignore' rm 'vendor/github.com/microsoft/go-winio/LICENSE' rm 'vendor/github.com/microsoft/go-winio/README.md' rm 'vendor/github.com/microsoft/go-winio/backup.go' rm 'vendor/github.com/microsoft/go-winio/file.go' rm 'vendor/github.com/microsoft/go-winio/fileinfo.go' rm 'vendor/github.com/microsoft/go-winio/pipe.go' rm 'vendor/github.com/microsoft/go-winio/privilege.go' rm 'vendor/github.com/microsoft/go-winio/reparse.go' rm 'vendor/github.com/microsoft/go-winio/sd.go' rm 'vendor/github.com/microsoft/go-winio/syscall.go' rm 'vendor/github.com/microsoft/go-winio/zsyscall.go' rm 'vendor/github.com/pkg/errors/.gitignore' rm 'vendor/github.com/pkg/errors/.travis.yml' rm 'vendor/github.com/pkg/errors/LICENSE' rm 'vendor/github.com/pkg/errors/README.md' rm 'vendor/github.com/pkg/errors/errors.go'
Rocking it @feuGeneA - will get the team to review when they can, GoTeam has been under the whip this week 😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Mentioned issue is superseded by #223 — so the proper solution would be to use go dep
(and we had pending PR for that, I guess), but anyway, manually removing unused packages is also a nice thing to have.
Having that, I don't think we want to commit list-unused-vendor-libraries.sh
into the source tree (as we're switching to go dep
at some point anyway). So if you can remove .sh script from list of files added, it looks good to merge.
@feuGeneA I found two more that might be unused. Can you please check these as well?
|
@adambabik those both look familiar to me. I will check on them. @divan yes I saw the |
I see that in Travis the e2e/node test segfaulted with my changes in place. I'll have to look into that too. |
Yesterday :)
Good question. Vendor changes rarely and we really should switch to |
@adambabik they sounded familiar because I had seen them reported in the stderr of my shell command. In reviewing the report I had noticed them because they didn't have any references from .go files. daaku is mentioned in status-react:
I ran the search over both source trees. That doesn't even make sense to do, does it? Should I just delete it from status-go/vendor? kardianos is used in a Dockerfile:
Is this Dockerfile perhaps part of the virtual mobile device local testing facilities? And, I had forgotten about those two, to be honest. I'm glad you pointed them out. Please let me know your disposition on both of these. Thanks. |
@divan I've deleted the shell script. And, for posterity, I modified my initial comment on this PR to show the shell command I used to search for unused vendor libraries, in case that might be helpful for someone to refer back to later. However, please wait a bit to click Merge, until we hear from @adambabik on whether daaku and kardianos should be deleted too. |
@feuGeneA thanks. And I believe it's safe to remove both, |
@feuGeneA it looks like Regarding |
Thanks for the feedback guys. FYI,
|
@divan a mention here as a reminder to merge now that the script has been deleted and |
Remove unused vendor libraries
Below shell transcript shows that we had 5 unused vendor libraries, spanning 3698 lines of code and taking up 872 K of space. It also shows that eliminating the identified unused vendor libraries did not lead to any subsequent vendor libraries being unused.
Below shell transcript can be reproduced if you first paste the following into the command prompt. The resulting function will write unused vendor libraries to stdout, and will write all vendor library references to stderr. It presumes that you're within a status-go checkout whose root directory is named status-go.
here's what we're deleting in this PR:
Solves #198