Skip to content

Commit f3d41e1

Browse files
authored
Merge pull request #251680 from Homebrew/grafana-alloy-arm64-linux
grafana-alloy: work around patchelf.rb bug when cgo is required
2 parents a3eb9ad + cc261ef commit f3d41e1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Formula/g/grafana-alloy.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ class GrafanaAlloy < Formula
2525
conflicts_with "alloy-analyzer", because: "both install `alloy` binaries"
2626

2727
def install
28+
# Workaround to avoid patchelf corruption when cgo is required (for godror)
29+
if OS.linux? && Hardware::CPU.arch == :arm64
30+
ENV["CGO_ENABLED"] = "1"
31+
ENV["GO_EXTLINK_ENABLED"] = "1"
32+
ENV.append "GOFLAGS", "-buildmode=pie"
33+
end
34+
2835
ldflags = %W[
2936
-s -w
3037
-X github.com/grafana/alloy/internal/build.Branch=HEAD

0 commit comments

Comments
 (0)