From afe098805b5c041cf42e519b728c1f7de68f2974 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Fri, 31 May 2019 16:59:21 +1000 Subject: [PATCH] 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 Reviewed-by: Ian Lance Taylor Reviewed-by: Jason Donenfeld --- windows/mkerrors.bash | 3 +-- windows/mkerrors.go | 9 --------- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 windows/mkerrors.go diff --git a/windows/mkerrors.bash b/windows/mkerrors.bash index a70b24f3..f5c6888b 100755 --- a/windows/mkerrors.bash +++ b/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" diff --git a/windows/mkerrors.go b/windows/mkerrors.go deleted file mode 100644 index a204e6ca..00000000 --- a/windows/mkerrors.go +++ /dev/null @@ -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