vulcand / oxy

Go middlewares for HTTP servers & proxies
Apache License 2.0
2.02k stars 324 forks source link

github.com/mailgun/ttlmap is deprecated #196

Closed diamondburned closed 4 years ago

diamondburned commented 4 years ago

I'm trying to build Caddy 2, but Caddy 2 depends on this dependency (vulcand/oxy), which depends on github.com/mailgun/ttlmap, which depends on github.com/mailgun/minheap, which has tests that depends on launchpad.net/gocheck.

A quick breakdown of the dependencies

launchpad.net/gocheck is deprecated. It has been moved to github.com/go-check/check. This isn't the problem, but only one of the tiny things that sucks.

github.com/mailgun/minheap and github.com/mailgun/ttlmap are both deprecated. They are moved to a bigger monorepo in github.com/mailgun/holster. This annoyingly means that all those huge dependencies listed in the go.mod will be fetched along with holster.

github.com/vulcand/oxy (this project) uses ttlmap, which is not only deprecated (as mentioned above), but also drags down the Bazaar dependency hosted on Launchpad for whatever reason.

Solution

Change github.com/mailgun/ttlmap to github.com/mailgun/holster, which has holster.TTLMap.

diamondburned commented 4 years ago

Made a PR: https://github.com/vulcand/oxy/pull/197

 ❤ ▻ go test ./... -count=1 -v | grep -aE '^ok\s+'
ok      github.com/vulcand/oxy/buffer   0.046s
ok      github.com/vulcand/oxy/cbreaker 0.167s
ok      github.com/vulcand/oxy/connlimit    0.035s
ok      github.com/vulcand/oxy/forward  0.174s
ok      github.com/vulcand/oxy/memmetrics   0.022s
ok      github.com/vulcand/oxy/ratelimit    0.022s
ok      github.com/vulcand/oxy/roundrobin   0.603s
ok      github.com/vulcand/oxy/stream   1.010s
ok      github.com/vulcand/oxy/trace    0.009s
ok      github.com/vulcand/oxy/utils    0.004s
ldez commented 4 years ago

Hello, the main problem with the holster is the dependencies of the holster it-self. It's a "utils/helper" package with too many unrelated dependencies.

https://github.com/mailgun/holster/blob/master/go.mod

And those dependencies are a pain to manage.

diamondburned commented 4 years ago

Yeah, I figured that's the problem, and I wrote it in the issue description. I even thought of copy-pasting code and attributing it the appropriate license, but that seems tedious as I don't know how licenses work.

I think it's still better than a Launchpad dependency though. Bazaar is bizarre.

ldez commented 4 years ago

FYI, this repo is not really maintained, I tried several times to get the rights but the admins of the vulcand organization don't answer.

So don't put to much hope in your PR.

diamondburned commented 4 years ago

Keeping around deprecated dependencies don't sound any better, either. I'm not sure what your solution would be.

diamondburned commented 4 years ago

I just realized vulcand owns this. Sorry.

diamondburned commented 4 years ago

Do you plan on forking this and maintaining it there while archiving/deprecating this repository?

ldez commented 4 years ago

It's an old repository: the core design need to be updated with the current Go practices, and the core itself can be rewritten in another way.

diamondburned commented 4 years ago

Given that Caddy's release candidates are pretty close to completion, is there any faster way than waiting for a rewrite? I personally think it's still usable as-is and just requires some updates.

ldez commented 4 years ago

So you have to fork.