diff --git a/Aliases/go@1.26 b/Aliases/go@1.27 similarity index 100% rename from Aliases/go@1.26 rename to Aliases/go@1.27 diff --git a/Formula/e/errcheck.rb b/Formula/e/errcheck.rb index 79ea2e79a20e..72f9273b6dfc 100644 --- a/Formula/e/errcheck.rb +++ b/Formula/e/errcheck.rb @@ -4,6 +4,7 @@ class Errcheck < Formula url "https://github.com/kisielk/errcheck/archive/refs/tags/v1.20.0.tar.gz" sha256 "d16b7757bf57dea5bbcfce42badd1bbfadd4c112b2da90b4ccaeb81c6c438c1e" license "MIT" + revision 1 bottle do sha256 cellar: :any_skip_relocation, arm64_tahoe: "eebf1a2df5e0cbfd40864621539bbf42fdce0833739eb268b31c4009a29230df" diff --git a/Formula/g/go.rb b/Formula/g/go.rb index 3a28b800dd43..bde8d1ba85d0 100644 --- a/Formula/g/go.rb +++ b/Formula/g/go.rb @@ -1,11 +1,11 @@ class Go < Formula desc "Open source programming language to build simple/reliable/efficient software" homepage "https://go.dev/" - url "https://go.dev/dl/go1.26.5.src.tar.gz" - mirror "https://fossies.org/linux/misc/go1.26.5.src.tar.gz" - sha256 "495be4bc87176ac567392e5b4116abd98466d33d7b49d41e764ccc6976b2dc42" + url "https://go.dev/dl/go1.27rc2.src.tar.gz" + mirror "https://fossies.org/linux/misc/go1.27rc2.src.tar.gz" + sha256 "860fd7a30b285ee16a2ae0ec5d4441cb47c48872a0a30cb60cae348947f48a25" license "BSD-3-Clause" - compatibility_version 7 + compatibility_version 8 head "https://go.googlesource.com/go.git", branch: "master" livecheck do diff --git a/Formula/g/go@1.26.rb b/Formula/g/go@1.26.rb new file mode 100644 index 000000000000..bce817c63e00 --- /dev/null +++ b/Formula/g/go@1.26.rb @@ -0,0 +1,87 @@ +class GoAT126 < Formula + desc "Open source programming language to build simple/reliable/efficient software" + homepage "https://go.dev/" + url "https://go.dev/dl/go1.26.5.src.tar.gz" + mirror "https://fossies.org/linux/misc/go1.26.5.src.tar.gz" + sha256 "495be4bc87176ac567392e5b4116abd98466d33d7b49d41e764ccc6976b2dc42" + license "BSD-3-Clause" + compatibility_version 3 + + livecheck do + url "https://go.dev/dl/?mode=json" + regex(/^go[._-]?v?(1\.26(?:\.\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 5fad09543d0e..5f121740c6d5 100644 --- a/Formula/g/golangci-lint.rb +++ b/Formula/g/golangci-lint.rb @@ -5,6 +5,7 @@ class GolangciLint < Formula tag: "v2.12.2", revision: "c0d3ddc9cf3faa61a4e378e879ece580256d76e5" license "GPL-3.0-only" + revision 1 head "https://github.com/golangci/golangci-lint.git", branch: "main" bottle do diff --git a/Formula/g/govulncheck.rb b/Formula/g/govulncheck.rb index 8b848586906f..06d8db0b87fd 100644 --- a/Formula/g/govulncheck.rb +++ b/Formula/g/govulncheck.rb @@ -4,6 +4,7 @@ class Govulncheck < Formula url "https://github.com/golang/vuln/archive/refs/tags/v1.6.0.tar.gz" sha256 "70f82d70f3a6757babbeb4e6834536e572d1c822180619ac74b649e3e4f247fb" license "BSD-3-Clause" + revision 1 head "https://github.com/golang/vuln.git", branch: "master" bottle do diff --git a/audit_exceptions/unstable_allowlist.json b/audit_exceptions/unstable_allowlist.json index fc870faa5ffb..c807632abe2f 100644 --- a/audit_exceptions/unstable_allowlist.json +++ b/audit_exceptions/unstable_allowlist.json @@ -4,6 +4,7 @@ "avahi": "0.9-rc", "aview": "1.3.0rc", "ftgl": "2.1.3-rc", + "go": "1.27rc", "libcaca": "0.99.beta", "librasterlite2": "1.1.0-beta", "premake": "5.0.0-beta",