From 09ed29a8e3bab43fe2d2c27856a4e5c85129d666 Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Wed, 3 Oct 2018 14:34:08 -0400 Subject: [PATCH] Remove SDK testdata files with '!' characters in names This makes old versions of Bazel very unhappy. --- go/private/sdk.bzl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/go/private/sdk.bzl b/go/private/sdk.bzl index 49f77d2eed..fecc8dd3cb 100644 --- a/go/private/sdk.bzl +++ b/go/private/sdk.bzl @@ -94,6 +94,12 @@ def _prepare(ctx): ctx.file("packages.txt", result.stdout) ctx.file("ROOT", "") + # Go 1.11.1 contains testdata files with '!' in their filenames which + # older versions of Bazel (0.10.0) don't like. Remove if we downloaded + # the SDK. If this is a local SDK, we're probably out of luck. + sh = ctx.os.environ.get("BAZEL_SH", "/bin/sh") + env_execute(ctx, arguments = [sh, "-c", "[ -d src -a ! -L src ] && rm -f src/cmd/go/testdata/mod/*!*"]) + def _remote_sdk(ctx, urls, strip_prefix, sha256): ctx.download_and_extract( url = urls,