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

Statically link linkerd-await #418

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ test *flags:

# Build linkerd-await
build:
{{ _cargo }} build --frozen --target={{ _cargo_target }} \
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that this is enough to safely distribute a binary. As I search around, I find a bunch of information suggesting that there are problems statically linking against glibc. However, we have prior art for linking against musl:

https://github.com/linkerd/linkerd2/blob/b16f3f0825b8639b889501cb24583cb9d3d22002/policy-controller/Dockerfile#L13-L22

https://github.com/olix0r/hokay/blob/ad64b990bf70cebbe939d5a6e81d16ac837ce443/.github/workflows/release.yml#L56-L150

This requires some CI surgery, but I can port one of these over.

Before doing that, though, I want to confirm that the original problem we're solving can't be more easily solved by rebuilding the binaries against a newer version of glibc.

Copy link
Member

Choose a reason for hiding this comment

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

Ah. It looks like distributing binaries statically linked against GNU libc (LGPLv2.1) may have licensing implications, the extent of which I do not immediately understand.

RUSTFLAGS='-C target-feature=+crt-static' {{ _cargo }} build --frozen --target={{ _cargo_target }} \
{{ if build_type == "release" { "--release" } else { "" } }} \
{{ _fmt }}

Expand Down
Loading