Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
spikecurtis merged 3 commits intomainfromspike/9087-build-with-boringcrypto
Sep 5, 2023

Conversation

spikecurtis
Copy link
Contributor

@spikecurtisspikecurtis commentedSep 5, 2023
edited
Loading

fixes#9087

Adds support for building with Boring Crypto on Linux, when not cross-compiling.

It's maybe a little surprising for us to build different versions of Coder binaries depending on where you build. I chose to do it this way so that everyone gets boring crypto if available on their platform, so that we're not having people develop against non-boring-crypto and then shipping a different build that we haven't been testing with.

It also leaves debug symbols in boring crypto binaries, since it is hard to verify we are building with boring crypto without these.This increases binary sizes by about 5MiB for the linux amd64 slim binary (39 -> 44) and 8MiB (184 -> 192) for the fat linux amd64 binary.

Signed-off-by: Spike Curtis <spike@coder.com>
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do we need tobuild with boringcrypto, or just provide theoption to build with boringcrypto? It's a shame that we need to leave the debugging symbols in.

@mafredri
Copy link
Member

Re: debug symbols, could we strip them after we’ve verified the build?

deansheather reacted with thumbs up emoji

@spikecurtis
Copy link
ContributorAuthor

Re: debug symbols, could we strip them after we’ve verified the build?

We could, but then customers wouldn't be able to verify.

@spikecurtis
Copy link
ContributorAuthor

Do we need tobuild with boringcrypto, or just provide theoption to build with boringcrypto? It's a shame that we need to leave the debugging symbols in.

We need to be able to ship boringcrypto builds, and I don't think we should ship variants for a single OS/arch: i.e. if you run on Linux amd64 you get boringcrypto.

@mafredri
Copy link
Member

We could, but then customers wouldn't be able to verify.

I was thinking we would addldflags+=(-X "'github.com/coder/coder/v2/buildinfo.boringcrypto=true'") and output this incoder version [--output json].

We could also archive the non-stripped binaries for potential verification and/or use where symbols maybe be needed.

@mafredri
Copy link
Member

mafredri commentedSep 5, 2023
edited
Loading

I was thinking we would addldflags+=(-X "'github.com/coder/coder/v2/buildinfo.boringcrypto=true'") and output this incoder version [--output json].

We could also archive the non-stripped binaries for potential verification and/or use where symbols maybe be needed.

Actually, on second thought, we could utilize build tags here:

//go:build boringcryptopackage buildinfoimport"crypto/boring"var (boringcrypto=boring.Enabled())

With this, I assume we may not even need to verify via symbols 🤔 (but we could, just to be safe).

spikecurtis reacted with thumbs up emoji

Signed-off-by: Spike Curtis <spike@coder.com>
@spikecurtisspikecurtis requested review frommafredri and removed request forkylecarbsSeptember 5, 2023 12:51
@spikecurtis
Copy link
ContributorAuthor

Thanks@mafredri --- added to BuildInfo

Copy link
Member

@mafredrimafredri left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looking nice!

Edit: Looks likeTestVersion/JSON_output needs updating.

goexp="boringcrypto"
fi

GOEXPERIMENT="$goexp" CGO_ENABLED="$cgo" GOOS="$os" GOARCH="$arch" GOARM="$arm_version" go build \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Does-boringcrypto also need to be added togo build args?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

nope, I testedcoder version on a binary I built.GOEXPERIMENT=boringcrypto is enough.

mafredri reacted with thumbs up emoji
Signed-off-by: Spike Curtis <spike@coder.com>
@spikecurtisspikecurtisenabled auto-merge (squash)September 5, 2023 13:04
@spikecurtisspikecurtis merged commit79cd604 intomainSep 5, 2023
@spikecurtisspikecurtis deleted the spike/9087-build-with-boringcrypto branchSeptember 5, 2023 13:12
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 5, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

@deansheatherdeansheatherdeansheather approved these changes

Assignees

@spikecurtisspikecurtis

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Build Coder with boringcrypto
4 participants
@spikecurtis@mafredri@johnstcn@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp