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 e9a796807715..f0ff57fcd200 100644 --- a/Formula/g/go.rb +++ b/Formula/g/go.rb @@ -2,16 +2,16 @@ class Go < Formula desc "Open source programming language to build simple/reliable/efficient software" homepage "https://go.dev/" license "BSD-3-Clause" - revision 1 - compatibility_version 1 + compatibility_version 2 head "https://go.googlesource.com/go.git", branch: "master" stable do - url "https://go.dev/dl/go1.25.7.src.tar.gz" - mirror "https://fossies.org/linux/misc/go1.25.7.src.tar.gz" - sha256 "178f2832820274b43e177d32f06a3ebb0129e427dd20a5e4c88df2c1763cf10a" + url "https://go.dev/dl/go1.26.0.src.tar.gz" + mirror "https://fossies.org/linux/misc/go1.26.0.src.tar.gz" + sha256 "c9132a8a1f6bd2aa4aad1d74b8231d95274950483a4950657ee6c56e6e817790" # patch to fix pkg-config flag sanitization + # Backport issue https://golang.org/issue/77474, should be included in 1.26.1+. patch do url "https://github.com/golang/go/commit/28fbdf7acb4146b5bc3d88128e407d1344691839.patch?full_index=1" sha256 "2e05f7e16f2320685547a7ebb240163a8b7f1c7bf9d2f6dc4872ff8b27707a35" @@ -32,12 +32,12 @@ class Go < Formula end bottle do - sha256 cellar: :any_skip_relocation, arm64_tahoe: "cce0c9d57104de4957492f01c61ff35388d405d08bbdebe89762afca30cbb6ae" - sha256 cellar: :any_skip_relocation, arm64_sequoia: "cce0c9d57104de4957492f01c61ff35388d405d08bbdebe89762afca30cbb6ae" - sha256 cellar: :any_skip_relocation, arm64_sonoma: "cce0c9d57104de4957492f01c61ff35388d405d08bbdebe89762afca30cbb6ae" - sha256 cellar: :any_skip_relocation, sonoma: "a0584077b91e24fcfc84f2c9f129e63462243edde89d68d79186ae049ca79c2c" - sha256 cellar: :any_skip_relocation, arm64_linux: "557fc542b200bcf95ec86dc4c7297c74930cc76b08aed01753a0e2c6c26c4747" - sha256 cellar: :any_skip_relocation, x86_64_linux: "497e82ed5755329c4e6258b3b77bd7ce7214116f8be7d787ddaa491860eb59df" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "54b39d76b59f388de6f95bef52a6598535165ad72133ca413a5d81c9f87d3633" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "54b39d76b59f388de6f95bef52a6598535165ad72133ca413a5d81c9f87d3633" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "54b39d76b59f388de6f95bef52a6598535165ad72133ca413a5d81c9f87d3633" + sha256 cellar: :any_skip_relocation, sonoma: "e9b8fa3213f0e04234c8d7a0dd54ba4dc198dcf6eb5fd3b96dd8257b51c8b7c5" + sha256 cellar: :any_skip_relocation, arm64_linux: "ab3d100a21cc7a4477ce3911dadaddea17f2963ae8751dc6e2d4f7cc56704559" + sha256 cellar: :any_skip_relocation, x86_64_linux: "4f008aec1edbbe32d582f7610e83d54fcccd8fc5654d0bd830bf3b48d24592cf" end depends_on macos: :monterey @@ -45,13 +45,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" => "f282d882c3353485e2fc6c634606d85caf36e855167d59b996dbeae19fa7629a", + "darwin-amd64" => "6cc6549b06725220b342b740497ffd24e0ebdcef75781a77931ca199f46ad781", + "linux-arm64" => "74d97be1cc3a474129590c67ebf748a96e72d9f3a2b6fef3ed3275de591d49b3", + "linux-amd64" => "1fc94b57134d51669c72173ad5d49fd62afb0f1db9bf3f798fd98ee423f8d730", } - version "1.22.12" + version "1.24.13" 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..15c8b163bca7 --- /dev/null +++ b/Formula/g/go@1.25.rb @@ -0,0 +1,104 @@ +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.7.src.tar.gz" + mirror "https://fossies.org/linux/misc/go1.25.7.src.tar.gz" + sha256 "178f2832820274b43e177d32f06a3ebb0129e427dd20a5e4c88df2c1763cf10a" + license "BSD-3-Clause" + revision 1 + compatibility_version 1 + + 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 + + bottle do + sha256 cellar: :any_skip_relocation, arm64_tahoe: "1b7dbdf302ac420aa8f9f21b80753b42670160344ae8fcd222ed79f5dc4daa55" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "1b7dbdf302ac420aa8f9f21b80753b42670160344ae8fcd222ed79f5dc4daa55" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "1b7dbdf302ac420aa8f9f21b80753b42670160344ae8fcd222ed79f5dc4daa55" + sha256 cellar: :any_skip_relocation, sonoma: "22393319dcfebad92b53a89259e924f66c7fec7bf56d73f8dd5be88c0e75cb4b" + sha256 cellar: :any_skip_relocation, arm64_linux: "df5032811d797828f11621cdf085d5ab39fafa1127299c95d321773920257de8" + sha256 cellar: :any_skip_relocation, x86_64_linux: "88ee33ff7f5018e16c12a93d4bad41ecfb5ed6b7112cd7a0206b6d69684552e0" + end + + keg_only :versioned_formula + + depends_on "go" => :build + + # patch to fix pkg-config flag sanitization + # Backport issue https://golang.org/issue/77438, should be included in 1.25.8+. + patch do + url "https://github.com/golang/go/commit/28fbdf7acb4146b5bc3d88128e407d1344691839.patch?full_index=1" + sha256 "2e05f7e16f2320685547a7ebb240163a8b7f1c7bf9d2f6dc4872ff8b27707a35" + end + + 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..c25acafa64f7 100644 --- a/Formula/g/golangci-lint.rb +++ b/Formula/g/golangci-lint.rb @@ -5,15 +5,16 @@ 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 - sha256 cellar: :any_skip_relocation, arm64_tahoe: "48a1896101fccaf8eb0e499fa57cfbccccd9bcbd02dac1e21f8588fd62db1d7f" - sha256 cellar: :any_skip_relocation, arm64_sequoia: "27b696d692604a802cb4e854af48cf63b84f90f1a57fdcf4492cccbb32728edd" - sha256 cellar: :any_skip_relocation, arm64_sonoma: "9ccc525927eeb9b9a4818ab08de8afc24cbaeb0a36d3e8b229c534a1c401361d" - sha256 cellar: :any_skip_relocation, sonoma: "b7e19fc5c021c8221b8a4e659289447a131505c21cd94f467c396a097aaae94f" - sha256 cellar: :any_skip_relocation, arm64_linux: "96e0a07ed2009f86e638aff478ffcd1ee0b2a07557a7e08dd9bbe0e94f2c991c" - sha256 cellar: :any_skip_relocation, x86_64_linux: "e1a68dffae26d225a535a75814790c762750b5e3706ea90643e7ebbaa446db0a" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "55e1da3625cbe8c833f1251026a00d6859169bf971e5b435a3457a7800072869" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "c2b00bb657e95a9f64c9da1ca77c6a521cf2183330ba066f2cad8d1c700531e5" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "1834d8f6ad0c4e3f1c0e2e91824b50bd46f16edd005617ebd8b5b3c24b22ad3c" + sha256 cellar: :any_skip_relocation, sonoma: "5f991c418194580c9a3de67f3a4cf396f58a4b65dd707da22a06219e96e86ac4" + sha256 cellar: :any_skip_relocation, arm64_linux: "8ec59a2b655f267e4d35e8e0487f57daa4481a713289a0cfa85fe642574a34cf" + sha256 cellar: :any_skip_relocation, x86_64_linux: "1620ecdae111482c2d20d57305eccb8682a9db392db4badbdd0dc12509569dd7" end depends_on "go"