summaryrefslogtreecommitdiff
path: root/misc/ios/go_darwin_arm_exec.go
Commit message (Collapse)AuthorAgeFilesLines
* misc/ios: fix exec wrapper lockingElias Naur2016-03-251-1/+6
| | | | | | | | | | | | | | | | | The exec wrapper lock file was opened, locked and then never used again, assuming it would close and unlock at process exit. However, the garbage collector could collect and run the *os.File finalizer that closes the file prematurely, rendering the lock ineffective. Make the lock global so that the lock is live during the entire execution. (Hopefully) fix the iOS builders. Change-Id: I62429e92042a0a49c4f1ea553fdb32b6ea53a43e Reviewed-on: https://go-review.googlesource.com/21137 Reviewed-by: David Crawshaw <crawshaw@golang.org>
* misc/ios: serialize iOS executionElias Naur2016-03-241-0/+15
| | | | | | | | | | | | | | | | | The iOS exec wrapper use complicated machinery to run a iOS binary on a device. Running several binaries concurrently doesn't work (reliably), which can break tests running concurrently. For my setup, the runtime:cpu124 and sync_cpu tests can't run reliably without one of them crashing. Add a file lock to the exec wrapper to serialize execution. Fixes #14318 (for me) Change-Id: I023610e014b327f8d66f1d2fd2e54dd0e56f2be0 Reviewed-on: https://go-review.googlesource.com/21074 Reviewed-by: David Crawshaw <crawshaw@golang.org>
* misc/ios: deflake tests on darwin/arm{,arm64}Elias Naur2016-03-241-5/+18
| | | | | | | | | | | | | | | | | | | | | | | A retry mechanism is in place to combat the inherent flakiness of launching iOS test binaries. Before it covered just the starting of lldb; expand it to cover the setup steps as well. Note that the running of the binary itself is (still) not retried, to avoid covering over genuine bugs. On my test device (iPhone 5S, iOS 9.3) starting lldb can take longer than 10 seconds, so increase the timeout for that. Furthermore, some basic steps such as setting breakpoints in lldb can take longer than the 1 second timeout. Increase that timeout as well, to 2 seconds. Finally, improve the error message for when ios-deploy is not installed. For #14318 Change-Id: Iba41d1bd9d023575b9454cb577b08f8cae081c2a Reviewed-on: https://go-review.googlesource.com/21072 Reviewed-by: David Crawshaw <crawshaw@golang.org>
* misc/ios: pass through SIGCONT in the exec wrapperElias Naur2016-03-241-0/+1
| | | | | | | | | | | Instruct lldb to pass through SIGCONT unhindered when running iOS tests. Fixes the TestSIGCONT test in os/signal. For #14318 Change-Id: I669264208cc3d6ecae9fbc8790e0b753a93a5e04 Reviewed-on: https://go-review.googlesource.com/21071 Reviewed-by: David Crawshaw <crawshaw@golang.org>
* misc/ios: keep whole buffer in go_darwin_arm_execDavid Crawshaw2015-11-041-217/+149
| | | | | | | | | | | | | | | | | The existing go_darwin_arm_exec.go script does not work with Xcode 7, not due to any significant changes, but just ordering and timing of statements from lldb. Unfortunately the current design of go_darwin_arm_exec.go makes it not obvious what gets stuck where, so this moves from a moving buffer window to a complete buffer of the lldb output. The result is easier code to follow, and it works with Xcode 7. Updates #12660. Change-Id: I3b8b890b0bf4474119482e95d84e821a86d1eaed Reviewed-on: https://go-review.googlesource.com/16634 Reviewed-by: Michael Matloob <matloob@golang.org>
* misc/ios: fix an error when getenv encounters unset variableMichael Matloob2015-11-031-1/+1
| | | | | | | | | The error message should indicate the name of the unset variable, rather than the value. The value will alwayse be empty. Change-Id: I6f6c165074dfce857b6523703a890d205423cd28 Reviewed-on: https://go-review.googlesource.com/16555 Reviewed-by: David Crawshaw <crawshaw@golang.org>
* misc/ios: document the external binary and the required env variablesBurcu Dogan2015-06-091-0/+7
| | | | | | Change-Id: I1ec2460758b19e5315be061033c1bb5ed9ead4a8 Reviewed-on: https://go-review.googlesource.com/9688 Reviewed-by: Minux Ma <minux@golang.org>
* misc/ios: fix plist indentation and whitespaceBurcu Dogan2015-05-051-9/+15
| | | | | | Change-Id: Ida727edb592e77918ca5511b41456786d57c97b2 Reviewed-on: https://go-review.googlesource.com/9634 Reviewed-by: David Crawshaw <crawshaw@golang.org>
* misc/ios: fix teamID and appID use in entitlementsJosh Bleecher Snyder2015-04-161-2/+2
| | | | | | | | | | | | | This is a follow-up to CL 8910. This is the version that I have tested and which works when appID and teamID are not the same (which they appear to be for the builder). I am unsure how I submitted it with the wrong code. Change-Id: I186e34e91953d082b507390c1cd2042e5419c4c9 Reviewed-on: https://go-review.googlesource.com/8943 Reviewed-by: David Crawshaw <crawshaw@golang.org>
* misc/ios: adjust exec script for iOS 8.3David Crawshaw2015-04-161-18/+14
| | | | | | | | | | | We no longer need the EXC_BAD_ACCESS watcher as runtime/cgo contains a mach exception handler that catches it. And now lldb only intermittently reports process connection and exiting, so instead just look for the PASS from Go. Change-Id: I403266558f5a900e0b87ec1019d9baec88148d23 Reviewed-on: https://go-review.googlesource.com/8957 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
* misc/ios: read codesign info from environment variablesJosh Bleecher Snyder2015-04-151-8/+32
| | | | | | | | | | Use environment variables to allow set-and-forget. Add a script to attempt to autodetect codesign info. Change-Id: Ic56b9c5f097b1a4117ebb89c408bc333d91f581d Reviewed-on: https://go-review.googlesource.com/8910 Reviewed-by: David Crawshaw <crawshaw@golang.org>
* misc/ios: support go run in go_darwin_arm_execDavid Crawshaw2015-04-131-20/+55
| | | | | | | | | The -lldb flag makes it easy to use go run and end up in a debugging session on darwin/arm. Change-Id: I556f93e950086a7dff4839f301b9c55f7579f87b Reviewed-on: https://go-review.googlesource.com/8024 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
* misc/ios: retry loop to handle builder flakinessDavid Crawshaw2015-03-301-34/+76
| | | | | | | | | | | | | | | | | | | | | After moving the darwin/arm builder to new hardware several new flaky error messages appeared. This provided enough information to Google to make it clear that iOS build systems have been flaky for many years, and that is unlikely to change any time soon. However, all of the pain of lldb and using a breakpoint early in program initialization gives us an advantage: all install and initialization flakiness appears to happen before the Go program ever gets going. So if we see an error or we timeout before we reach our breakpoint (before any test code has executed), we can assume it is the fault of the builder and restart without risking hiding a flaky Go test. This code has successfully processed the last 8 builds. I am hopeful. Change-Id: Ide24aaae4fa7bdab9d8f4432bb85d8f2256c7606 Reviewed-on: https://go-review.googlesource.com/8241 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
* misc/ios: simplify breakpoint timeoutDavid Crawshaw2015-03-251-3/+1
| | | | | | | | | The clever partial timer I added interacts badly with iOS app launch timeout termination. A fixed timeout will be easier to debug. Change-Id: I6eb4ee5f1431539f00fa707e8cde6f3cf86983fc Reviewed-on: https://go-review.googlesource.com/8083 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
* misc/ios: timeout and continue waiting for getwdDavid Crawshaw2015-03-251-12/+43
| | | | | | | | | | | | | | Split out from cl/8024 for clarity and improved approach. Rarely, "stop reason = breakpoint" does not appear in the lldb stop text. However the program is ready to proceed. To be a little more robust about those cases, we wait for two seconds, and if that text doesn't appear but a prompt does we continue and hope for the best. Worst case, this results in a harder to read failure message. Change-Id: Ib20aa92564cdccefd2b7260417c647cd44122b66 Reviewed-on: https://go-review.googlesource.com/8080 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
* misc/ios: run lldb commands much more carefullyDavid Crawshaw2015-03-031-20/+27
| | | | | | | | | | We now wait until we see the completed prompt from a command before proceeding. This seems to cut down on a spurious error I have seen this afternoon. Change-Id: Ic0a3481d8c265c3c3b4449ec7ac1c2752b85b0b6 Reviewed-on: https://go-review.googlesource.com/6691 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
* misc/ios: extra stdout check before runDavid Crawshaw2015-03-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On one recent job I saw an unexpected SIGSTOP, which I suspect is simply the job timeout. But the lack of other diagnostics suggests lldb just didn't see the "run" command. ----- process handle SIGHUP --stop false --pass true --notify false process handle SIGPIPE --stop false --pass true --notify false process handle SIGUSR1 --stop false --pass true --notify false process handle SIGSEGV --stop false --pass true --notify false process handle SIGBUS --stop false --pass true --notify false breakpoint set -n getwd run (lldb) NAME PASS STOP NOTIFY ========== ===== ===== ====== SIGHUP true false false (lldb) NAME PASS STOP NOTIFY ========== ===== ===== ====== SIGPIPE true false false (lldb) NAME PASS STOP NOTIFY ========== ===== ===== ====== SIGUSR1 true false false (lldb) NAME PASS STOP NOTIFY ========== ===== ===== ====== SIGSEGV true false false (lldb) NAME PASS STOP NOTIFY ========== ===== ===== ====== SIGBUS true false false (lldb) Breakpoint 1: where = libsystem_c.dylib`getwd, address = 0x2f7f7294 (lldb) Process 23755 stopped * thread #1: tid = 0x104c02, 0x1febb000 dyld`_dyld_start, stop reason = signal SIGSTOP frame #0: 0x1febb000 dyld`_dyld_start dyld`_dyld_start: -> 0x1febb000: mov r8, sp 0x1febb004: sub sp, sp, #0x10 0x1febb008: bic sp, sp, #0x7 0x1febb00c: ldr r3, [pc, #112] ; _dyld_start + 132 (lldb) go_darwin_arm_exec: timeout (stage br getwd) FAIL compress/gzip 359.226s Change-Id: Ifc2123f5ceaa6d3f9b31bb5cb6e77a2c8ec23818 Reviewed-on: https://go-review.googlesource.com/6613 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
* misc/ios: more predictable zoneinfo.zip locationDavid Crawshaw2015-03-031-3/+10
| | | | | | | | See golang.org/cl/6511. Change-Id: I2145a42877ed6b78400f29c2ef18969870dab5c3 Reviewed-on: https://go-review.googlesource.com/6512 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
* misc/ios: add go_darwin_arm_exec scriptDavid Crawshaw2015-03-021-0/+505
This script is getting very close to complete, and is complex enough that I'd like to get what's there so far reviewed. With it the builder is left failing on eight packages. Two of those involve correcting GOROOT which may need modifications to this script, the others are either a unix sockets bug I have to hunt down or are caused by lldb getting stuck on SIGSEGV, a TODO. Change-Id: I5ff933800167b6764b51ad195da7dcda61d59ff8 Reviewed-on: https://go-review.googlesource.com/6404 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>