Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit da0ef92

Browse files
authored
Revert "feat: add boringcrypto builds for linux (#9528)" (#9529)
This reverts commit 79cd604.
1 parent 79cd604 commit da0ef92

File tree

7 files changed

+14
-61
lines changed

7 files changed

+14
-61
lines changed

Makefile

-9
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ CODER_ARCH_IMAGE_PREREQUISITES := \
105105
build/coder_$(VERSION)_%.tar.gz
106106
endif
107107

108-
# used to decide if we can build with boringcrypto
109-
local_os:=$(shell go env GOHOSTOS)
110-
local_arch:=$(shell go env GOHOSTARCH)
111108

112109
clean:
113110
rm -rf build site/out
@@ -225,12 +222,6 @@ $(CODER_ALL_BINARIES): go.mod go.sum \
225222
build_args+=(--slim)
226223
fi
227224

228-
# boringcrypto is only supported on Linux
229-
# boringcrypto uses CGO, which isn't supported when cross compiling architectures
230-
if [[ "$$os" == "linux" ]] && [[ "${local_os}" == "linux" ]] && [[ "$$arch" == "${local_arch}" ]]; then
231-
build_args+=(--boringcrypto)
232-
fi
233-
234225
./scripts/build_go.sh "$${build_args[@]}"
235226

236227
if [[ "$$mode" == "slim" ]]; then

buildinfo/boring.go

-7
This file was deleted.

buildinfo/buildinfo.go

-4
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ func IsAGPL() bool {
8787
return strings.Contains(agpl, "t")
8888
}
8989

90-
func IsBoringCrypto() bool {
91-
return boringcrypto
92-
}
93-
9490
// ExternalURL returns a URL referencing the current Coder version.
9591
// For production builds, this will link directly to a release.
9692
// For development builds, this will link to a commit.

buildinfo/notboring.go

-5
This file was deleted.

cli/version.go

+10-15
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ import (
1313
// versionInfo wraps the stuff we get from buildinfo so that it's
1414
// easier to emit in different formats.
1515
type versionInfo struct {
16-
Version string `json:"version"`
17-
BuildTime time.Time `json:"build_time"`
18-
ExternalURL string `json:"external_url"`
19-
Slim bool `json:"slim"`
20-
AGPL bool `json:"agpl"`
21-
BoringCrypto bool `json:"boring_crypto"`
16+
Version string `json:"version"`
17+
BuildTime time.Time `json:"build_time"`
18+
ExternalURL string `json:"external_url"`
19+
Slim bool `json:"slim"`
20+
AGPL bool `json:"agpl"`
2221
}
2322

2423
// String() implements Stringer
@@ -29,9 +28,6 @@ func (vi versionInfo) String() string {
2928
_, _ = str.WriteString("(AGPL) ")
3029
}
3130
_, _ = str.WriteString(vi.Version)
32-
if vi.BoringCrypto {
33-
_, _ = str.WriteString(" BoringCrypto")
34-
}
3531

3632
if !vi.BuildTime.IsZero() {
3733
_, _ = str.WriteString(" " + vi.BuildTime.Format(time.UnixDate))
@@ -49,12 +45,11 @@ func (vi versionInfo) String() string {
4945
func defaultVersionInfo() *versionInfo {
5046
buildTime, _ := buildinfo.Time()
5147
return &versionInfo{
52-
Version: buildinfo.Version(),
53-
BuildTime: buildTime,
54-
ExternalURL: buildinfo.ExternalURL(),
55-
Slim: buildinfo.IsSlim(),
56-
AGPL: buildinfo.IsAGPL(),
57-
BoringCrypto: buildinfo.IsBoringCrypto(),
48+
Version: buildinfo.Version(),
49+
BuildTime: buildTime,
50+
ExternalURL: buildinfo.ExternalURL(),
51+
Slim: buildinfo.IsSlim(),
52+
AGPL: buildinfo.IsAGPL(),
5853
}
5954
}
6055

cli/version_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ Full build of Coder, supports the  server  subcomm
3434
"build_time": "0001-01-01T00:00:00Z",
3535
"external_url": "https://github.com/coder/coder",
3636
"slim": false,
37-
"agpl": false,
38-
"boring_crypto": false
37+
"agpl": false
3938
}
4039
`
4140
for _, tt := range []struct {

scripts/build_go.sh

+3-19
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# This script builds a single Go binary of Coder with the given parameters.
44
#
5-
# Usage: ./build_go.sh [--version 1.2.3-devel+abcdef] [--os linux] [--arch amd64] [--output path/to/output] [--slim] [--agpl] [--boringcrypto]
5+
# Usage: ./build_go.sh [--version 1.2.3-devel+abcdef] [--os linux] [--arch amd64] [--output path/to/output] [--slim] [--agpl]
66
#
77
# Defaults to linux:amd64 with slim disabled, but can be controlled with GOOS,
88
# GOARCH and CODER_SLIM_BUILD=1. If no version is specified, defaults to the
@@ -22,9 +22,6 @@
2222
#
2323
# If the --agpl parameter is specified, builds only the AGPL-licensed code (no
2424
# Coder enterprise features).
25-
#
26-
# If the --boringcrypto parameter is specified, builds use boringcrypto instead of
27-
# the standard go crypto libraries.
2825

2926
set -euo pipefail
3027
# shellcheck source=scripts/lib.sh
@@ -37,9 +34,8 @@ slim="${CODER_SLIM_BUILD:-0}"
3734
sign_darwin="${CODER_SIGN_DARWIN:-0}"
3835
output_path=""
3936
agpl="${CODER_BUILD_AGPL:-0}"
40-
boringcrypto=${CODER_BUILD_BORINGCRYPTO:-0}
4137

42-
args="$(getopt -o "" -l version:,os:,arch:,output:,slim,agpl,sign-darwin,boringcrypto -- "$@")"
38+
args="$(getopt -o "" -l version:,os:,arch:,output:,slim,agpl,sign-darwin -- "$@")"
4339
eval set -- "$args"
4440
while true; do
4541
case "$1" in
@@ -72,10 +68,6 @@ while true; do
7268
sign_darwin=1
7369
shift
7470
;;
75-
--boringcrypto)
76-
boringcrypto=1
77-
shift
78-
;;
7971
--)
8072
shift
8173
break
@@ -148,15 +140,7 @@ cmd_path="./enterprise/cmd/coder"
148140
if [[ "$agpl" == 1 ]]; then
149141
cmd_path="./cmd/coder"
150142
fi
151-
152-
cgo=0
153-
goexp=""
154-
if [[ "$boringcrypto" == 1 ]]; then
155-
cgo=1
156-
goexp="boringcrypto"
157-
fi
158-
159-
GOEXPERIMENT="$goexp" CGO_ENABLED="$cgo" GOOS="$os" GOARCH="$arch" GOARM="$arm_version" go build \
143+
CGO_ENABLED=0 GOOS="$os" GOARCH="$arch" GOARM="$arm_version" go build \
160144
"${build_args[@]}" \
161145
"$cmd_path" 1>&2
162146

0 commit comments

Comments
 (0)