- Notifications
You must be signed in to change notification settings - Fork927
feat: add boringcrypto builds for linux#9528
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//go:build boringcrypto | ||
package buildinfo | ||
import "crypto/boring" | ||
var boringcrypto = boring.Enabled() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !boringcrypto | ||
package buildinfo | ||
var boringcrypto = false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,7 +2,7 @@ | ||
# This script builds a single Go binary of Coder with the given parameters. | ||
# | ||
# Usage: ./build_go.sh [--version 1.2.3-devel+abcdef] [--os linux] [--arch amd64] [--output path/to/output] [--slim] [--agpl] [--boringcrypto] | ||
# | ||
# Defaults to linux:amd64 with slim disabled, but can be controlled with GOOS, | ||
# GOARCH and CODER_SLIM_BUILD=1. If no version is specified, defaults to the | ||
@@ -22,6 +22,9 @@ | ||
# | ||
# If the --agpl parameter is specified, builds only the AGPL-licensed code (no | ||
# Coder enterprise features). | ||
# | ||
# If the --boringcrypto parameter is specified, builds use boringcrypto instead of | ||
# the standard go crypto libraries. | ||
set -euo pipefail | ||
# shellcheck source=scripts/lib.sh | ||
@@ -34,8 +37,9 @@ slim="${CODER_SLIM_BUILD:-0}" | ||
sign_darwin="${CODER_SIGN_DARWIN:-0}" | ||
output_path="" | ||
agpl="${CODER_BUILD_AGPL:-0}" | ||
boringcrypto=${CODER_BUILD_BORINGCRYPTO:-0} | ||
args="$(getopt -o "" -l version:,os:,arch:,output:,slim,agpl,sign-darwin,boringcrypto -- "$@")" | ||
eval set -- "$args" | ||
while true; do | ||
case "$1" in | ||
@@ -68,6 +72,10 @@ while true; do | ||
sign_darwin=1 | ||
shift | ||
;; | ||
--boringcrypto) | ||
boringcrypto=1 | ||
shift | ||
;; | ||
--) | ||
shift | ||
break | ||
@@ -140,7 +148,15 @@ cmd_path="./enterprise/cmd/coder" | ||
if [[ "$agpl" == 1 ]]; then | ||
cmd_path="./cmd/coder" | ||
fi | ||
cgo=0 | ||
goexp="" | ||
if [[ "$boringcrypto" == 1 ]]; then | ||
cgo=1 | ||
goexp="boringcrypto" | ||
fi | ||
GOEXPERIMENT="$goexp" CGO_ENABLED="$cgo" GOOS="$os" GOARCH="$arch" GOARM="$arm_version" go build \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. nope, I tested | ||
"${build_args[@]}" \ | ||
"$cmd_path" 1>&2 | ||