Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: remove specific support for FreeBSD #112876

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ go_download_sdk(
sdks = {
"darwin_amd64": ("go1.20.10.darwin-amd64.tar.gz", "9f554a97818568cdcb58b8860ebdc0d25cbe7a6441e7f8fc9612c00330d3f145"),
"darwin_arm64": ("go1.20.10.darwin-arm64.tar.gz", "4920629c1e65cf28f4fb8c74d7b2f90a1bb6333df60d2fd7e756a3436209f004"),
"freebsd_amd64": ("go1.20.10.freebsd-amd64.tar.gz", "e337b8e645e37f52d04e5f91352b929e05fd74d960b2a1c8e78977e4777c4ffa"),
"linux_amd64": ("go1.20.10.linux-amd64.tar.gz", "cb95ca59edf9d15d6e7949395756f78542383b612abced2565ad2349213a36e3"),
"linux_arm64": ("go1.20.10.linux-arm64.tar.gz", "5fa30f7c4f39c96d31756d7eab6c560ac129caf0462512c9f1fc2afa00570778"),
"windows_amd64": ("go1.20.10.windows-amd64.tar.gz", "d84f04cf636033073c114ac5c51f38d948bf21bb53b3aa9442d362e970f94b32"),
Expand Down Expand Up @@ -214,8 +213,6 @@ http_archive(

http_archive(
name = "aspect_bazel_lib",
patch_args = ["-p1"],
patches = ["//build/patches:aspect_bazel_lib.patch"],
sha256 = "0da75299c5a52737b2ac39458398b3f256e41a1a6748e5457ceb3a6225269485",
strip_prefix = "bazel-lib-1.31.2",
url = "https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel-lib-v1.31.2.tar.gz",
Expand Down Expand Up @@ -549,22 +546,18 @@ register_toolchains(
"//build/toolchains:cross_arm64_windows_toolchain",
"//build/toolchains:cross_arm64_macos_toolchain",
"//build/toolchains:cross_arm64_macos_arm_toolchain",
"//build/toolchains:node_freebsd_toolchain",
"@copy_directory_toolchains//:darwin_amd64_toolchain",
"@copy_directory_toolchains//:darwin_arm64_toolchain",
"@copy_directory_toolchains//:freebsd_amd64_toolchain",
"@copy_directory_toolchains//:linux_amd64_toolchain",
"@copy_directory_toolchains//:linux_arm64_toolchain",
"@copy_directory_toolchains//:windows_amd64_toolchain",
"@copy_to_directory_toolchains//:darwin_amd64_toolchain",
"@copy_to_directory_toolchains//:darwin_arm64_toolchain",
"@copy_to_directory_toolchains//:freebsd_amd64_toolchain",
"@copy_to_directory_toolchains//:linux_amd64_toolchain",
"@copy_to_directory_toolchains//:linux_arm64_toolchain",
"@copy_to_directory_toolchains//:windows_amd64_toolchain",
"@nodejs_toolchains//:darwin_amd64_toolchain",
"@nodejs_toolchains//:darwin_arm64_toolchain",
# NB: The freebsd node toolchain is above as //build/toolchains:node_freebsd_toolchain
"@nodejs_toolchains//:linux_amd64_toolchain",
"@nodejs_toolchains//:linux_arm64_toolchain",
"@nodejs_toolchains//:windows_amd64_toolchain",
Expand Down
1 change: 0 additions & 1 deletion build/bazelutil/distdir_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,6 @@ DISTDIR_FILES = {
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20230718-202534/libproj_foreign.windows.20230718-202534.tar.gz": "16de1e76ee8de4bd144dc57bfde05385d086943ca1b64cc246055c8b0cd71c65",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.darwin-amd64.tar.gz": "9f554a97818568cdcb58b8860ebdc0d25cbe7a6441e7f8fc9612c00330d3f145",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.darwin-arm64.tar.gz": "4920629c1e65cf28f4fb8c74d7b2f90a1bb6333df60d2fd7e756a3436209f004",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.freebsd-amd64.tar.gz": "e337b8e645e37f52d04e5f91352b929e05fd74d960b2a1c8e78977e4777c4ffa",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.linux-amd64.tar.gz": "cb95ca59edf9d15d6e7949395756f78542383b612abced2565ad2349213a36e3",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.linux-arm64.tar.gz": "5fa30f7c4f39c96d31756d7eab6c560ac129caf0462512c9f1fc2afa00570778",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.windows-amd64.tar.gz": "d84f04cf636033073c114ac5c51f38d948bf21bb53b3aa9442d362e970f94b32",
Expand Down
8 changes: 0 additions & 8 deletions build/nodejs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ _COPY_DIRECTORY_URL_PREFIX = "https://storage.googleapis.com/public-bazel-artifa
_COPY_DIRECTORY_VERSIONS = {
"darwin_amd64": "b4d39cd9498b8367ba75ad6c13c7687562dabafbf8c782883815314061f9f043",
"darwin_arm64": "1fd4268a242181d7cdbee7f8035b34548b895fd9e438fab05d48e4627e072e53",
"freebsd_amd64": "f874c274202ea767b432f05c62e716f51bd7580ea8efb1349eb29a35375408eb",
"linux_amd64": "ce4aaaf41b3b8f9589290d0f3d657400514b7361b9c27f85ac8f966ee4d663b8",
"linux_arm64": "51099a643689c2e563ab7cd9e14345dd9670ee4814ac4046501675d402decdf4",
"windows_amd64": "6df30928734abb48515ea16d1273a829651adb77b9ecbbe49e02d17cfffab519",
Expand All @@ -35,7 +34,6 @@ _COPY_TO_DIRECTORY_URL_PREFIX = "https://storage.googleapis.com/public-bazel-art
_COPY_TO_DIRECTORY_VERSIONS = {
"darwin_amd64": "dadf2fc200a14968664c4b740a76fcee700cb975eb5bfcd3215d253b97a28b23",
"darwin_arm64": "97ae06279adf44786c1151aa3e4715474603a4792fa64ec6bccb1b52fa00abc1",
"freebsd_amd64": "195becca548395db4f165e6ee1e3830b375641999f7820a2815ff52f31223981",
"linux_amd64": "cfac1d923b7039555265ecf1558200d391ffbed62804a4b8c4510b12a18d6e70",
"linux_arm64": "5c4c69f6f20ba0d6646435ad9922d6193871f3b4262cbc65295e4b89ece667a4",
"windows_amd64": "2be5d8b2771ffa3922438cda8899f782046633d6d230f744bf63031888a8bf48",
Expand Down Expand Up @@ -115,12 +113,6 @@ def declare_nodejs_repos():
node_version = _NODE_VERSION,
platform = name,
)
# This is used only by rules_nodejs to find the local version of node.
native.new_local_repository(
name = "nodejs_freebsd_amd64",
build_file_content = """exports_files[("bin/node")]""",
path = "/usr/local",
)
nodejs_repo_host_os_alias(name = "nodejs", user_node_repository_name = "nodejs")
nodejs_repo_host_os_alias(name = "nodejs_host", user_node_repository_name = "nodejs")
toolchains_repo(name = "nodejs_toolchains", user_node_repository_name = "nodejs")
Expand Down
62 changes: 0 additions & 62 deletions build/patches/aspect_bazel_lib.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ set -xeuo pipefail
GOVERS=1.20.10
GOLINK=https://go.dev/dl/go$GOVERS.src.tar.gz
SRCSHASUM=72d2f51805c47150066c103754c75fddb2c19d48c9219fa33d1e46696c841dbb
# We mirror the upstream freebsd because we don't have a cross-compiler targeting it.
GOFREEBSDLINK=https://go.dev/dl/go$GOVERS.freebsd-amd64.tar.gz
FREEBSDSHASUM=e337b8e645e37f52d04e5f91352b929e05fd74d960b2a1c8e78977e4777c4ffa

apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
Expand All @@ -27,9 +24,6 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 100 \
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-10

curl -fsSL $GOFREEBSDLINK -o /artifacts/go$GOVERS.freebsd-amd64.tar.gz
echo "$FREEBSDSHASUM /artifacts/go$GOVERS.freebsd-amd64.tar.gz" | sha256sum -c -

curl -fsSL https://go.dev/dl/go1.20.8.linux-amd64.tar.gz -o golang.tar.gz \
&& echo 'cc97c28d9c252fbf28f91950d830201aa403836cbed702a05932e63f7f0c7bc4 golang.tar.gz' | sha256sum -c - \
&& rm -rf /usr/local/go && tar -C /usr/local -xzf golang.tar.gz \
Expand Down
14 changes: 0 additions & 14 deletions build/toolchains/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -270,20 +270,6 @@ toolchain(
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)

toolchain(
name = "node_freebsd_toolchain",
exec_compatible_with = [
"@platforms//os:freebsd",
],
toolchain = ":node_freebsd_local_toolchain",
toolchain_type = "@rules_nodejs//nodejs:toolchain_type",
)

node_toolchain(
name = "node_freebsd_local_toolchain",
target_tool_path = "/usr/local/bin/node",
)

# There are aliases for each of these flags defined in .bazelrc; for example,
# --crdb_test instead of --//build/toolchains:crdb_test_flag.
#
Expand Down
28 changes: 0 additions & 28 deletions pkg/cmd/dev/doctor.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,34 +97,6 @@ Please perform the following steps:
return ""
},
},
{
name: "node",
check: func(d *dev, ctx context.Context, cfg doctorConfig) string {
// Having a pre-installed node is only necessary on freebsd.
if runtime.GOOS != "freebsd" {
return ""
}
_, err := d.exec.CommandContextSilent(ctx, "/usr/local/bin/node", "--version")
if err != nil {
return `/usr/local/bin/node not found.
You can install node with: ` + "`pkg install node`"
}
return ""
},
autofix: func(d *dev, ctx context.Context, cfg doctorConfig) error {
if !cfg.haveAutofixPermission && cfg.interactive {
response := promptInteractiveInput("Do you want me to run `pkg install node` for you?", "y")
canAutofix, ok := toBoolFuzzy(response)
if ok && canAutofix {
cfg.haveAutofixPermission = true
}
}
if !cfg.haveAutofixPermission {
return fmt.Errorf("do not have permission to install node")
}
return d.exec.CommandContextInheritingStdStreams(ctx, "pkg", "install", "node")
},
},
{
name: "submodules",
check: func(d *dev, ctx context.Context, cfg doctorConfig) string {
Expand Down
8 changes: 8 additions & 0 deletions pkg/util/grunning/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,26 @@ go_test(
],
"@io_bazel_rules_go//go/platform:freebsd_386": [
":grunning",
"//pkg/testutils/skip",
"//pkg/util/syncutil",
"@com_github_stretchr_testify//require",
],
"@io_bazel_rules_go//go/platform:freebsd_amd64": [
":grunning",
"//pkg/testutils/skip",
"//pkg/util/syncutil",
"@com_github_stretchr_testify//require",
],
"@io_bazel_rules_go//go/platform:freebsd_arm": [
":grunning",
"//pkg/testutils/skip",
"//pkg/util/syncutil",
"@com_github_stretchr_testify//require",
],
"@io_bazel_rules_go//go/platform:freebsd_arm64": [
":grunning",
"//pkg/testutils/skip",
"//pkg/util/syncutil",
"@com_github_stretchr_testify//require",
],
"@io_bazel_rules_go//go/platform:illumos_amd64": [
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/grunning/disabled.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

// See grunning.Supported() for an explanation behind this build tag.
//
//go:build freebsd || (linux && s390x) || !bazel
// +build freebsd linux,s390x !bazel
//go:build (linux && s390x) || !bazel
// +build linux,s390x !bazel

package grunning

Expand Down
4 changes: 2 additions & 2 deletions pkg/util/grunning/disabled_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

// See grunning.Supported() for an explanation behind this build tag.
//
//go:build freebsd || (linux && s390x) || !bazel
// +build freebsd linux,s390x !bazel
//go:build (linux && s390x) || !bazel
// +build linux,s390x !bazel

package grunning_test

Expand Down
3 changes: 1 addition & 2 deletions pkg/util/grunning/enabled.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

// See grunning.Supported() for an explanation behind this build tag.
//
//go:build !(freebsd || (linux && s390x) || !bazel)
// +build !freebsd
//go:build !((linux && s390x) || !bazel)
// +build !linux !s390x
// +build bazel

Expand Down
3 changes: 1 addition & 2 deletions pkg/util/grunning/enabled_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

// See grunning.Supported() for an explanation behind this build tag.
//
//go:build !(freebsd || (linux && s390x) || !bazel)
// +build !freebsd
//go:build !((linux && s390x) || !bazel)
// +build !linux !s390x
// +build bazel

Expand Down
5 changes: 1 addition & 4 deletions pkg/util/grunning/grunning.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ func Elapsed(start, end time.Duration) time.Duration {

// Supported returns true iff per-goroutine running time is available in this
// build. We use a patched Go runtime for all platforms officially supported for
// CRDB when built using Bazel. Some engineers commonly building CRDB also
// happen to use FreeBSD, which we don't use a patched Go for (we don't have
// cross-compilers setup, yet). We use 'freebsd || !bazel' as the build tag to
// exclude unsupported platforms.
// CRDB when built using Bazel.
func Supported() bool {
return supported()
}