Skip to content

Commit 7ad17b3

Browse files
BrewTestBotbranchv
andcommitted
chronograf 1.11.0
Co-authored-by: Branch Vincent <branchevincent@gmail.com>
1 parent a7bc311 commit 7ad17b3

1 file changed

Lines changed: 31 additions & 29 deletions

File tree

Formula/c/chronograf.rb

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
class Chronograf < Formula
22
desc "Open source monitoring and visualization UI for the TICK stack"
33
homepage "https://docs.influxdata.com/chronograf/latest/"
4-
url "https://github.com/influxdata/chronograf/archive/refs/tags/1.10.9.tar.gz"
5-
sha256 "15c7cc80cc5e1e2d6ef33bffce1b6a26729f45b80453714f424eec03974f7e14"
4+
url "https://github.com/influxdata/chronograf/archive/refs/tags/1.11.0.tar.gz"
5+
sha256 "11e1228f3b193d7b9cafad6ff4903f0f920a03432c5045ee620c105e361ced10"
66
license "AGPL-3.0-or-later"
77
head "https://github.com/influxdata/chronograf.git", branch: "master"
88

@@ -16,38 +16,38 @@ class Chronograf < Formula
1616
end
1717

1818
depends_on "go" => :build
19-
# Avoid C++20 from Node 23+ until "@parcel/watcher >= 2.2.0" for "node-addon-api >= 4"
20-
# Issue ref: https://github.com/nodejs/node-addon-api/issues/1007
21-
depends_on "node@22" => :build
22-
depends_on "python-setuptools" => :build
19+
depends_on "node" => :build
20+
depends_on "pkg-config-wrapper" => :build
21+
depends_on "pkgconf" => :build
22+
depends_on "rust" => :build
2323
depends_on "yarn" => :build
2424
depends_on "influxdb"
2525
depends_on "kapacitor"
2626

27-
def install
28-
# Check if workarounds can be removed
29-
if build.stable?
30-
yarn_lock = File.read("yarn.lock")
31-
32-
# distutils usage removed in https://github.com/nodejs/node-gyp/commit/707927cd579205ef2b4b17e61c1cce24c056b452
33-
node_gyp_version = Version.new(yarn_lock[%r{/node-gyp[._-]v?(\d+(?:\.\d+)+)\.t}i, 1])
34-
odie "Remove `python-setuptools` dependency!" if node_gyp_version >= 10
27+
on_macos do
28+
depends_on "llvm" => :build if DevelopmentTools.clang_build_version <= 1699
29+
end
3530

36-
# node 22 (V8 12) fix in https://github.com/nodejs/nan/commit/1b630ddb3412cde35b64513662b440f9fd71e1ff
37-
nan_version = Version.new(yarn_lock[%r{/nan[._-]v?(\d+(?:\.\d+)+)\.t}i, 1])
38-
odie "Remove `nan` resolution workaround!" if nan_version >= "2.19.0"
39-
end
31+
fails_with :clang do
32+
build 1699
33+
end
4034

41-
# Workaround to build with newer node until `nan` dependency is updated
42-
# https://github.com/influxdata/chronograf/issues/6040
35+
def install
36+
ENV["CGO_ENABLED"] = "1"
37+
ENV["npm_config_build_from_source"] = "true"
38+
ENV["PKG_CONFIG"] = Formula["pkg-config-wrapper"].opt_bin/"pkg-config-wrapper"
39+
# Force newer node-addon-api for arm linux until "@parcel/watcher >= 2.2.0" for "node-addon-api >= 4"
40+
# https://github.com/nodejs/node-addon-api/issues/1007
4341
package_json = JSON.parse(File.read("package.json"))
44-
(package_json["resolutions"] ||= {})["nan"] = "2.23.0"
42+
(package_json["resolutions"] ||= {})["node-addon-api"] = "7.1.1"
4543
File.write("package.json", JSON.pretty_generate(package_json))
4644

47-
ENV["npm_config_build_from_source"] = "true"
48-
ENV.deparallelize
49-
system "make"
50-
bin.install "chronograf"
45+
system "yarn", "--cwd=ui", "install"
46+
system "yarn", "--cwd=ui", "build"
47+
48+
ldflags = "-s -w -X main.version=#{version}"
49+
system "go", "build", *std_go_args(ldflags:), "./cmd/chronograf"
50+
system "go", "build", *std_go_args(ldflags:, output: bin/"chronoctl"), "./cmd/chronoctl"
5151
end
5252

5353
service do
@@ -59,13 +59,15 @@ def install
5959
end
6060

6161
test do
62+
assert_match version.to_s, shell_output("#{bin}/chronograf --version")
63+
6264
port = free_port
63-
pid = spawn bin/"chronograf", "--port=#{port}"
64-
sleep 10
65-
output = shell_output("curl -s 0.0.0.0:#{port}/chronograf/v1/")
66-
sleep 1
65+
log = testpath/"chronograf.log"
66+
pid = spawn bin/"chronograf", "--port=#{port}", out: log.to_s, err: log.to_s
67+
output = shell_output("curl -s --retry 5 --retry-connrefused 0.0.0.0:#{port}/chronograf/v1/")
6768
assert_match "/chronograf/v1/layouts", output
6869
ensure
70+
ohai "Server logs", log.read
6971
Process.kill("SIGTERM", pid)
7072
Process.wait(pid)
7173
end

0 commit comments

Comments
 (0)