Skip to content

Commit e94e234

Browse files
authored
Rust: add binary blobs (#415)
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
1 parent 0708a7f commit e94e234

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

.github/workflows/unit-test-on-pull-request.yml

+12-8
Original file line numberDiff line numberDiff line change
@@ -74,29 +74,33 @@ jobs:
7474
- name: Tests
7575
run: make test TARGET_ARCH=${{ matrix.target_arch }}
7676

77-
check-ebpf-blobs:
78-
name: Check for differences in the eBPF binary blobs
77+
check-binary-blobs:
78+
name: Check for differences in the eBPF and Rust binary blobs
7979
runs-on: ubuntu-24.04
8080
container: otel/opentelemetry-ebpf-profiler-dev:latest
81+
defaults:
82+
run:
83+
shell: bash --login {0}
8184
steps:
8285
- name: Clone code
8386
uses: actions/checkout@v4
84-
- name: Hash eBPF blobs
85-
run: |
86-
sha256sum support/ebpf/tracer.ebpf.release.* > ebpf-blobs.hash
8787
- name: Rebuild eBPF blobs
8888
run: |
8989
rm support/ebpf/tracer.ebpf.release.*
9090
make amd64 -C support/ebpf
9191
make arm64 -C support/ebpf
92+
- name: Rebuild Rust blobs
93+
run: |
94+
rm -rf target/
95+
make rust-components TARGET_ARCH=amd64
96+
make rust-components TARGET_ARCH=arm64
9297
- name: Check for differences
9398
run: |
94-
if ! sha256sum --check ebpf-blobs.hash; then
95-
echo "Please rebuild and commit the updated eBPF binary blobs."
99+
if ! git diff --exit-code --name-only; then
100+
echo "Binary blob(s) changed, please rebuild and commit the updated blobs."
96101
exit 1
97102
fi
98103
99-
100104
build-integration-test-binaries:
101105
name: Build integration test binaries (${{ matrix.target_arch }})
102106
runs-on: ubuntu-24.04

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55
/go
66
ebpf-profiler
77
ci-kernels
8-
/target
8+
# Ignore target directory
9+
target/*
10+
# But not these specific paths
11+
!target/x86_64-unknown-linux-musl/release/libsymblib_capi.a
12+
!target/aarch64-unknown-linux-musl/release/libsymblib_capi.a

Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ FROM debian:testing-20241223-slim
22

33
WORKDIR /agent
44

5+
RUN dpkg --add-architecture amd64 && dpkg --add-architecture arm64
6+
57
# cross_debian_arch: amd64 or arm64
68
# cross_pkg_arch: x86-64 or aarch64
79
RUN cross_debian_arch=$(uname -m | sed -e 's/aarch64/amd64/' -e 's/x86_64/arm64/'); \
810
cross_pkg_arch=$(uname -m | sed -e 's/aarch64/x86-64/' -e 's/x86_64/aarch64/'); \
911
apt-get update -y && \
1012
apt-get dist-upgrade -y && \
1113
apt-get install -y curl wget make git cmake clang-17 unzip libc6-dev g++ gcc pkgconf \
12-
gcc-${cross_pkg_arch}-linux-gnu libc6-${cross_debian_arch}-cross musl-dev && \
14+
gcc-${cross_pkg_arch}-linux-gnu libc6-${cross_debian_arch}-cross \
15+
musl-dev:amd64 musl-dev:arm64 && \
1316
apt-get clean autoclean && \
1417
apt-get autoremove --yes
1518

Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)