diff --git a/Aliases/go@1.25 b/Aliases/go@1.26 similarity index 100% rename from Aliases/go@1.25 rename to Aliases/go@1.26 diff --git a/Formula/g/go.rb b/Formula/g/go.rb index e63a73a9fa9f..1de28aaf39df 100644 --- a/Formula/g/go.rb +++ b/Formula/g/go.rb @@ -1,9 +1,9 @@ class Go < Formula desc "Open source programming language to build simple/reliable/efficient software" homepage "https://go.dev/" - url "https://go.dev/dl/go1.25.6.src.tar.gz" - mirror "https://fossies.org/linux/misc/go1.25.6.src.tar.gz" - sha256 "58cbf771e44d76de6f56d19e33b77d745a1e489340922875e46585b975c2b059" + url "https://go.dev/dl/go1.26rc2.src.tar.gz" + mirror "https://fossies.org/linux/misc/go1.26rc2.src.tar.gz" + sha256 "e25cc8c5ffe1241a5d87199209243d70c24847260fb1ea7b163a95b537de65ac" license "BSD-3-Clause" head "https://go.googlesource.com/go.git", branch: "master" @@ -34,13 +34,13 @@ class Go < Formula # Don't update this unless this version cannot bootstrap the new version. resource "gobootstrap" do checksums = { - "darwin-arm64" => "416c35218edb9d20990b5d8fc87be655d8b39926f15524ea35c66ee70273050d", - "darwin-amd64" => "e7bbe07e96f0bd3df04225090fe1e7852ed33af37c43a23e16edbbb3b90a5b7c", - "linux-arm64" => "fd017e647ec28525e86ae8203236e0653242722a7436929b1f775744e26278e7", - "linux-amd64" => "4fa4f869b0f7fc6bb1eb2660e74657fbf04cdd290b5aef905585c86051b34d43", + "darwin-arm64" => "098d0c039357c3652ec6c97d5451bc4dc24f7cf30ed902373ed9a8134aab2d29", + "darwin-amd64" => "4b9cc6771b56645da35a83a5424ae507f3250829b0d227e75f57b73e72da1f76", + "linux-arm64" => "4e02e2979e53b40f3666bba9f7e5ea0b99ea5156e0824b343fd054742c25498d", + "linux-amd64" => "bddf8e653c82429aea7aec2520774e79925d4bb929fe20e67ecc00dd5af44c50", } - version "1.22.12" + version "1.24.12" on_arm do on_macos do diff --git a/Formula/g/go@1.25.rb b/Formula/g/go@1.25.rb new file mode 100644 index 000000000000..b6830091d664 --- /dev/null +++ b/Formula/g/go@1.25.rb @@ -0,0 +1,86 @@ +class GoAT125 < Formula + desc "Open source programming language to build simple/reliable/efficient software" + homepage "https://go.dev/" + url "https://go.dev/dl/go1.25.6.src.tar.gz" + mirror "https://fossies.org/linux/misc/go1.25.6.src.tar.gz" + sha256 "58cbf771e44d76de6f56d19e33b77d745a1e489340922875e46585b975c2b059" + license "BSD-3-Clause" + + livecheck do + url "https://go.dev/dl/?mode=json" + regex(/^go[._-]?v?(1\.25(?:\.\d+)*)[._-]src\.t.+$/i) + strategy :json do |json, regex| + json.map do |release| + next if release["stable"] != true + next if release["files"].none? { |file| file["filename"].match?(regex) } + + release["version"][/(\d+(?:\.\d+)+)/, 1] + end + end + end + + keg_only :versioned_formula + + depends_on "go" => :build + + def install + libexec.install Dir["*"] + + cd libexec/"src" do + # Set portable defaults for CC/CXX to be used by cgo + with_env(CC: "cc", CXX: "c++") { system "./make.bash" } + end + + bin.install_symlink Dir[libexec/"bin/go*"] + + # Remove useless files. + # Breaks patchelf because folder contains weird debug/test files + rm_r(libexec/"src/debug/elf/testdata") + # Binaries built for an incompatible architecture + rm_r(libexec/"src/runtime/pprof/testdata") + # Remove testdata with binaries for non-native architectures. + rm_r(libexec/"src/debug/dwarf/testdata") + end + + test do + (testpath/"hello.go").write <<~GO + package main + + import "fmt" + + func main() { + fmt.Println("Hello World") + } + GO + + # Run go fmt check for no errors then run the program. + # This is a a bare minimum of go working as it uses fmt, build, and run. + system bin/"go", "fmt", "hello.go" + assert_equal "Hello World\n", shell_output("#{bin}/go run hello.go") + + with_env(GOOS: "freebsd", GOARCH: "amd64") do + system bin/"go", "build", "hello.go" + end + + (testpath/"hello_cgo.go").write <<~GO + package main + + /* + #include + #include + void hello() { printf("%s\\n", "Hello from cgo!"); fflush(stdout); } + */ + import "C" + + func main() { + C.hello() + } + GO + + # Try running a sample using cgo without CC or CXX set to ensure that the + # toolchain's default choice of compilers work + with_env(CC: nil, CXX: nil, CGO_ENABLED: "1") do + assert_equal "Hello from cgo!\n", shell_output("#{bin}/go run hello_cgo.go") + end + end +end diff --git a/Formula/g/golangci-lint.rb b/Formula/g/golangci-lint.rb index 70d22b7c78f4..a87cee1a4456 100644 --- a/Formula/g/golangci-lint.rb +++ b/Formula/g/golangci-lint.rb @@ -5,6 +5,7 @@ class GolangciLint < Formula tag: "v2.8.0", revision: "e2e40021c9007020676c93680a36e3ab06c6cd33" license "GPL-3.0-only" + revision 1 head "https://github.com/golangci/golangci-lint.git", branch: "main" bottle do diff --git a/audit_exceptions/unstable_allowlist.json b/audit_exceptions/unstable_allowlist.json index accf34288e51..7a3478e668b8 100644 --- a/audit_exceptions/unstable_allowlist.json +++ b/audit_exceptions/unstable_allowlist.json @@ -3,6 +3,7 @@ "automysqlbackup": "3.0-rc", "aview": "1.3.0rc", "ftgl": "2.1.3-rc", + "go": "1.26rc", "libcaca": "0.99b", "librasterlite2": "1.1.0-beta", "premake": "5.0.0-beta",