cmd/buildlet: add riscv64 buildlet

Somebody else will need to run "make buildlet.linux-riscv64" for me to upload
the binary to GCS.

Updates golang/go#27532
Fixes golang/go#36871

Change-Id: I0ae8dea0f33c79801670d1f9a02a29b31d739e31
Reviewed-on: https://go-review.googlesource.com/c/build/+/216765
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/cmd/buildlet/Makefile b/cmd/buildlet/Makefile
index 7258a0e..20cbb5b 100644
--- a/cmd/buildlet/Makefile
+++ b/cmd/buildlet/Makefile
@@ -35,7 +35,7 @@
 	GOOS=windows GOARCH=amd64 go install golang.org/x/build/cmd/buildlet
 
 # buildlet.all is compiles & uploads all targets.
-buildlet.all: FORCE buildlet.aix-ppc64 buildlet.darwin-amd64 buildlet.freebsd-amd64 buildlet.linux-amd64 buildlet.netbsd-386 buildlet.netbsd-amd64 buildlet.netbsd-arm buildlet.openbsd-amd64.go1.10 buildlet.openbsd-386.go1.10 buildlet.openbsd-amd64 buildlet.openbsd-386 buildlet.plan9-386 buildlet.windows-amd64 buildlet.windows-arm buildlet.linux-arm buildlet.linux-arm-arm5 buildlet.linux-arm64 buildlet.linux-mips buildlet.linux-mipsle buildlet.linux-mips64 buildlet.linux-mips64le buildlet.linux-ppc64 buildlet.linux-ppc64le buildlet.linux-s390x buildlet.solaris-amd64 buildlet.illumos-amd64
+buildlet.all: FORCE buildlet.aix-ppc64 buildlet.darwin-amd64 buildlet.freebsd-amd64 buildlet.linux-amd64 buildlet.netbsd-386 buildlet.netbsd-amd64 buildlet.netbsd-arm buildlet.openbsd-amd64.go1.10 buildlet.openbsd-386.go1.10 buildlet.openbsd-amd64 buildlet.openbsd-386 buildlet.plan9-386 buildlet.windows-amd64 buildlet.windows-arm buildlet.linux-arm buildlet.linux-arm-arm5 buildlet.linux-arm64 buildlet.linux-riscv64 buildlet.linux-mips buildlet.linux-mipsle buildlet.linux-mips64 buildlet.linux-mips64le buildlet.linux-ppc64 buildlet.linux-ppc64le buildlet.linux-s390x buildlet.solaris-amd64 buildlet.illumos-amd64
 	echo "done"
 
 buildlet.aix-ppc64: FORCE
@@ -136,6 +136,10 @@
 	go install golang.org/x/build/cmd/upload
 	upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet --public --cacheable=false go-builder-data/$@
 
+buildlet.linux-riscv64: FORCE
+	go install golang.org/x/build/cmd/upload
+	upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet --go=gotip --public --cacheable=false go-builder-data/$@
+
 buildlet.linux-mips: FORCE
 	go install golang.org/x/build/cmd/upload
 	upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet --public --cacheable=false go-builder-data/$@
diff --git a/dashboard/builders.go b/dashboard/builders.go
index ad19615..08c0614 100644
--- a/dashboard/builders.go
+++ b/dashboard/builders.go
@@ -1550,8 +1550,8 @@
 	addMiscCompile("-netbsd", "^netbsd-")                    // 4: amd64, 386, arm, arm64
 	addMiscCompile("-openbsd", "^openbsd-")                  // 4: amd64, 386, arm, arm64
 
-	// And 3 that don't fit above:
-	addMiscCompile("-other", "^(windows-arm|linux-s390x|dragonfly-amd64)$")
+	// And 4 that don't fit above:
+	addMiscCompile("-other", "^(windows-arm|linux-s390x|linux-riscv64|dragonfly-amd64)$")
 	// TODO: Issue 25963, get the misc-compile trybots for
 	// subrepos too, so "mobile" can at least be included as a
 	// misc-compile for ^android- and ^darwin-arm.
diff --git a/dashboard/builders_test.go b/dashboard/builders_test.go
index 4ae7202..2bee242 100644
--- a/dashboard/builders_test.go
+++ b/dashboard/builders_test.go
@@ -780,9 +780,6 @@
 			// up enough for e.g. compiling android-386
 			// from linux-amd64. (Issue #35596 too)
 			return
-		} else if goarch == "riscv64" {
-			// TODO(golang.org/issue/36871): Add a misc-compile trybot (or a real trybot).
-			return
 		}
 		goosArch := goos + "-" + goarch
 		if done[goosArch] {
diff --git a/go.mod b/go.mod
index 238049f..491079c 100644
--- a/go.mod
+++ b/go.mod
@@ -26,7 +26,7 @@
 	golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a
 	golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852
 	golang.org/x/sync v0.0.0-20190423024810-112230192c58
-	golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82
+	golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9
 	golang.org/x/text v0.3.2
 	golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
 	google.golang.org/api v0.4.0
diff --git a/go.sum b/go.sum
index 644d71b..27ea2a7 100644
--- a/go.sum
+++ b/go.sum
@@ -106,8 +106,8 @@
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 h1:vsphBvatvfbhlb4PO1BYSr9dzugGxJ/SQHoNufZJq1w=
-golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk=
+golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=