Skip to content

Conversation

RonFed
Copy link
Contributor

@RonFed RonFed commented Jun 7, 2025

The current code checks for the existence of any btf.Struct when deciding to import the "structs" package.
Change this to check the underlying type is struct. This handles cases where all the structs are using typedef.

@RonFed RonFed marked this pull request as ready for review June 7, 2025 15:35
@RonFed RonFed requested a review from a team as a code owner June 7, 2025 15:35
When deciding whether to import package structs, the logic only considered
typical struct declarations. Typedefs also need to be taken into account.

Signed-off-by: Ron Federman <ron@odigos.io>
Co-authored-by: Timo Beckers <timo@isovalent.com>
@ti-mo ti-mo force-pushed the bpf2go_structs_import_fix branch from 872d5cd to 3f9adc7 Compare June 10, 2025 08:25
@ti-mo ti-mo changed the title fix: [bpf2go] check for underlying type for needsStructsPkg bpf2go: import package structs when all structs are typedefs Jun 10, 2025
Copy link
Collaborator

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

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

Thanks! I changed the check to use btf.As.

@ti-mo ti-mo merged commit 5bfac49 into cilium:main Jun 10, 2025
17 of 18 checks passed
@lmb
Copy link
Collaborator

lmb commented Jun 19, 2025

Thanks!

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