summaryrefslogtreecommitdiff
path: root/misc
Commit message (Collapse)AuthorAgeFilesLines
...
* cmd/link: put shlib ".type" functions in internal ABIIan Lance Taylor2019-07-153-0/+40
| | | | | | | | | | | | | | These functions are compiler generated, and as such are only available in the internal ABI. Doing this avoids generating an alias symbol. Doing that avoids confusion between unmangled and mangled type symbols. Fixes #30768 Change-Id: I197a5ba6403aac11989ffa951dbe35bd0506de91 Reviewed-on: https://go-review.googlesource.com/c/go/+/186077 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
* cmd/cgo: do not rewrite call if there are more args than parametersIan Lance Taylor2019-07-122-0/+18
| | | | | | | | | | | | | | | We already skipped rewriting the call if there were fewer args than parameters. But we can also get a cgo crash if there are more args, if at least one of the extra args uses a name qualified with "C.". Skip the rewrite, since the build will fail later anyhow. Fixes #33061 Change-Id: I62ff3518b775b502ad10c2bacf9102db4c9a531c Reviewed-on: https://go-review.googlesource.com/c/go/+/185797 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
* cmd/cgo: fix check for conversion of ptr to struct fieldGernot Vormayr2019-07-091-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the documentation "When passing a pointer to a field in a struct, the Go memory in question is the memory occupied by the field, not the entire struct.". checkAddr states that this should also work with type conversions, which is implemented in isType. However, ast.StarExpr must be enclosed in ast.ParenExpr according to the go spec (see example below), which is not considered in the checks. Example: // struct Si { int i; int *p; }; void f(struct I *x) {} import "C" type S { p *int i C.struct_Si } func main() { v := &S{new(int)} C.f((*C.struct_I)(&v.i)) // <- panic } This example will cause cgo to emit a cgoCheck that checks the whole struct S instead of just S.i causing the panic "cgo argument has Go pointer to Go pointer". This patch fixes this situation by adding support for ast.ParenExpr to isType and adds a test, that fails without the fix. Fixes #32970. Change-Id: I15ea28c98f839e9fa708859ed107a2e5f1483133 Reviewed-on: https://go-review.googlesource.com/c/go/+/185098 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* misc/cgo/errors: align code snippets in ptr_test.goBryan C. Mills2019-06-271-35/+35
| | | | | | Change-Id: Ic3e2819617375df653116d21d7361a46085250d5 Reviewed-on: https://go-review.googlesource.com/c/go/+/183986 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* misc/cgo/errors: fix TestPointerChecks when GO111MODULE=onBryan C. Mills2019-06-261-0/+3
| | | | | | | | Change-Id: I4e9e46f03c9c43df1d0c6995f3baedd2e1a04c6a Reviewed-on: https://go-review.googlesource.com/c/go/+/183985 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
* misc/cgo/test: use char, not int, so test works on big-endian systemsIan Lance Taylor2019-06-251-1/+1
| | | | | | | | | | | Updates #32579 Fixes #32770 Change-Id: I32d1dea7505e8ad22e11a9806e10d096924b729b Reviewed-on: https://go-review.googlesource.com/c/go/+/183778 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
* cmd/cgo: fix inappropriate array copykawakami2019-06-242-0/+13
| | | | | | | | | | | | | | | | | Ensure that during rewriting of expressions that take the address of an array, that we properly recognize *ast.IndexExpr as an operation to create a pointer variable and thus assign the proper addressOf and deference operators as "&" and "*" respectively. This fixes a regression from CL 142884. Fixed #32579 Change-Id: I3cb78becff4f8035d66fc5536e5b52857eacaa3d Reviewed-on: https://go-review.googlesource.com/c/go/+/183458 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* misc/ios: add missing CGO_ENABLED=1 for running standalone testsElias Naur2019-06-151-1/+1
| | | | | | | | Change-Id: Icfd5b9d1ca757081af7885189ae7094fa1b3d8f1 Reviewed-on: https://go-review.googlesource.com/c/go/+/182377 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* misc/cgo/test: add test for issue 31093Ian Lance Taylor2019-06-051-0/+10
| | | | | | | | | | Updates #31093 Change-Id: I7962aaca0b012de01768b7b42dc2283d5845eeea Reviewed-on: https://go-review.googlesource.com/c/go/+/180377 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
* cmd/cgo: roll back "use C exact-width integer types to represent Go types"Ian Lance Taylor2019-06-053-18/+0
| | | | | | | | | | | | | | | | | | | Roll back CL 159258 and CL 168337. Those changes broke existing code. I can't see any way to keep existing code working while also producing good error messages for types like C.ulong (such as the ones already tested for in misc/cgo/errors). This is not an exact roll back because parts of the code have changed since those CLs. Updates #29878 Fixes #31093 Change-Id: I56fe76c167ff0ab381ed273b9ca4b952402e1434 Reviewed-on: https://go-review.googlesource.com/c/go/+/180357 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
* runtime: save/restore callee saved registers in arm64's sigtrampBen Shi2019-06-031-4/+0
| | | | | | | | | | | | | | ARM64's R19-R29 and F8-F15 are callee saved registers, which should be saved in the beginning of sigtramp, and restored at the end. fixes #31827 Change-Id: I622e03f1a13fec969d3a11b6a303a8a492e02bcd Reviewed-on: https://go-review.googlesource.com/c/go/+/177045 Run-TryBot: Ben Shi <powerman1st@163.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
* misc/cgo/errors: limit number of parallel executionsIan Lance Taylor2019-05-311-11/+14
| | | | | | | | | | Fixes #32328 Change-Id: Iee71ecb247f2c439804c2ff03a6ed7b7f5a8b562 Reviewed-on: https://go-review.googlesource.com/c/go/+/179603 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* misc/cgo/errors: remove debugging printlnIan Lance Taylor2019-05-301-1/+0
| | | | | | | | Change-Id: I0c7da31e94307f939e1a2f023e00d5b24bac0ea6 Reviewed-on: https://go-review.googlesource.com/c/go/+/179604 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* syscall/js: replace TypedArrayOf with CopyBytesToGo/CopyBytesToJSRichard Musiol2019-05-241-1/+28
| | | | | | | | | | | | | | | | | | | | | The typed arrays returned by TypedArrayOf were backed by WebAssembly memory. They became invalid each time we grow the WebAssembly memory. This made them very error prone and hard to use correctly. This change removes TypedArrayOf completely and instead introduces CopyBytesToGo and CopyBytesToJS for copying bytes between a byte slice and an Uint8Array. This breaking change is still allowed for the syscall/js package. Fixes #31980. Fixes #31812. Change-Id: I14c76fdd60b48dd517c1593972a56d04965cb272 Reviewed-on: https://go-review.googlesource.com/c/go/+/177537 Run-TryBot: Richard Musiol <neelance@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* misc/cgo/test: consolidate tests into fewer cgo source filesRuss Cox2019-05-2297-3328/+2636
| | | | | | | | | | | | | | | | | | | | | | Each different file that does import "C" must be compiled and analyzed separately by cgo. Having fewer files import "C" reduces the cost of building the test. This is especially important because this test is built and run four different times (with different settings) during all.bash. go test -c in this directory used to take over 20 seconds on my laptop. Now it takes under 5 seconds. Removes 23.4r 29.0u 21.5s from all.bash. For #26473. Change-Id: Ie7cb7b0d9d6138ebd2eb548d0d8ea6e409ae10b9 Reviewed-on: https://go-review.googlesource.com/c/go/+/177558 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* misc/cgo/errors: consolidate test workRuss Cox2019-05-2115-418/+356
| | | | | | | | | | | | | | | | | | | | | | | Build a single binary containing all the TestPointerChecks instead of building many small binaries, each with its own cgo+compile+link invocation. This cuts 'go test -run=TestPointerChecks' from 6.7r 35.5u 26.1s to 2.1r 2.1u 1.4s. Move as many cgo checks as possible into fewer test files for TestReportsTypeErrors too. This cuts 'go test -run=TestReportsTypeErrors' from 2.1r 6.7u 6.7s to 1.5r 2.5u 2.5s. After this change, all.bash runs in ~4:30 on my laptop. For #26473. Change-Id: I3787448b03689a1f62dd810957ab6013bb75582f Reviewed-on: https://go-review.googlesource.com/c/go/+/177599 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* misc/android: fix a typo in READMEBen Shi2019-05-171-1/+1
| | | | | | | | | | A cross C compiler should be specified when cross building go for android on x86 host. This CL fixes the typo in README. Change-Id: Ideda915364d9f7f0fcd53146abc1e74506a8a8e6 Reviewed-on: https://go-review.googlesource.com/c/go/+/177777 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Elias Naur <mail@eliasnaur.com>
* misc/cgo: disable testcarchive, testplugin during -short test (including ↵Russ Cox2019-05-163-0/+18
| | | | | | | | | | | | | | | | | | | all.bash) These tests take 20 seconds each to rebuild the entire world in their respective modes. That's too much for short mode, including all.bash on developer machines. Keep doing it on builders and if someone runs 'go test' by hand in that directory. For #26473. Change-Id: I3dc6955bc3aa7a20fd170efcde72a7d19b37bdbf Reviewed-on: https://go-review.googlesource.com/c/go/+/177417 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* misc/android: silence adb output unless an error occursElias Naur2019-05-091-21/+32
| | | | | | | | | | Fixes #31917 Change-Id: I794e457b2245d355e2df5077078c67aa09e00ff9 Reviewed-on: https://go-review.googlesource.com/c/go/+/175920 Run-TryBot: Elias Naur <mail@eliasnaur.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/cgo: fix unexpected semicolon in rewritten lineRuss Cox2019-05-071-0/+11
| | | | | | | | | | | | | | | Followup to CL 157961 and CL 158457. Finish the list of operators and punctuation that disable semicolon insertion at end-of-line The reported case was "(" but "." was also missing. Fixes #31017. Change-Id: I0c06443f38dc8250c62e3aadd104abfa0e3be074 Reviewed-on: https://go-review.googlesource.com/c/go/+/174524 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* crypto/ed25519: promote from golang.org/x/crypto/ed25519Filippo Valsorda2019-05-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | The crypto/tls and crypto/x509 APIs leak PublicKey and PrivateKey types, so in order to add support for Ed25519 certificates we need the ed25519 package in the stdlib. It's also a primitive that's reasonable to use directly in applications, as it is a modern, safe and fast signing algorithm, for which there aren't higher level APIs. (The nacl/sign API is limiting in that it repeats the message.) A few docs changes will come in a follow-up, and a CL will land on golang.org/x/crypto/ed25519 to make it a type alias wrapper on Go 1.13+. Updates #25355 Change-Id: I057f20cc7d1aca2b95c29ce73eb03c3b237e413f Reviewed-on: https://go-review.googlesource.com/c/go/+/174945 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
* misc/ios: don't refer to iostest.bashElias Naur2019-05-031-2/+3
| | | | | | | | | | iostest.bash might not live much longer, and all.bash is much less confusing and more explicit. Change-Id: If42e8716bbbb02aa3f817dceaabb1aa8076aae1a Reviewed-on: https://go-review.googlesource.com/c/go/+/175178 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* misc/cgo/testcarchive: skip TestExtar on self-hosted iOSElias Naur2019-05-011-0/+3
| | | | | | | | | | | | iOS cannot (directly) run shell scripts. Updates #31722 Change-Id: I69473e9339c50a77338d391c73b4e146bce3fa89 Reviewed-on: https://go-review.googlesource.com/c/go/+/174700 Run-TryBot: Elias Naur <mail@eliasnaur.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: add new GOOS=illumos, split out of GOOS=solarisJoshua M. Clulow2019-04-303-3/+3
| | | | | | | | | | | | | | | | Like GOOS=android which implies the "linux" build tag, GOOS=illumos implies the "solaris" build tag. This lets the existing ecosystem of packages still work on illumos, but still permits packages to start differentiating between solaris and illumos. Fixes #20603 Change-Id: I8f4eabf1a66060538dca15d7658c1fbc6c826622 Reviewed-on: https://go-review.googlesource.com/c/go/+/174457 Run-TryBot: Benny Siegert <bsiegert@gmail.com> Reviewed-by: Benny Siegert <bsiegert@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* misc/wasm: fix command line arguments containing multi-byte charactersRichard Musiol2019-04-291-3/+7
| | | | | | | | | | | | | | | Command line arguments containing multi-byte characters were causing go_js_wasm_exec to crash (RangeError: Source is too large), because their byte length was not handled correctly. This change fixes the bug. Fixes #31645. Change-Id: I7860ebf5b12da37d9d0f43d4b6a22d326a90edaf Reviewed-on: https://go-review.googlesource.com/c/go/+/173877 Run-TryBot: Richard Musiol <neelance@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* misc/cgo/testcshared: support testing on self-hosted androidElias Naur2019-04-161-4/+5
| | | | | | | | | Only invoke adb for android if we're not running on android already. Change-Id: I4eb94286a5bf09b382716a0474f3aebec40f5d74 Reviewed-on: https://go-review.googlesource.com/c/go/+/170953 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* misc/cgo/testcshared: use adb exec-out instead of adb shellElias Naur2019-04-081-3/+3
| | | | | | | | | | | Adb exec-out is like adb shell except non-flaky in non-interactive settings. Don't ask why. Change-Id: I7ac3c72912883d80bc787c1d0fc101db6bae9c52 Reviewed-on: https://go-review.googlesource.com/c/go/+/170952 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* misc/cgo/test: skip Setgid test on AndroidElias Naur2019-04-081-2/+10
| | | | | | | | | | The setgid syscall is blocked on Android in app context. Change-Id: I1ff25840bbc25d472ad4e29eb1b51f183a6c4392 Reviewed-on: https://go-review.googlesource.com/c/go/+/170949 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* misc/cgo/testcarchive: skip TestSignalForwardingExternal on darwin/amd64Ian Lance Taylor2019-04-021-0/+2
| | | | | | | | | | | | | On darwin/amd64 the runtime method sigctxt.fixsigcode changes SIGSEGV signals so that they are never marked SI_USER. CL 169120 changed the signal handler to call fixsigcode even when the signal is delivered to a non-Go thread. This breaks TestSignalForwardingExternal, so skip it. Change-Id: I6740fb5a8f4f854ca69793537a983a696da3b495 Reviewed-on: https://go-review.googlesource.com/c/go/+/170446 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* runtime, cmd/dist, misc/cgo: enable c-archive for aix/ppc64Clément Chigot2019-04-023-13/+29
| | | | | | | | Change-Id: Ib9a40d5596f5735a00483e2d2db965402f05671b Reviewed-on: https://go-review.googlesource.com/c/go/+/169120 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* cmd/link: permit duplicate weak symbolsJoel Sing2019-03-294-0/+47
| | | | | | | | | | | | | | Permit weak symbols to be duplicates - most external linkers allow this and there are various situations where they can occur (including retpoline and retguard). Fixes #29563 Change-Id: I355493c847fbc8f670a85a643db65a4cf8f9883d Reviewed-on: https://go-review.googlesource.com/c/go/+/169658 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* misc/cgo: enable testso and testsovar on aix/ppc64Clément Chigot2019-03-277-8/+37
| | | | | | | | | | | | | | | | On AIX, shared objects must be wrapped under an archive file. For testso, creating libcgosotest with an extern symbol isn't AIX-friendly. By default, ld will block such behavior. Rather than forcing ld to work as on Linux and using the run-time linking, goCallback became a function pointer which is set by setCallback(). Updates #30565 Change-Id: I455ab32faddd41f1b0c84cc9e503788044ad49b2 Reviewed-on: https://go-review.googlesource.com/c/go/+/169020 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* cmd/compile: use existing instructions instead of nops for inline marksKeith Randall2019-03-251-1/+1
| | | | | | | | | | | | | | | | | Instead of always inserting a nop to use as the target of an inline mark, see if we can instead find an instruction we're issuing anyway with the correct line number, and use that instruction. That way, we don't need to issue a nop. Makes cmd/go 0.3% smaller. Update #29571 Change-Id: If6cfc93ab3352ec2c6e0878f8074a3bf0786b2f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/158021 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
* misc/wasm: exit with code 1 if WebAssembly.instantiate failsRichard Musiol2019-03-251-2/+3
| | | | | | | | | | | | go_js_wasm_exec was returning with code 0 if WebAssembly.instantiate failed. This made failing tests show as passed. Change-Id: Icfb2f42e9f1c3c70ca4a130a61a63cb305edff32 Reviewed-on: https://go-review.googlesource.com/c/go/+/168885 Run-TryBot: Richard Musiol <neelance@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/compile, misc/cgo: fix fortran tests on aix/ppc64Clément Chigot2019-03-221-1/+6
| | | | | | | | | | Enable pattern lib.a/shared.so.X in cgo_import_dynamic as on AIX, archive files (.a) often have shared objects (.so) inside them. Change-Id: I21096c75eb7fbcc7064b0b832bfa8ed862142051 Reviewed-on: https://go-review.googlesource.com/c/go/+/168877 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* misc/cgo: gofmt testdata filesTobias Klauser2019-03-224-4/+8
| | | | | | | | Change-Id: I64e05a1f768cb57194506021bb7fdca0ad19bf1c Reviewed-on: https://go-review.googlesource.com/c/go/+/168461 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* misc/ios: don't override GOCACHE on the deviceElias Naur2019-03-211-2/+2
| | | | | | | | | | | | | | | | | | | | | The iOS exec wrapper copies the environment variables to the binary running on the device. However, some variables such as HOME, TMPDIR and GOCACHE refer to directories that might not be valid on the device. The wrapper already ignores HOME and TMPDIR, but after GO111MODULE was flipped to on for the standard library, cmd/go tests started failing without a valid and writable GOCACHE. It took a while to reproduce because go test does not set an explicit GOCACHE but cmd/dist test does. Fixes #30914 Change-Id: If186cddc5cfd7ad39a0b3eb95f9c64a7d53a27e3 Reviewed-on: https://go-review.googlesource.com/c/go/+/168557 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* misc/android: pass on GOPROXY to device environmentElias Naur2019-03-211-0/+1
| | | | | | | | | | | | | Android devices don't have git available, so many go tool commands that fetch dependencies fail. Builders already have a GOPROXY available, so pass that along to the device environment. Updates #30885 Change-Id: Id0d2338932f0cd7de4d95d9e0ca9b79d29336ffe Reviewed-on: https://go-review.googlesource.com/c/go/+/168118 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* cmd/dist, misc/cgo: enable tests for aix/ppc64Clément Chigot2019-03-204-3/+15
| | | | | | | | | | | | | Some cgo tests aren't yet available on aix/ppc64. -shared and -static don't work as expected and will be fixed latter. Updates #30565 Change-Id: Ic59cabe685cb1cbdf89a8d1d1a1d2c4b0e8ef442 Reviewed-on: https://go-review.googlesource.com/c/go/+/164018 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* cmd/cgo: use C exact-width integer types to represent Go typesPhilipp Stephani2019-03-183-0/+33
| | | | | | | | | | | | | | | | | The exact-width integer types are required to use two’s complement representation and may not have padding bits, cf. §7.20.1.1/1 in the C11 standard or https://en.cppreference.com/w/c/types/integer. This ensures that they have the same domain and representation as the corresponding Go types. Fixes #29878 Change-Id: Ie8a51e91666dfd89731c7859abe47356c94ca1be GitHub-Last-Rev: 546a2cc3f1e22dc282757f73c01c91b00899d911 GitHub-Pull-Request: golang/go#29907 Reviewed-on: https://go-review.googlesource.com/c/go/+/159258 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* cmd/go,misc/ios: fix tests on iOSElias Naur2019-03-171-2/+2
| | | | | | | | | | | | | | | | | | | | | Now that modules are always on, cmd/go tests require a valid GOCACHE. However, on iOS where the go tool is not available, the cmd/go test driver ends up setting GOCACHE to the empty string. Fix it by falling back to the builtin default cache directory. The iOS exec wrapper passes the environment variables to the app on the device, including $HOME used for the default cache directory. Skip $HOME to let the device specific and writable $HOME be used instead. Should fix cmd/go on the iOS builders that broke when GO111MODULE defaulted to on. Change-Id: I0939f5b8aaa1d2db95e64c99f4130eee2d0b4d4d Reviewed-on: https://go-review.googlesource.com/c/go/+/167938 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* misc/android: copy go.mod and go.sum filesElias Naur2019-03-151-10/+13
| | | | | | | | | Fixes TestFindStdlib in x/tools on android. Change-Id: I2da7c702164e23488c7f9574f636ac36f63ab421 Reviewed-on: https://go-review.googlesource.com/c/go/+/167799 Run-TryBot: Elias Naur <mail@eliasnaur.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* misc/wasm: add workaround for missed timeout eventsRichard Musiol2019-03-141-1/+9
| | | | | | | | | | | | | | | | | | | TryBot is sometimes running into deadlocks on js/wasm. We haven't been able to reproduce them yet. This workaround is an experiment to resolve these deadlocks by retrying a missed timeout event. A timeout event is scheduled by Go to be woken by JavaScript after a certain amount of time. The checkTimeouts function then checks which notes to wake by comparing their deadline to nanotime. If this check fails erroneously then the note may stay asleep forever, causing a deadlock. This may or may not be the reason of the observed deadlocks. Updates #28975. Change-Id: I46b9d4069307142914f0e7b3acd4e65578319f0b Reviewed-on: https://go-review.googlesource.com/c/go/+/167119 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* cmd/dist: add a test in misc/reboot to verify that the toolchain can ↵Bryan C. Mills2019-03-132-0/+132
| | | | | | | | | | | | self-bootstrap Fixes #30758 Change-Id: I8e49958602de9caa47bb5710828158e51744f375 Reviewed-on: https://go-review.googlesource.com/c/go/+/167478 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* misc/android: fix detection of GOROOT testsElias Naur2019-03-121-11/+7
| | | | | | | | | | | | | | | strings.HasPrefix is not good enough to determine whether a path is a subdirectory of another because it does not respect path boundaries. filepath.Rel is good eonugh as long as we filter out results that use parent directories, "..". Hopefully fix the android emulator builders on the subrepositories. Change-Id: I17ee7e0028c0b0b26a6c5f67629f53c9a660c6e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/167117 Run-TryBot: Elias Naur <mail@eliasnaur.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* misc/android: copy less from GOROOT to the deviceElias Naur2019-03-111-44/+103
| | | | | | | | | | | | | | | | | | | | | | The android emulator builders is running out of space after CL 165797 copied most of GOROOT to the device. The pkg directory is by far the largest, so only include what seems necessary to build the x/ repositories: pkg/android_$GOARCH and pkg/tool/android_$GOARCH. While here, rename the device root directory to match the exec wrapper name and make sure the deferred cleanups actually run before os.Exit. Hopefully fixes the emulator builders. Updates #23824 Change-Id: I4d1e3ab2c89fd1e5818503d323ddb87f073094da Reviewed-on: https://go-review.googlesource.com/c/go/+/166397 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* cmd: refresh cmd/vendor to match 'go mod vendor'Bryan C. Mills2019-03-111-20/+10
| | | | | | | | | | | | | | | | | | | | | | | This change preserves the maximum versions from cmd/vendor/vendor.json where feasible, but bumps the versions of x/sys (for CL 162987) and x/tools (for CL 162989 and CL 160837) so that 'go test all' passes in module mode when run from a working directory in src/cmd. A small change to cmd/vet (not vendored) was necessary to preserve its flag behavior given a pristine copy of x/tools; see CL 162989 for more detail. This change was generated by running 'go mod vendor' at CL 164622. (Welcoooome to the fuuuuuture!) Updates #30228 Updates #30241 Change-Id: I889590318dc857d4a6e20c3023d09a27128d8255 Reviewed-on: https://go-review.googlesource.com/c/go/+/164618 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
* misc/android: enable many more tests on GOOS=androidElias Naur2019-03-083-33/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Android tests are built on the host and run on the device. To do that, the exec wrapper copies the test binary and testdata to the device. To enable many more tests, make the copied environment more like the host: - Copy all of pkg from GOROOT, not just the android pkg directory. - Copy any parent testdata directories as well as the package's own. - Copy *.go files from the package directory. This enables misc/cgo/stdio and misc/cgo/life tests that were invisible before so disable them explicitly. - Always copy the GOROOT, even for tests outside GOROOT. This is expensive but only done once per make.bash. - Build the go tool for the device and put it in PATH. Set GOCACHE to a writable directory and disable cgo. While here, use a single directory for all the exec wrapper files and delete that once per make.bash as well. In total, this CL enables many tests in the subrepos that would need skips without it, in particular the x/tools tests. Fixes #11452 Updates #23824 Updates #11811 Change-Id: I2e50d8b57db9bc4637f25272a5360c8b2cf4e627 Reviewed-on: https://go-review.googlesource.com/c/go/+/165797 Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* misc: fix typos in various docsalkesh262019-03-074-6/+6
| | | | | | | | Change-Id: Ib03d7e5686e510152042e403b00fb2d65572f393 GitHub-Last-Rev: 57aeedf077cb4f82af68cc5cb2de5d53a447565e GitHub-Pull-Request: golang/go#30156 Reviewed-on: https://go-review.googlesource.com/c/go/+/161723 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
* cmd/cgo: simplify and fix handling of untyped constantsRémy Oudompheng2019-03-063-0/+44
| | | | | | | | | | | | | | | | | | Instead of trying to guess type of constants in the AST, which is hard, use the "var cgo%d Type = Constant" so that typechecking is left to the Go compiler. The previous code could still fail in some cases for constants imported from other modules or defined in other, non-cgo files. Fixes #30527 Change-Id: I2120cd90e90a74b9d765eeec53f6a3d2cfc1b642 Reviewed-on: https://go-review.googlesource.com/c/go/+/164897 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>