-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Conversation
From the original discussion here #20839, I've been given to understand that we could "bottle" ngrok for faster installation. The wiki page at https://github.com/mxcl/homebrew/wiki/Bottles seems to imply that might be happening automatically now, I'm not sure. Any advice from the homebrew devs on whether we should do that or if you will do that automatically now would be much appreciated. |
Why does this require bazaar and mercurial to install? Because of how it is downloading dependencies using GoBuild? |
That is my understanding, @inconshreveable would be the authority on it though. |
@adamv Yes, that's correct. It depends on go-yaml which is hosted with bzr and also on osext and log4go which are hosted with hg. It's possible that dependencies of ngrok's dependencies may also depend on something else that require hg or bzr, but there are none that I know of. |
@inconshreveable Is there any way we can download them in advance? We can bottle it for you on request when we pull this. |
@MikeMcQuaid What exactly do you mean by download them in advance? Would the formula still maintain the dependency on |
If possible we like to have |
Is there an API that a formula can call that causes Homebrew to download and cache, or would anything that is currently downloaded need to be handled as other formula and then dependent on? |
@MikeMcQuaid So, I'm not entirely sure I understand what you're asking, but if the goal is to make installation happen without downloading anything, you have a couple of options:
This will fetch (almost) all of the dependencies need to compile ngrok without downloading anything from the internet. Note: you'll need to have golang/bzr/hg installed to run "make deps". I can fix the "almost" part of this if that's the route you want to go down. One other thing to note is that the golang community currently hasn't picked a direction on how to do dependency management. There are a couple options that are gaining traction, but nothing widely accepted yet. This means that ngrok could conceivably start failing to compile if any of them change their API since it basically always builds against "head" of all dependencies. I have a TODO item to evaluate options around this but I haven't gotten to it yet. |
@inconshreveable We can bottle it, yep. If we can't make it outside the install method then don't worry. That they build against head versions every time I'm a bit nervous about though. @adamv @mistydemeo @jacknagel @manphiz, thoughts? |
@MikeMcQuaid It makes me nervous too. It hasn't burned me yet, but it's only a matter of time. I have other higher priority things to take care of right now, but let me know if this is a showstopper and I'll try to focus on it sooner. |
Maybe ngrok can bundle some working snapshots of those dependencies, which seems easier. Though it should be careful to install them to private locations to avoid future conflicts if they get included. @inconshreveable how do you think? |
Yes, formulae can define resources that Homebrew will manage downloading and caching, and which can be called within the formula itself whenever desired. For example, take a look at the smlnj formula which defines resources, then stages them within the temporary build directory. |
@@ -0,0 +1,26 @@ | |||
require 'formula' | |||
require 'requirement' |
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.
Don't need to require requirement
I'd prefer a bottle, bazaar is taking a long time to download/install as I write this. |
I'm still not a fan of the fact that this pulls down unversioned dependencies with Otherwise it looks fine. |
Let's bottle it. |
(My concern specifically is that if an unversioned dependency changes in a way that breaks a downstream project, we're the ones who will get bug reports about it not building.) |
I'm OK with it being bottled. |
|
||
depends_on 'bazaar' => :build | ||
depends_on 'go' => :build | ||
depends_on MercurialDependency => :build |
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.
This should just be depends_on :hg => :build
.
There's no "real" test command with ngrok mostly because ngrok's primary function involves reaching an external service. If the network is down (or the service is down), the command would fail even if the installation technically was successful. @adamv I also don't like that's pulling unversioned dependencies. I'd like to fix this and have just been really short on time. I'll try to get that set up ASAP for you guys. It will also might eliminate the dependencies on hg/bzr when I do it, so that would be a win as well. |
This formula adds support for ngrok[1]. ngrok is an application that allows you "to securely expose a local web server to the Internet and capture all traffic for detailed introspection and replay". The formula has build dependencies on Baazar, Go, and Mercurial. The application is go based and therefore uses the go compiler to build itself. [1]: https://ngrok.com
@MikeMcQuaid I've updated mercurial dependency as requested. I'm open to a more robust test but as @inconshreveable mentions, there's a lot of room for false negatives. Is there an example of another formula (for a product that makes a connection to a web-service) that I should use as inspiration? |
I'd rather a false-negative than a test that does nothing except print a string. If there's something you can do that will work assuming the service and internet connection are both up: great. |
Any progress on this issue? |
Sorry, haven't gotten to this yet. Will try to hammer this out today for you guys. |
Any news on this? |
Status? |
@taoeffect If you want to speed things up create your own PR with the requested changes. |
Closing in favor of #23732 |
I guess @jacknagel meant in favor of #27598 |
This formula adds support for ngrok. ngrok is an application that allows you "to securely expose a local web server to the Internet and capture all traffic for detailed introspection and replay". The formula has dependencies on Baazar, Go, and Mercurial. The application is go based and therefore uses the go compiler to build itself.