anacrolix / utp

Use anacrolix/go-libutp instead
https://github.com/anacrolix/go-libutp
Mozilla Public License 2.0
173 stars 35 forks source link

remove missinggo dep #6

Closed whyrusleeping closed 8 years ago

whyrusleeping commented 8 years ago

It looks like you were only using one function from missinggo, but because of that this package pulled in a whole bunch of other largeish dependencies, including some that fail to build on certain platforms.

This copies the one function from missinggo into the test file and removes that dependency.

anacrolix commented 8 years ago

Rather than do this, I've pushed the fix upstream e3f454a2c932de08b34a6b1dde721e5e81faf1cc. As soon as drone.io support Go 1.5+, I'll add a test to ensure missinggo and utp build on a bunch of platforms. Currently the supported and building set is GOARCH=amd64, and 386 where Go supports it, and all GOOS except plan9. Also linux/arm.

anacrolix commented 8 years ago

https://github.com/anacrolix/missinggo/commit/e3f454a2c932de08b34a6b1dde721e5e81faf1cc

whyrusleeping commented 8 years ago

mmm... i was also hoping to avoid having to import 11 other packages pulled in by missinggo for one function here

jbenet commented 8 years ago

@anacrolix any chance you can use the one function, as @whyrusleeping suggests?

or consider breaking up your missinggo repo into different small repos? asking users to install large amounts of packages is pretty painful in a number of scenarios.

anacrolix commented 8 years ago

Go's flat package specification makes it sucky to make lots of smaller packages. For example not being able to call anacrolix.somePkg.someFunc from code, where somePkg is some common name. Also doesn't Go's recursive package management take care of the logistics for you? Either way, let me check missinggo's deps and get back to you.

jbenet commented 8 years ago

Go's recursive package management take care of the logistics for you?

No, we version lock and archive everything ourselves, to ensure repeatable builds across time, independent of changing circumstances at the original sources (like authors updating packages, breaking interfaces, moving repos, user account renames, users removing repos, repo host services shutting down, repo hosts being DDOSed, ...)

The virtues of go get are many, but its model does not work for us. We care about long term dependability of software, where compiling "just works". The go get model leads to dependency nightmares that make it very hard to collaborate on shared OSS packages. there's no sane version locking, archival through source's destruction, nor easy bundling of small packages (as you mention). In our experience, vanilla go get inevitably leads to vendoring, rehosting, and forking repositories, which also lead to forking version lines. This can all be done sensibly within a "one version world" like a big corp environment where one can re-write all clients of a package, but it is --in our experience-- terrible for async collaboration across long periods of time in "the wide open source world", which has tons of software packages depending on each other at various versions, hoping to work across decades.

We are working on tooling to improve all this, but it's very, very early days and much still to do, improve, and clean.

anacrolix commented 8 years ago

I think missinggo without tests only has the 1 non-standard lib dep. godepgraph -s -horizontal github.com/anacrolix/missinggo | dot -T png > missingo-depgraph.png && open missingo-depgraph.png

whyrusleeping commented 8 years ago

In lieu of this PR, could we work on breaking missinggo up into many smaller packages? for example, we could break the events logic out into its own package (and make the tests not import testify/assert while we're at it please!!).

The MonotonicTime package could be similarly broken up into its own separate package.

The Jitter package could be done as well.

anacrolix commented 8 years ago

I'm not keen to do that. Having a common place for various cross-project generic code has been a great boon to productivity, with regards to licensing, documentation and ease of locating code. I've actually just merged jitter and monotonic time in from being separate packages for this reason.

I'm not a fan of testing frameworks, but testify has proven to be purely orthogonal to the Go testing framework, and avoids wasteful repetition of value comparison and logging of reasons for failure. With the access time changes recently, missinggo now builds on all support Go platforms. Go's linker will take care of stripping out parts you don't use, and your build tool should strip out the nested packages.

anacrolix commented 8 years ago

I'm closing the PR as the original problem of missinggo not building is fixed.

AudriusButkevicius commented 8 years ago

So this is still a bit ridiculous, adds around kk line diff if you try to vendor it.

Audrius@Audrius vendor $ git show 3ecdd3a | grep +++ | grep -v Audrius | grep -v manifest | grep -v '/utp/'
+++ b/vendor/github.com/anacrolix/envpprof/LICENSE
+++ b/vendor/github.com/anacrolix/envpprof/envpprof.go
+++ b/vendor/github.com/anacrolix/missinggo/LICENSE
+++ b/vendor/github.com/anacrolix/missinggo/README.md
+++ b/vendor/github.com/anacrolix/missinggo/addr.go
+++ b/vendor/github.com/anacrolix/missinggo/args/args.go
+++ b/vendor/github.com/anacrolix/missinggo/atime.go
+++ b/vendor/github.com/anacrolix/missinggo/atime_atim.go
+++ b/vendor/github.com/anacrolix/missinggo/atime_atimespec.go
+++ b/vendor/github.com/anacrolix/missinggo/atime_plan9.go
+++ b/vendor/github.com/anacrolix/missinggo/atime_windows.go
+++ b/vendor/github.com/anacrolix/missinggo/bitmap/bitmap.go
+++ b/vendor/github.com/anacrolix/missinggo/bitmap/bitmap_test.go
+++ b/vendor/github.com/anacrolix/missinggo/castslice.go
+++ b/vendor/github.com/anacrolix/missinggo/castslice_test.go
+++ b/vendor/github.com/anacrolix/missinggo/chancond.go
+++ b/vendor/github.com/anacrolix/missinggo/cmd/go-env/main.go
+++ b/vendor/github.com/anacrolix/missinggo/cmd/nop/main.go
+++ b/vendor/github.com/anacrolix/missinggo/cmd/query-escape/main.go
+++ b/vendor/github.com/anacrolix/missinggo/cmd/query-unescape/main.go
+++ b/vendor/github.com/anacrolix/missinggo/copy.go
+++ b/vendor/github.com/anacrolix/missinggo/copy_test.go
+++ b/vendor/github.com/anacrolix/missinggo/croak.go
+++ b/vendor/github.com/anacrolix/missinggo/ctrlflow/ctrlflow.go
+++ b/vendor/github.com/anacrolix/missinggo/doc.go
+++ b/vendor/github.com/anacrolix/missinggo/docopt/docopt.go
+++ b/vendor/github.com/anacrolix/missinggo/empty_value.go
+++ b/vendor/github.com/anacrolix/missinggo/event.go
+++ b/vendor/github.com/anacrolix/missinggo/event_test.go
+++ b/vendor/github.com/anacrolix/missinggo/expvarIndentMap.go
+++ b/vendor/github.com/anacrolix/missinggo/filecache/cache.go
+++ b/vendor/github.com/anacrolix/missinggo/filecache/cache_test.go
+++ b/vendor/github.com/anacrolix/missinggo/filecache/file.go
+++ b/vendor/github.com/anacrolix/missinggo/filecache/fs.go
+++ b/vendor/github.com/anacrolix/missinggo/filecache/lruitems.go
+++ b/vendor/github.com/anacrolix/missinggo/filecache/lruitems_test.go
+++ b/vendor/github.com/anacrolix/missinggo/fs.go
+++ b/vendor/github.com/anacrolix/missinggo/hostmaybeport.go
+++ b/vendor/github.com/anacrolix/missinggo/hostmaybeport_test.go
+++ b/vendor/github.com/anacrolix/missinggo/http.go
+++ b/vendor/github.com/anacrolix/missinggo/httpcontentrange.go
+++ b/vendor/github.com/anacrolix/missinggo/httpcontentrange_test.go
+++ b/vendor/github.com/anacrolix/missinggo/httpfile/defaultfs.go
+++ b/vendor/github.com/anacrolix/missinggo/httpfile/file.go
+++ b/vendor/github.com/anacrolix/missinggo/httpfile/fs.go
+++ b/vendor/github.com/anacrolix/missinggo/httpfile/misc.go
+++ b/vendor/github.com/anacrolix/missinggo/httpresponsestatus.go
+++ b/vendor/github.com/anacrolix/missinggo/httptoo/client.go
+++ b/vendor/github.com/anacrolix/missinggo/httptoo/gzip.go
+++ b/vendor/github.com/anacrolix/missinggo/httptoo/gzip_test.go
+++ b/vendor/github.com/anacrolix/missinggo/httptoo/httptoo.go
+++ b/vendor/github.com/anacrolix/missinggo/httptoo/reverse_proxy.go
+++ b/vendor/github.com/anacrolix/missinggo/httptoo/url.go
+++ b/vendor/github.com/anacrolix/missinggo/inherit.go
+++ b/vendor/github.com/anacrolix/missinggo/inherit_test.go
+++ b/vendor/github.com/anacrolix/missinggo/inproc/inproc.go
+++ b/vendor/github.com/anacrolix/missinggo/ioutil.go
+++ b/vendor/github.com/anacrolix/missinggo/itertools/groupby.go
+++ b/vendor/github.com/anacrolix/missinggo/itertools/groupby_test.go
+++ b/vendor/github.com/anacrolix/missinggo/itertools/iterable.go
+++ b/vendor/github.com/anacrolix/missinggo/itertools/iterator.go
+++ b/vendor/github.com/anacrolix/missinggo/itertools/iterator_test.go
+++ b/vendor/github.com/anacrolix/missinggo/itertools/iterutils.go
+++ b/vendor/github.com/anacrolix/missinggo/jitter.go
+++ b/vendor/github.com/anacrolix/missinggo/jitter_test.go
+++ b/vendor/github.com/anacrolix/missinggo/limitlen.go
+++ b/vendor/github.com/anacrolix/missinggo/mapslice.go
+++ b/vendor/github.com/anacrolix/missinggo/mapslice_test.go
+++ b/vendor/github.com/anacrolix/missinggo/monotonic.go
+++ b/vendor/github.com/anacrolix/missinggo/monotonic_test.go
+++ b/vendor/github.com/anacrolix/missinggo/openflags.go
+++ b/vendor/github.com/anacrolix/missinggo/orderedmap/google_btree.go
+++ b/vendor/github.com/anacrolix/missinggo/orderedmap/orderedmap.go
+++ b/vendor/github.com/anacrolix/missinggo/orderedmap/orderedmap_test.go
+++ b/vendor/github.com/anacrolix/missinggo/orderedmap/skiplist.go
+++ b/vendor/github.com/anacrolix/missinggo/path.go
+++ b/vendor/github.com/anacrolix/missinggo/path_test.go
+++ b/vendor/github.com/anacrolix/missinggo/perf/mutex.go
+++ b/vendor/github.com/anacrolix/missinggo/perf/perf.go
+++ b/vendor/github.com/anacrolix/missinggo/perf/perf_test.go
+++ b/vendor/github.com/anacrolix/missinggo/pproffd/pproffd.go
+++ b/vendor/github.com/anacrolix/missinggo/prioritybitmap/iter.go
+++ b/vendor/github.com/anacrolix/missinggo/prioritybitmap/prioritybitmap.go
+++ b/vendor/github.com/anacrolix/missinggo/prioritybitmap/prioritybitmap_test.go
+++ b/vendor/github.com/anacrolix/missinggo/pubsub/pubsub.go
+++ b/vendor/github.com/anacrolix/missinggo/pubsub/pubsub_test.go
+++ b/vendor/github.com/anacrolix/missinggo/rle.go
+++ b/vendor/github.com/anacrolix/missinggo/rle_test.go
+++ b/vendor/github.com/anacrolix/missinggo/section_read_seeker.go
+++ b/vendor/github.com/anacrolix/missinggo/section_read_seeker_test.go
+++ b/vendor/github.com/anacrolix/missinggo/section_writer.go
+++ b/vendor/github.com/anacrolix/missinggo/selfcert.go
+++ b/vendor/github.com/anacrolix/missinggo/singleflight.go
+++ b/vendor/github.com/anacrolix/missinggo/sort.go
+++ b/vendor/github.com/anacrolix/missinggo/sort_test.go
+++ b/vendor/github.com/anacrolix/missinggo/stack.go
+++ b/vendor/github.com/anacrolix/missinggo/strbool.go
+++ b/vendor/github.com/anacrolix/missinggo/sync.go
+++ b/vendor/github.com/anacrolix/missinggo/testing.go
+++ b/vendor/github.com/anacrolix/missinggo/testing_test.go
+++ b/vendor/github.com/anacrolix/missinggo/timer.go
+++ b/vendor/github.com/anacrolix/missinggo/timer_test.go
+++ b/vendor/github.com/anacrolix/missinggo/units.go
+++ b/vendor/github.com/anacrolix/missinggo/wolf.go
+++ b/vendor/github.com/anacrolix/missinggo/wolf_test.go
+++ b/vendor/github.com/anacrolix/sync/rwmutex.go
+++ b/vendor/github.com/anacrolix/sync/sync.go
+++ b/vendor/github.com/anacrolix/sync/sync_test.go
+++ b/vendor/github.com/bradfitz/iter/README.txt
+++ b/vendor/github.com/bradfitz/iter/iter.go
whyrusleeping commented 8 years ago

I've just been deleting a large portion of missinggo after vendoring. It cuts the vendored size down dramatically and everything still works fine

On Tue, Apr 26, 2016, 14:44 Audrius Butkevicius notifications@github.com wrote:

So this is still a bit ridiculous, adds around a 6k line diff if you try to vendor it.

Audrius@Audrius vendor $ git show 3ecdd3a | grep +++ | grep -v Audrius | grep -v manifest | grep -v '/utp/' +++ b/vendor/github.com/anacrolix/envpprof/LICENSE +++ b/vendor/github.com/anacrolix/envpprof/envpprof.go +++ b/vendor/github.com/anacrolix/missinggo/LICENSE +++ b/vendor/github.com/anacrolix/missinggo/README.md +++ b/vendor/github.com/anacrolix/missinggo/addr.go +++ b/vendor/github.com/anacrolix/missinggo/args/args.go +++ b/vendor/github.com/anacrolix/missinggo/atime.go +++ b/vendor/github.com/anacrolix/missinggo/atime_atim.go +++ b/vendor/github.com/anacrolix/missinggo/atime_atimespec.go +++ b/vendor/github.com/anacrolix/missinggo/atime_plan9.go +++ b/vendor/github.com/anacrolix/missinggo/atime_windows.go +++ b/vendor/github.com/anacrolix/missinggo/bitmap/bitmap.go +++ b/vendor/github.com/anacrolix/missinggo/bitmap/bitmap_test.go +++ b/vendor/github.com/anacrolix/missinggo/castslice.go +++ b/vendor/github.com/anacrolix/missinggo/castslice_test.go +++ b/vendor/github.com/anacrolix/missinggo/chancond.go +++ b/vendor/github.com/anacrolix/missinggo/cmd/go-env/main.go +++ b/vendor/github.com/anacrolix/missinggo/cmd/nop/main.go +++ b/vendor/github.com/anacrolix/missinggo/cmd/query-escape/main.go +++ b/vendor/github.com/anacrolix/missinggo/cmd/query-unescape/main.go +++ b/vendor/github.com/anacrolix/missinggo/copy.go +++ b/vendor/github.com/anacrolix/missinggo/copy_test.go +++ b/vendor/github.com/anacrolix/missinggo/croak.go +++ b/vendor/github.com/anacrolix/missinggo/ctrlflow/ctrlflow.go +++ b/vendor/github.com/anacrolix/missinggo/doc.go +++ b/vendor/github.com/anacrolix/missinggo/docopt/docopt.go +++ b/vendor/github.com/anacrolix/missinggo/empty_value.go +++ b/vendor/github.com/anacrolix/missinggo/event.go +++ b/vendor/github.com/anacrolix/missinggo/event_test.go +++ b/vendor/github.com/anacrolix/missinggo/expvarIndentMap.go +++ b/vendor/github.com/anacrolix/missinggo/filecache/cache.go +++ b/vendor/github.com/anacrolix/missinggo/filecache/cache_test.go +++ b/vendor/github.com/anacrolix/missinggo/filecache/file.go +++ b/vendor/github.com/anacrolix/missinggo/filecache/fs.go +++ b/vendor/github.com/anacrolix/missinggo/filecache/lruitems.go +++ b/vendor/github.com/anacrolix/missinggo/filecache/lruitems_test.go +++ b/vendor/github.com/anacrolix/missinggo/fs.go +++ b/vendor/github.com/anacrolix/missinggo/hostmaybeport.go +++ b/vendor/github.com/anacrolix/missinggo/hostmaybeport_test.go +++ b/vendor/github.com/anacrolix/missinggo/http.go +++ b/vendor/github.com/anacrolix/missinggo/httpcontentrange.go +++ b/vendor/github.com/anacrolix/missinggo/httpcontentrange_test.go +++ b/vendor/github.com/anacrolix/missinggo/httpfile/defaultfs.go +++ b/vendor/github.com/anacrolix/missinggo/httpfile/file.go +++ b/vendor/github.com/anacrolix/missinggo/httpfile/fs.go +++ b/vendor/github.com/anacrolix/missinggo/httpfile/misc.go +++ b/vendor/github.com/anacrolix/missinggo/httpresponsestatus.go +++ b/vendor/github.com/anacrolix/missinggo/httptoo/client.go +++ b/vendor/github.com/anacrolix/missinggo/httptoo/gzip.go +++ b/vendor/github.com/anacrolix/missinggo/httptoo/gzip_test.go +++ b/vendor/github.com/anacrolix/missinggo/httptoo/httptoo.go +++ b/vendor/github.com/anacrolix/missinggo/httptoo/reverse_proxy.go +++ b/vendor/github.com/anacrolix/missinggo/httptoo/url.go +++ b/vendor/github.com/anacrolix/missinggo/inherit.go +++ b/vendor/github.com/anacrolix/missinggo/inherit_test.go +++ b/vendor/github.com/anacrolix/missinggo/inproc/inproc.go +++ b/vendor/github.com/anacrolix/missinggo/ioutil.go +++ b/vendor/github.com/anacrolix/missinggo/itertools/groupby.go +++ b/vendor/github.com/anacrolix/missinggo/itertools/groupby_test.go +++ b/vendor/github.com/anacrolix/missinggo/itertools/iterable.go +++ b/vendor/github.com/anacrolix/missinggo/itertools/iterator.go +++ b/vendor/github.com/anacrolix/missinggo/itertools/iterator_test.go +++ b/vendor/github.com/anacrolix/missinggo/itertools/iterutils.go +++ b/vendor/github.com/anacrolix/missinggo/jitter.go +++ b/vendor/github.com/anacrolix/missinggo/jitter_test.go +++ b/vendor/github.com/anacrolix/missinggo/limitlen.go +++ b/vendor/github.com/anacrolix/missinggo/mapslice.go +++ b/vendor/github.com/anacrolix/missinggo/mapslice_test.go +++ b/vendor/github.com/anacrolix/missinggo/monotonic.go +++ b/vendor/github.com/anacrolix/missinggo/monotonic_test.go +++ b/vendor/github.com/anacrolix/missinggo/openflags.go +++ b/vendor/github.com/anacrolix/missinggo/orderedmap/google_btree.go +++ b/vendor/github.com/anacrolix/missinggo/orderedmap/orderedmap.go +++ b/vendor/github.com/anacrolix/missinggo/orderedmap/orderedmap_test.go +++ b/vendor/github.com/anacrolix/missinggo/orderedmap/skiplist.go +++ b/vendor/github.com/anacrolix/missinggo/path.go +++ b/vendor/github.com/anacrolix/missinggo/path_test.go +++ b/vendor/github.com/anacrolix/missinggo/perf/mutex.go +++ b/vendor/github.com/anacrolix/missinggo/perf/perf.go +++ b/vendor/github.com/anacrolix/missinggo/perf/perf_test.go +++ b/vendor/github.com/anacrolix/missinggo/pproffd/pproffd.go +++ b/vendor/github.com/anacrolix/missinggo/prioritybitmap/iter.go +++ b/vendor/github.com/anacrolix/missinggo/prioritybitmap/prioritybitmap.go +++ b/vendor/github.com/anacrolix/missinggo/prioritybitmap/prioritybitmap_test.go +++ b/vendor/github.com/anacrolix/missinggo/pubsub/pubsub.go +++ b/vendor/github.com/anacrolix/missinggo/pubsub/pubsub_test.go +++ b/vendor/github.com/anacrolix/missinggo/rle.go +++ b/vendor/github.com/anacrolix/missinggo/rle_test.go +++ b/vendor/github.com/anacrolix/missinggo/section_read_seeker.go +++ b/vendor/github.com/anacrolix/missinggo/section_read_seeker_test.go +++ b/vendor/github.com/anacrolix/missinggo/section_writer.go +++ b/vendor/github.com/anacrolix/missinggo/selfcert.go +++ b/vendor/github.com/anacrolix/missinggo/singleflight.go +++ b/vendor/github.com/anacrolix/missinggo/sort.go +++ b/vendor/github.com/anacrolix/missinggo/sort_test.go +++ b/vendor/github.com/anacrolix/missinggo/stack.go +++ b/vendor/github.com/anacrolix/missinggo/strbool.go +++ b/vendor/github.com/anacrolix/missinggo/sync.go +++ b/vendor/github.com/anacrolix/missinggo/testing.go +++ b/vendor/github.com/anacrolix/missinggo/testing_test.go +++ b/vendor/github.com/anacrolix/missinggo/timer.go +++ b/vendor/github.com/anacrolix/missinggo/timer_test.go +++ b/vendor/github.com/anacrolix/missinggo/units.go +++ b/vendor/github.com/anacrolix/missinggo/wolf.go +++ b/vendor/github.com/anacrolix/missinggo/wolf_test.go +++ b/vendor/github.com/anacrolix/sync/rwmutex.go +++ b/vendor/github.com/anacrolix/sync/sync.go +++ b/vendor/github.com/anacrolix/sync/sync_test.go +++ b/vendor/github.com/bradfitz/iter/README.txt +++ b/vendor/github.com/bradfitz/iter/iter.go

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/anacrolix/utp/pull/6#issuecomment-214897272

AudriusButkevicius commented 8 years ago

It shouldn't be a problem in the first place, if things lived in their own directories/packages.

I think there are only 3 packages that are used in utp, which might aswell live in utp.