Skip to content

Commit

Permalink
Revert "Add automatic platform detection from inbound crosstool_top a…
Browse files Browse the repository at this point in the history
…nd cpu (#2859)"

This reverts commit 026db6d.
  • Loading branch information
fmeum committed Mar 1, 2023
1 parent 7ed6bde commit db43b93
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 82 deletions.
5 changes: 0 additions & 5 deletions go/platform/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,3 @@ bzl_library(
name = "apple",
srcs = ["apple.bzl"],
)

bzl_library(
name = "crosstool",
srcs = ["crosstool.bzl"],
)
58 changes: 0 additions & 58 deletions go/platform/crosstool.bzl

This file was deleted.

1 change: 0 additions & 1 deletion go/private/rules/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ bzl_library(
"//proto:__pkg__",
],
deps = [
"//go/platform:crosstool",
"//go/private:mode",
"//go/private:platforms",
"//go/private:providers",
Expand Down
13 changes: 0 additions & 13 deletions go/private/rules/transition.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ load(
"GoLibrary",
"GoSource",
)
load(
"//go/platform:crosstool.bzl",
"platform_from_crosstool",
)

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

goos = getattr(attr, "goos", "auto")
goarch = getattr(attr, "goarch", "auto")
crosstool_top = settings.pop("//command_line_option:crosstool_top")
cpu = settings.pop("//command_line_option:cpu")
_check_ternary("pure", pure)
if goos != "auto" or goarch != "auto":
if goos == "auto":
Expand All @@ -109,11 +103,6 @@ def _go_transition_impl(settings, attr):
fail('pure is "off" but cgo is not supported on {} {}'.format(goos, goarch))
platform = "@io_bazel_rules_go//go/toolchain:{}_{}{}".format(goos, goarch, "_cgo" if cgo else "")
settings["//command_line_option:platforms"] = platform
else:
# If not auto, try to detect the platform the inbound crosstool/cpu.
platform = platform_from_crosstool(crosstool_top, cpu)
if platform:
settings["//command_line_option:platforms"] = platform

tags = getattr(attr, "gotags", [])
if tags:
Expand Down Expand Up @@ -171,8 +160,6 @@ request_nogo_transition = transition(
go_transition = transition(
implementation = _go_transition_impl,
inputs = [
"//command_line_option:cpu",
"//command_line_option:crosstool_top",
"//command_line_option:platforms",
] + TRANSITIONED_GO_SETTING_KEYS,
outputs = [
Expand Down
5 changes: 0 additions & 5 deletions go/tools/builders/stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ You may need to use the flags --cpu=x64_windows --compiler=mingw-gcc.`)
b.WriteString(sep)
sep = "|"
b.WriteString(regexp.QuoteMeta(f))
// If the flag if -framework, the flag value needs to be in the same
// condition.
if f == "-framework" {
sep = " "
}
}
os.Setenv("CGO_LDFLAGS_ALLOW", b.String())
os.Setenv("GODEBUG", "installgoroot=all")
Expand Down

0 comments on commit db43b93

Please sign in to comment.