Check that compiled binaries are static + fix static compilation #344
No reviewers
Labels
No labels
action
check-aws
action
discussion-needed
action
for-external-contributors
action
for-newcomers
action
more-info-needed
action
need-funding
action
triage-required
kind
correctness
kind
ideas
kind
improvement
kind
performance
kind
testing
kind
usability
kind
wrong-behavior
prio
critical
prio
low
scope
admin-api
scope
background-healing
scope
build
scope
documentation
scope
k8s
scope
layout
scope
metadata
scope
ops
scope
rpc
scope
s3-api
scope
security
scope
telemetry
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#344
Loading…
Reference in a new issue
No description provided.
Delete branch "bug/check_static"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The problem
linux/arm + linux/arm64 binaries were dynamically compiled instead of statically compiled.
It is due to this commit
b54a938724
that change the override from the
garage
crate to thegarage_rpc
crate.The change was targeted at the GIT_VERSION variable but impacted the nix hardening configuration too.
After the patch, the PIE feature was not anymore deactivated during the linking of the
garage
binary,which lead to a conflict: static pie is not supported on arm/arm64 and thus lead the compiler to ignore the static parameter in favor of the pie parameter.
We did not notice this bug until it was reported recently because we don't ensure that compiled binaries are static.
The fix
shell.nix
file to be both simpler and more idiomatic. Now you can spawn a specific shell with:nix-shell -A rust
to have a compilation shellnix-shell -A integration
to have a shell with all binaries required by the "smoke test"nix-shell -A release
to have a shell with kaniko and bash functions dedicated to binary/container publishingOut of scope
Running functional+smoke tests with qemu-user is outside of this PR scope.
Note
We can not use
ldd
as it does not work with cross compiled binaries.file
seems to work as intended.Closing in favor of #345
Pull request closed