Skip to content

libbpf-cargo: Use original obj name when not embedding bytes in skel#1354

Merged
d-e-s-o merged 1 commit intolibbpf:masterfrom
kxxt:use-original-name-for-skel
Mar 10, 2026
Merged

libbpf-cargo: Use original obj name when not embedding bytes in skel#1354
d-e-s-o merged 1 commit intolibbpf:masterfrom
kxxt:use-original-name-for-skel

Conversation

@kxxt
Copy link
Contributor

@kxxt kxxt commented Mar 8, 2026

When reference_obj is true and object path is not set, a hash is added in the output bpf object filename, which in turn caused the generated skel to contain identifiers containing that hash (for example, TracexecSystem19301daf7155cef5SkelBuilder). It makes referencing these identifiers in Rust code unreliable as the hash could change.

This patch fixes it by making libbpf-cargo use the original object name for generating the skel when the output object path is not explicitly set.

@kxxt kxxt force-pushed the use-original-name-for-skel branch from 8264bfa to 55b8ce5 Compare March 8, 2026 02:30
Copy link
Collaborator

@d-e-s-o d-e-s-o left a comment

Choose a reason for hiding this comment

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

Seems mostly fine to me, thanks!

When reference_obj is true and object path is not set, a hash is added in
the output bpf object filename, which in turn caused the generated skel
to contain identifiers containing that hash (for example,
TracexecSystem19301daf7155cef5SkelBuilder). It makes referencing these
identifiers in Rust code unreliable as the hash could change.

This patch fixes it by making libbpf-cargo use the original object name
for generating the skel when the output object path is not explicitly
set.
@kxxt kxxt force-pushed the use-original-name-for-skel branch from 55b8ce5 to 8710f9b Compare March 9, 2026 23:49
@d-e-s-o d-e-s-o merged commit 35484c8 into libbpf:master Mar 10, 2026
18 checks passed
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.

2 participants