diff options
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/golang.scm | 221 |
1 files changed, 0 insertions, 221 deletions
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 31110556d57..ce24567c172 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm | |||
| @@ -245,226 +245,6 @@ in the style of communicating sequential processes (@dfn{CSP}).") | |||
| 245 | (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux")) | 245 | (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux")) |
| 246 | (license license:bsd-3))) | 246 | (license license:bsd-3))) |
| 247 | 247 | ||
| 248 | (define-public go-1.16 | ||
| 249 | (package | ||
| 250 | (inherit go-1.4) | ||
| 251 | (name "go") | ||
| 252 | (version "1.16.15") | ||
| 253 | (source | ||
| 254 | (origin | ||
| 255 | (method git-fetch) | ||
| 256 | (uri (git-reference | ||
| 257 | (url "https://github.com/golang/go") | ||
| 258 | (commit (string-append "go" version)))) | ||
| 259 | (file-name (git-file-name name version)) | ||
| 260 | (sha256 | ||
| 261 | (base32 | ||
| 262 | "0vlk0r4600ah9fg5apdd93g7i369k0rkzcgn7cs8h6qq2k6hpxjl")))) | ||
| 263 | (arguments | ||
| 264 | (substitute-keyword-arguments | ||
| 265 | (strip-keyword-arguments '(#:tests? #:system) (package-arguments go-1.4)) | ||
| 266 | ((#:phases phases) | ||
| 267 | `(modify-phases ,phases | ||
| 268 | ;; Time bomb in TLS tests: "Most of the test certificates | ||
| 269 | ;; (e.g. testRSACertificate, testRSACertificateIssuer, | ||
| 270 | ;; testRSA2048CertificateIssuer) have a not after of Jan 1 | ||
| 271 | ;; 00:00:00 2025 GMT." | ||
| 272 | ;; https://github.com/golang/go/issues/71077 | ||
| 273 | ;; https://github.com/golang/go/issues/71103 | ||
| 274 | ;; https://github.com/golang/go/issues/71104 | ||
| 275 | (add-after 'unpack 'skip-crypto-tls-tests | ||
| 276 | (lambda _ | ||
| 277 | (substitute* (list "src/crypto/tls/handshake_client_test.go" | ||
| 278 | "src/crypto/tls/handshake_server_test.go") | ||
| 279 | (("TestVerifyConnection.*" all) | ||
| 280 | (string-append all "\n t.Skip(\"golang.org/issue/71077\")\n")) | ||
| 281 | (("TestResumptionKeepsOCSPAndSCT.*" all) | ||
| 282 | (string-append all "\n t.Skip(\"golang.org/issue/71077\")\n")) | ||
| 283 | (("TestCrossVersionResume.*" all) | ||
| 284 | (string-append all "\n t.Skip(\"golang.org/issue/71077\")\n"))))) | ||
| 285 | (add-after 'unpack 'remove-unused-sourcecode-generators | ||
| 286 | (lambda _ | ||
| 287 | ;; Prevent perl from inclusion in closure through unused files | ||
| 288 | (for-each delete-file (find-files "src" "\\.pl$")))) | ||
| 289 | (replace 'prebuild | ||
| 290 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 291 | (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib")) | ||
| 292 | (net-base (assoc-ref inputs "net-base")) | ||
| 293 | (tzdata-path | ||
| 294 | (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo"))) | ||
| 295 | |||
| 296 | ;; Having the patch in the 'patches' field of <origin> breaks | ||
| 297 | ;; the 'TestServeContent' test due to the fact that | ||
| 298 | ;; timestamps are reset. Thus, apply it from here. | ||
| 299 | (invoke "patch" "-p2" "--force" "-i" | ||
| 300 | (assoc-ref inputs "go-skip-gc-test.patch")) | ||
| 301 | (invoke "patch" "-p2" "--force" "-i" | ||
| 302 | (assoc-ref inputs "go-fix-script-tests.patch")) | ||
| 303 | |||
| 304 | (for-each make-file-writable (find-files ".")) | ||
| 305 | |||
| 306 | (substitute* "os/os_test.go" | ||
| 307 | (("/usr/bin") (getcwd)) | ||
| 308 | (("/bin/sh") (which "sh"))) | ||
| 309 | |||
| 310 | (substitute* "cmd/go/testdata/script/cgo_path_space.txt" | ||
| 311 | (("/bin/sh") (which "sh"))) | ||
| 312 | |||
| 313 | ;; Add libgcc to runpath | ||
| 314 | (substitute* "cmd/link/internal/ld/lib.go" | ||
| 315 | (("!rpath.set") "true")) | ||
| 316 | (substitute* "cmd/go/internal/work/gccgo.go" | ||
| 317 | (("cgoldflags := \\[\\]string\\{\\}") | ||
| 318 | (string-append "cgoldflags := []string{" | ||
| 319 | "\"-Wl,-rpath=" gcclib "\"" | ||
| 320 | "}")) | ||
| 321 | (("\"-lgcc_s\", ") | ||
| 322 | (string-append | ||
| 323 | "\"-Wl,-rpath=" gcclib "\", \"-lgcc_s\", "))) | ||
| 324 | (substitute* "cmd/go/internal/work/gc.go" | ||
| 325 | (("ldflags = setextld\\(ldflags, compiler\\)") | ||
| 326 | (string-append | ||
| 327 | "ldflags = setextld(ldflags, compiler)\n" | ||
| 328 | "ldflags = append(ldflags, \"-r\")\n" | ||
| 329 | "ldflags = append(ldflags, \"" gcclib "\")\n"))) | ||
| 330 | |||
| 331 | ;; Disable failing tests: these tests attempt to access | ||
| 332 | ;; commands or network resources which are neither available | ||
| 333 | ;; nor necessary for the build to succeed. | ||
| 334 | (for-each | ||
| 335 | (match-lambda | ||
| 336 | ((file regex) | ||
| 337 | (substitute* file | ||
| 338 | ((regex all before test_name) | ||
| 339 | (string-append before "Disabled" test_name))))) | ||
| 340 | '(("net/net_test.go" "(.+)(TestShutdownUnix.+)") | ||
| 341 | ("net/dial_test.go" "(.+)(TestDialTimeout.+)") | ||
| 342 | ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPort.+)") | ||
| 343 | ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPortWithCancel.+)") | ||
| 344 | ;; 127.0.0.1 doesn't exist | ||
| 345 | ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPTR.+)") | ||
| 346 | ;; 127.0.0.1 doesn't exist | ||
| 347 | ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPTRWithCancel.+)") | ||
| 348 | ;; /etc/services doesn't exist | ||
| 349 | ("net/parse_test.go" "(.+)(TestReadLine.+)") | ||
| 350 | ("os/os_test.go" "(.+)(TestHostname.+)") | ||
| 351 | ;; The user's directory doesn't exist | ||
| 352 | ("os/os_test.go" "(.+)(TestUserHomeDir.+)") | ||
| 353 | ("time/format_test.go" "(.+)(TestParseInSydney.+)") | ||
| 354 | ("time/format_test.go" "(.+)(TestParseInLocation.+)") | ||
| 355 | ("os/exec/exec_test.go" "(.+)(TestEcho.+)") | ||
| 356 | ("os/exec/exec_test.go" "(.+)(TestCommandRelativeName.+)") | ||
| 357 | ("os/exec/exec_test.go" "(.+)(TestCatStdin.+)") | ||
| 358 | ("os/exec/exec_test.go" "(.+)(TestCatGoodAndBadFile.+)") | ||
| 359 | ("os/exec/exec_test.go" "(.+)(TestExitStatus.+)") | ||
| 360 | ("os/exec/exec_test.go" "(.+)(TestPipes.+)") | ||
| 361 | ("os/exec/exec_test.go" "(.+)(TestStdinClose.+)") | ||
| 362 | ("os/exec/exec_test.go" "(.+)(TestIgnorePipeErrorOnSuccess.+)") | ||
| 363 | ("syscall/syscall_unix_test.go" "(.+)(TestPassFD\\(.+)") | ||
| 364 | ("os/exec/exec_test.go" "(.+)(TestExtraFiles/areturn.+)") | ||
| 365 | ("cmd/go/go_test.go" "(.+)(TestCoverageWithCgo.+)") | ||
| 366 | ("cmd/go/go_test.go" "(.+)(TestTwoPkgConfigs.+)") | ||
| 367 | ("os/exec/exec_test.go" "(.+)(TestOutputStderrCapture.+)") | ||
| 368 | ("os/exec/exec_test.go" "(.+)(TestExtraFiles.+)") | ||
| 369 | ("os/exec/exec_test.go" "(.+)(TestExtraFilesRace.+)") | ||
| 370 | ("net/lookup_test.go" "(.+)(TestLookupPort.+)") | ||
| 371 | ("syscall/exec_linux_test.go" | ||
| 372 | "(.+)(TestCloneNEWUSERAndRemapNoRootDisableSetgroups.+)"))) | ||
| 373 | |||
| 374 | ;; These tests fail on aarch64-linux | ||
| 375 | (substitute* "cmd/dist/test.go" | ||
| 376 | (("t.registerHostTest\\(\"testsanitizers/msan.*") "")) | ||
| 377 | |||
| 378 | ;; fix shebang for testar script | ||
| 379 | ;; note the target script is generated at build time. | ||
| 380 | (substitute* "../misc/cgo/testcarchive/carchive_test.go" | ||
| 381 | (("#!/usr/bin/env") (string-append "#!" (which "env")))) | ||
| 382 | |||
| 383 | (substitute* "net/lookup_unix.go" | ||
| 384 | (("/etc/protocols") (string-append net-base "/etc/protocols"))) | ||
| 385 | (substitute* "net/port_unix.go" | ||
| 386 | (("/etc/services") (string-append net-base "/etc/services"))) | ||
| 387 | (substitute* "time/zoneinfo_unix.go" | ||
| 388 | (("/usr/share/zoneinfo/") tzdata-path))))) | ||
| 389 | (add-before 'build 'set-bootstrap-variables | ||
| 390 | (lambda* (#:key outputs inputs #:allow-other-keys) | ||
| 391 | ;; Tell the build system where to find the bootstrap Go. | ||
| 392 | (let ((go (assoc-ref inputs "go"))) | ||
| 393 | (setenv "GOROOT_BOOTSTRAP" go) | ||
| 394 | (setenv "GOGC" "400")))) | ||
| 395 | (replace 'build | ||
| 396 | (lambda* (#:key inputs outputs (parallel-build? #t) | ||
| 397 | #:allow-other-keys) | ||
| 398 | ;; FIXME: Some of the .a files are not bit-reproducible. | ||
| 399 | ;; (Is this still true?) | ||
| 400 | (let* ((njobs (if parallel-build? (parallel-job-count) 1)) | ||
| 401 | (output (assoc-ref outputs "out")) | ||
| 402 | (loader (string-append (assoc-ref inputs "libc") | ||
| 403 | ,(glibc-dynamic-linker)))) | ||
| 404 | (setenv "CC" (which "gcc")) | ||
| 405 | (setenv "GO_LDSO" loader) | ||
| 406 | (setenv "GOOS" "linux") | ||
| 407 | (setenv "GOROOT" (dirname (getcwd))) | ||
| 408 | (setenv "GOROOT_FINAL" output) | ||
| 409 | (setenv "GOCACHE" "/tmp/go-cache") | ||
| 410 | (setenv "GOMAXPROCS" (number->string njobs)) | ||
| 411 | (invoke "sh" "make.bash" "--no-banner")))) | ||
| 412 | (replace 'check | ||
| 413 | (lambda* (#:key target (tests? (not target)) (parallel-tests? #t) | ||
| 414 | #:allow-other-keys) | ||
| 415 | (let* ((njobs (if parallel-tests? (parallel-job-count) 1))) | ||
| 416 | (when tests? | ||
| 417 | (setenv "GOMAXPROCS" (number->string njobs)) | ||
| 418 | (invoke "sh" "run.bash" "--no-rebuild"))))) | ||
| 419 | (add-before 'install 'unpatch-perl-shebangs | ||
| 420 | (lambda _ | ||
| 421 | ;; Rewrite references to perl input in test scripts | ||
| 422 | (substitute* "net/http/cgi/testdata/test.cgi" | ||
| 423 | (("^#!.*") "#!/usr/bin/env perl\n")))) | ||
| 424 | (replace 'install | ||
| 425 | ;; TODO: Most of this could be factorized with Go 1.4. | ||
| 426 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 427 | (let* ((output (assoc-ref outputs "out")) | ||
| 428 | (doc_out (assoc-ref outputs "doc")) | ||
| 429 | (docs (string-append doc_out "/share/doc/" ,name "-" ,version)) | ||
| 430 | (src (string-append | ||
| 431 | (assoc-ref outputs "tests") "/share/" ,name "-" ,version))) | ||
| 432 | ;; Prevent installation of the build cache, which contains | ||
| 433 | ;; store references to most of the tools used to build Go and | ||
| 434 | ;; would unnecessarily increase the size of Go's closure if it | ||
| 435 | ;; was installed. | ||
| 436 | (delete-file-recursively "../pkg/obj") | ||
| 437 | |||
| 438 | (mkdir-p src) | ||
| 439 | (copy-recursively "../test" (string-append src "/test")) | ||
| 440 | (delete-file-recursively "../test") | ||
| 441 | (mkdir-p docs) | ||
| 442 | (copy-recursively "../api" (string-append docs "/api")) | ||
| 443 | (delete-file-recursively "../api") | ||
| 444 | (copy-recursively "../doc" (string-append docs "/doc")) | ||
| 445 | (delete-file-recursively "../doc") | ||
| 446 | |||
| 447 | (for-each | ||
| 448 | (lambda (file) | ||
| 449 | (let* ((filein (string-append "../" file)) | ||
| 450 | (fileout (string-append docs "/" file))) | ||
| 451 | (copy-file filein fileout) | ||
| 452 | (delete-file filein))) | ||
| 453 | ;; Note the slightly different file names compared to 1.4. | ||
| 454 | '("README.md" "CONTRIBUTORS" "AUTHORS" "PATENTS" | ||
| 455 | "LICENSE" "VERSION" "CONTRIBUTING.md" "robots.txt")) | ||
| 456 | |||
| 457 | (copy-recursively "../" output)))))))) | ||
| 458 | (native-inputs | ||
| 459 | `(,@(if (member (%current-system) (package-supported-systems go-1.4)) | ||
| 460 | `(("go" ,go-1.4)) | ||
| 461 | `(("go" ,gccgo-12))) | ||
| 462 | ("go-skip-gc-test.patch" ,(search-patch "go-skip-gc-test.patch")) | ||
| 463 | ("go-fix-script-tests.patch" ,(search-patch "go-fix-script-tests.patch")) | ||
| 464 | ,@(package-native-inputs go-1.4))) | ||
| 465 | (supported-systems (fold delete %supported-systems | ||
| 466 | (list "powerpc-linux" "i586-gnu" "x86_64-gnu"))))) | ||
| 467 | |||
| 468 | ;; https://github.com/golang/go/wiki/MinimumRequirements#microarchitecture-support | 248 | ;; https://github.com/golang/go/wiki/MinimumRequirements#microarchitecture-support |
| 469 | (define %go-1.17-arm-micro-architectures | 249 | (define %go-1.17-arm-micro-architectures |
| 470 | (list "armv5" "armv6" "armv7")) | 250 | (list "armv5" "armv6" "armv7")) |
| @@ -1211,7 +991,6 @@ in the style of communicating sequential processes (@dfn{CSP}).") | |||
| 1211 | (export make-go-std) | 991 | (export make-go-std) |
| 1212 | 992 | ||
| 1213 | ;; Make those public so they have a corresponding Cuirass job. | 993 | ;; Make those public so they have a corresponding Cuirass job. |
| 1214 | (define-public go-std-1.16 (make-go-std go-1.16)) | ||
| 1215 | (define-public go-std-1.17 (make-go-std go-1.17)) | 994 | (define-public go-std-1.17 (make-go-std go-1.17)) |
| 1216 | (define-public go-std-1.18 (make-go-std go-1.18)) | 995 | (define-public go-std-1.18 (make-go-std go-1.18)) |
| 1217 | (define-public go-std-1.19 (make-go-std go-1.19)) | 996 | (define-public go-std-1.19 (make-go-std go-1.19)) |
