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

chore: Build statically linked binary #402

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

jschwinger233
Copy link
Member

@jschwinger233 jschwinger233 commented Jan 2, 2024

Background

This PR makes dae binary statically linked:

dae $ CGO_ENABLED=1 make
-strip=/usr/bin/llvm-strip
Compiled /home/gray/src/github.com/daeuniverse/dae/control/bpf_bpfel.o
Stripped /home/gray/src/github.com/daeuniverse/dae/control/bpf_bpfel.o
Wrote /home/gray/src/github.com/daeuniverse/dae/control/bpf_bpfel.go
Compiled /home/gray/src/github.com/daeuniverse/dae/control/bpf_bpfeb.o
Stripped /home/gray/src/github.com/daeuniverse/dae/control/bpf_bpfeb.o
Wrote /home/gray/src/github.com/daeuniverse/dae/control/bpf_bpfeb.go
-DMAX_MATCH_SET_LEN=64 -O2 -Wall -Werror
go build -o dae -trimpath -ldflags "-s -w -X github.com/daeuniverse/dae/cmd.Version=unstable-20240102.r642.d69b023 -X github.com/daeuniverse/dae/common/consts.MaxMatchSetLen_=64"  .

dae $ file dae
dae: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, Go BuildID=h8QVSMkpKNNUwfTNG4Lv/7b4sUbYhT9lAsDAn0CHn/cA_9FtALnDheLIJ1We-9/z5nghMosW3BTGulv8Or6
, stripped

dae $ make
-strip=/usr/bin/llvm-strip
Compiled /home/gray/src/github.com/daeuniverse/dae/control/bpf_bpfel.o
Stripped /home/gray/src/github.com/daeuniverse/dae/control/bpf_bpfel.o
Wrote /home/gray/src/github.com/daeuniverse/dae/control/bpf_bpfel.go
Compiled /home/gray/src/github.com/daeuniverse/dae/control/bpf_bpfeb.o
Stripped /home/gray/src/github.com/daeuniverse/dae/control/bpf_bpfeb.o
Wrote /home/gray/src/github.com/daeuniverse/dae/control/bpf_bpfeb.go
-DMAX_MATCH_SET_LEN=64 -O2 -Wall -Werror
go build -o dae -trimpath -ldflags "-s -w -X github.com/daeuniverse/dae/cmd.Version=unstable-20240102.r642.d69b023 -X github.com/daeuniverse/dae/common/consts.MaxMatchSetLen_=64"  .

dae $ file dae
dae: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=81YyLKLSJzIgTeh6Pmcp/e31GkTgqxlRv9sm0mNUr/kKVRNUzqQWnqUh8qC5VH/FnhXPMkOVptxxIbjmCF-, stripped

Checklist

Full Changelogs

  • [Implement ...]

Issue Reference

Closes #[issue number]

Test Result

@jschwinger233 jschwinger233 requested a review from a team as a code owner January 2, 2024 12:18
@dae-prow dae-prow bot added the chore label Jan 2, 2024
@jschwinger233 jschwinger233 requested a review from mzz2017 January 2, 2024 12:20
@jschwinger233 jschwinger233 force-pushed the gray/static-build branch 2 times, most recently from d69b023 to 5cc3815 Compare January 2, 2024 12:35
mzz2017
mzz2017 previously approved these changes Jan 2, 2024
Copy link
Contributor

@mzz2017 mzz2017 left a comment

Choose a reason for hiding this comment

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

image

LGTM!

Copy link
Contributor

@sumire88 sumire88 left a comment

Choose a reason for hiding this comment

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

Let’s Go!

@sumire88 sumire88 added the tested label Jan 2, 2024
Copy link
Contributor

@dae-prow dae-prow bot left a comment

Choose a reason for hiding this comment

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

🧪 Since the PR has been fully tested, please consider merging it.

@mzz2017 mzz2017 merged commit d0798be into daeuniverse:main Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants