Skip to content

Commit 224a39a

Browse files
committed
Revert "Add automatic platform detection from inbound crosstool_top and cpu (#2859)"
This reverts commit 026db6d.
1 parent 7ed6bde commit 224a39a

File tree

3 files changed

+0
-76
lines changed

3 files changed

+0
-76
lines changed

go/platform/crosstool.bzl

Lines changed: 0 additions & 58 deletions
This file was deleted.

go/private/rules/transition.bzl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ load(
3232
"GoLibrary",
3333
"GoSource",
3434
)
35-
load(
36-
"//go/platform:crosstool.bzl",
37-
"platform_from_crosstool",
38-
)
3935

4036
# A list of rules_go settings that are possibly set by go_transition.
4137
# Keep their package name in sync with the implementation of
@@ -95,8 +91,6 @@ def _go_transition_impl(settings, attr):
9591

9692
goos = getattr(attr, "goos", "auto")
9793
goarch = getattr(attr, "goarch", "auto")
98-
crosstool_top = settings.pop("//command_line_option:crosstool_top")
99-
cpu = settings.pop("//command_line_option:cpu")
10094
_check_ternary("pure", pure)
10195
if goos != "auto" or goarch != "auto":
10296
if goos == "auto":
@@ -109,11 +103,6 @@ def _go_transition_impl(settings, attr):
109103
fail('pure is "off" but cgo is not supported on {} {}'.format(goos, goarch))
110104
platform = "@io_bazel_rules_go//go/toolchain:{}_{}{}".format(goos, goarch, "_cgo" if cgo else "")
111105
settings["//command_line_option:platforms"] = platform
112-
else:
113-
# If not auto, try to detect the platform the inbound crosstool/cpu.
114-
platform = platform_from_crosstool(crosstool_top, cpu)
115-
if platform:
116-
settings["//command_line_option:platforms"] = platform
117106

118107
tags = getattr(attr, "gotags", [])
119108
if tags:
@@ -171,8 +160,6 @@ request_nogo_transition = transition(
171160
go_transition = transition(
172161
implementation = _go_transition_impl,
173162
inputs = [
174-
"//command_line_option:cpu",
175-
"//command_line_option:crosstool_top",
176163
"//command_line_option:platforms",
177164
] + TRANSITIONED_GO_SETTING_KEYS,
178165
outputs = [

go/tools/builders/stdlib.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ You may need to use the flags --cpu=x64_windows --compiler=mingw-gcc.`)
103103
b.WriteString(sep)
104104
sep = "|"
105105
b.WriteString(regexp.QuoteMeta(f))
106-
// If the flag if -framework, the flag value needs to be in the same
107-
// condition.
108-
if f == "-framework" {
109-
sep = " "
110-
}
111106
}
112107
os.Setenv("CGO_LDFLAGS_ALLOW", b.String())
113108
os.Setenv("GODEBUG", "installgoroot=all")

0 commit comments

Comments
 (0)