Ver Fonte

windows: delete mkerrors.go

mkerrors.go is called by 'go generate' command to generate
zerrors_windows.go

mkerrors.go executes mkerrors.bash. But mkerrors.bash requires
winerror.h to be present on the system to succeed. And winerror.h is
never present on the system. So executing mkerrors.go always fails.

zerrors_windows.go is never changes. It was changed recently once.
The change before that was in 2014.

This change removes mkerrors.go, so other commands that are part of
'go generate' execution can proceed. If someone needs to update
zerrors_windows.go, they can call mkerrors.bash directly.

Fixes golang/go#32349

Change-Id: I9b3e581e183377201e8f74c2d991d97564f36778
Reviewed-on: https://go-review.googlesource.com/c/sys/+/179582
Reviewed-by: Takuto Ikuta <tikuta@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Jason Donenfeld <Jason@zx2c4.com>
Alex Brainman há 6 anos atrás
pai
commit
afe098805b
2 ficheiros alterados com 1 adições e 11 exclusões
  1. 1 2
      windows/mkerrors.bash
  2. 0 9
      windows/mkerrors.go

+ 1 - 2
windows/mkerrors.bash

@@ -7,7 +7,6 @@
 set -e
 shopt -s nullglob
 
-[[ $# -eq 1 ]] || { echo "Usage: $0 OUTPUT_FILE.go" >&2; exit 1; }
 winerror="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/shared/winerror.h | sort -Vr | head -n 1)"
 [[ -n $winerror ]] || { echo "Unable to find winerror.h" >&2; exit 1; }
 
@@ -61,4 +60,4 @@ declare -A errors
 	done < "$winerror"
 
 	echo ")"
-} | gofmt > "$1"
+} | gofmt > "zerrors_windows.go"

+ 0 - 9
windows/mkerrors.go

@@ -1,9 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build generate
-
-package windows
-
-//go:generate ./mkerrors.bash zerrors_windows.go