Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Formula/vitess.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
class Vitess < Formula
desc "Database clustering system for horizontal scaling of MySQL"
homepage "https://vitess.io"
url "https://github.com/vitessio/vitess/archive/v8.0.0.tar.gz"
sha256 "c47320b9bcb874b1a6dfca78ec677be7c4bb4c7b2a6470df80bd1bc0ad125e92"
license "Apache-2.0"

depends_on "go" => :build
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If go is used, how are the dependencies/modules handled? Where are their versions specified, are they pinned, etc?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super familiar with Go packaging, but looks like go.sum: https://github.com/vitessio/vitess/blob/master/go.sum

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vitess uses go modules, the dependencies are in go.mod

Copy link
Copy Markdown

@systay systay Dec 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vitess only works using go@1.13

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it builds fine with the latest version and we don't allow new formula to depend on legacy software.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SMillerDev just fyi, go 1.13 isn't legacy, it still receives security updates: https://golang.org/doc/devel/release.html#go1.13.minor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until February, meanwhile there have been 2 new releases. It's not deprecated but it is legacy IMHO.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building might work, but tests do not pass for newer go versions. It's shameful, but still not done. :(

Vitess is only supported on go@1.13 at the moment (I'm one of the maintainers of Vitess)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to agree: we can accept this formula when it builds with latest go.

depends_on "etcd"

def install
system "make", "install", "PREFIX=#{prefix}", "VTROOT=#{buildpath}"
bin.install "bin/mysqlctl"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are mysqlctl and vtctl used outside of our tests? If not, they should go into pkgshare as well

Copy link
Copy Markdown
Contributor Author

@ankane ankane Dec 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't used in Homebrew tests, but are needed in bin if users want to follow the Getting Started tutorial on the Vitess website.

bin.install "bin/vtctl"
pkgshare.install "examples"
end

test do
etcd_server = "localhost:#{free_port}"
fork do
exec Formula["etcd"].opt_bin/"etcd", "--enable-v2=true",
"--data-dir=#{testpath}/etcd",
"--listen-client-urls=http://#{etcd_server}",
"--advertise-client-urls=http://#{etcd_server}"
end
sleep 3

port = free_port
fork do
exec bin/"vtgate", "-topo_implementation", "etcd2",
"-topo_global_server_address", etcd_server,
"-topo_global_root", testpath/"global",
"-port", port.to_s
end
sleep 3

output = shell_output("curl -s localhost:#{port}/debug/health")
assert_equal "ok", output
end
end