-
Notifications
You must be signed in to change notification settings - Fork 304
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
Rust: add binary blobs #415
base: main
Are you sure you want to change the base?
Conversation
Similar to the eBPF blobs check the Rust blobs into git so they are available to the Go ecosystem. Signed-off-by: Florian Lehner <[email protected]>
Signed-off-by: Florian Lehner <[email protected]>
Signed-off-by: Florian Lehner <[email protected]>
# Ignore target directory | ||
target/* | ||
# But not these specific paths | ||
!target/x86_64-unknown-linux-musl/ | ||
target/x86_64-unknown-linux-musl/* | ||
!target/x86_64-unknown-linux-musl/release/ | ||
target/x86_64-unknown-linux-musl/release/* | ||
!target/x86_64-unknown-linux-musl/release/libsymblib_capi.a | ||
!target/aarch64-unknown-linux-musl/ | ||
target/aarch64-unknown-linux-musl/* | ||
!target/aarch64-unknown-linux-musl/release/ | ||
target/aarch64-unknown-linux-musl/release/* | ||
!target/aarch64-unknown-linux-musl/release/libsymblib_capi.a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this required (maybe i don't understand the exact purpose here)? Once you git add -f
the *.a
files, git status
they are excluded from target/
(yes, /target
should indeed be target/
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, these shouldn't be needed. Our current .gitignore
works.
- name: Hash Rust blobs | ||
run: | | ||
sha256sum target/*-unknown-linux-musl/release/libsymblib_capi.a > rust-blobs.hash | ||
- name: Rebuild Rust blobs | ||
run: | | ||
rm -rf target/ | ||
make rust-components TARGET_ARCH=amd64 | ||
make rust-components TARGET_ARCH=arm64 | ||
- name: Check for differences | ||
run: | | ||
if ! sha256sum --check rust-blobs.hash; then | ||
echo "Please rebuild and commit the updated Rust binary blobs." | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified and sped up, as we don't need the extra step to hash and verify the hashes. We can also let the user know exactly which blob(s) actually changed, instead of printing a generic message:
- name: Hash Rust blobs | |
run: | | |
sha256sum target/*-unknown-linux-musl/release/libsymblib_capi.a > rust-blobs.hash | |
- name: Rebuild Rust blobs | |
run: | | |
rm -rf target/ | |
make rust-components TARGET_ARCH=amd64 | |
make rust-components TARGET_ARCH=arm64 | |
- name: Check for differences | |
run: | | |
if ! sha256sum --check rust-blobs.hash; then | |
echo "Please rebuild and commit the updated Rust binary blobs." | |
exit 1 | |
fi | |
- name: Rebuild Rust blobs | |
run: | | |
rm -rf target/ | |
make rust-components TARGET_ARCH=amd64 | |
make rust-components TARGET_ARCH=arm64 | |
- name: Check for differences | |
run: | | |
if ! git diff --exit-code --name-only; then | |
echo "Binary blob(s) changed, please rebuild and commit the updated blobs." | |
exit 1 | |
fi |
We should do the same for the tracers.
This is a complementary change to #408.
It adds the Rust binary blobs to git and adds a CI check to verify their integrity.
Unfortunately, the Dockerfile needs to be updated to allow this cross compilation for Rust. The CI will fail in the scope of
check-rust-blobs
as the updated docker image will only be available once the changes to the Dockerfile got merged intomain
.