From 446ad8e35ce47687ac27480d6a98592266986245 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Sat, 9 Feb 2019 09:14:39 -0800 Subject: [PATCH] unix: require GOOS be set in mksyscall If you don't set GOOS and you try to regenerate the darwin files, it appears to succeed. However, because libc was not selected, it generates broken code. Change-Id: I20fb4f51dcc539a03b6c6ed03ce39b78d5987d41 Reviewed-on: https://go-review.googlesource.com/c/161719 Run-TryBot: Josh Bleecher Snyder TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- unix/mksyscall.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unix/mksyscall.go b/unix/mksyscall.go index 890652ca..e06e4253 100644 --- a/unix/mksyscall.go +++ b/unix/mksyscall.go @@ -88,6 +88,10 @@ func parseParam(p string) Param { func main() { // Get the OS and architecture (using GOARCH_TARGET if it exists) goos := os.Getenv("GOOS") + if goos == "" { + fmt.Fprintln(os.Stderr, "GOOS not defined in environment") + os.Exit(1) + } goarch := os.Getenv("GOARCH_TARGET") if goarch == "" { goarch = os.Getenv("GOARCH")