Skip to content

Commit b1ad7d6

Browse files
luoliwoshangcarlocab
authored andcommitted
llgo:lock Go dependency to [email protected]
1 parent 38bc1b2 commit b1ad7d6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Formula/l/llgo.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Llgo < Formula
2121
end
2222

2323
depends_on "bdw-gc"
24-
depends_on "go"
24+
depends_on "go@1.24"
2525
depends_on "libffi"
2626
depends_on "libuv"
2727
depends_on "lld@19"
@@ -62,7 +62,7 @@ def install
6262

6363
libexec.install "LICENSE", "README.md", "go.mod", "go.sum", "runtime"
6464

65-
path_deps = %w[lld llvm go pkgconf].map { |name| find_dep(name).opt_bin }
65+
path_deps = %w[lld llvm go@1.24 pkgconf].map { |name| find_dep(name).opt_bin }
6666
script_env = { PATH: "#{path_deps.join(":")}:$PATH" }
6767

6868
if OS.linux?
@@ -80,8 +80,9 @@ def install
8080
end
8181

8282
test do
83-
goos = shell_output("go env GOOS").chomp
84-
goarch = shell_output("go env GOARCH").chomp
83+
go = find_dep("[email protected]")
84+
goos = shell_output("#{go.opt_bin}/go env GOOS").chomp
85+
goarch = shell_output("#{go.opt_bin}/go env GOARCH").chomp
8586
assert_equal "llgo v#{version} #{goos}/#{goarch}", shell_output("#{bin}/llgo version").chomp
8687

8788
# Add bdw-gc library path to LD_LIBRARY_PATH, this is a workaround for the libgc.so not found issue
@@ -123,7 +124,7 @@ def install
123124
(testpath/"go.mod").write <<~GOMOD
124125
module hello
125126
GOMOD
126-
system "go", "get", "github.com/goplus/lib"
127+
system go.opt_bin/"go", "get", "github.com/goplus/lib"
127128
# Test llgo run
128129
assert_equal "Hello LLGO by fmt.Println\n" \
129130
"Hello LLGO by c.Printf\n",

0 commit comments

Comments
 (0)