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

Rust: add binary blobs #415

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Rust: add binary blobs #415

wants to merge 3 commits into from

Conversation

florianl
Copy link
Contributor

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 into main.

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]>
@florianl florianl requested review from a team as code owners March 21, 2025 15:10
Comment on lines +8 to +20
# 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
Copy link
Contributor

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/.

Copy link
Member

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.

Comment on lines +109 to +122
- 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
Copy link
Member

@christos68k christos68k Mar 21, 2025

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:

Suggested change
- 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants