Skip to content

Fix missing ifdefs when only one architecture is affected#196

Merged
vmezzela merged 1 commit intoSUSE:develfrom
marcosps:fix-ifdefs-issue
Feb 16, 2026
Merged

Fix missing ifdefs when only one architecture is affected#196
vmezzela merged 1 commit intoSUSE:develfrom
marcosps:fix-ifdefs-issue

Conversation

@marcosps
Copy link
Collaborator

For one livepatch I found that there were missing ifdefs for an ACPI file, which is weird because only x86_64 has CONFIG_ACPI set. This now makes sure that we add ifdefs if the CONFIG_ entries are not the same as cs.get_default_archs().

@marcosps marcosps requested review from fgyanz and vmezzela February 11, 2026 17:08
Copy link
Collaborator

@fgyanz fgyanz left a comment

Choose a reason for hiding this comment

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

LGTM! Tested with a different livepatch too.

conf_archs.update(val)

return sorted(conf_archs)
return set(sorted(conf_archs))
Copy link
Collaborator

Choose a reason for hiding this comment

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

conf_archs is already a set before we call sorted() on it, which transforms it into a sorted list. Instead of converting it back to a set(), we'd have the same result if we return straight away conf_arch.

or am I missing something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In my tests, it created a set already sorted in this case. Without the set created here, it fails to compare the set's in the templ code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

but two sets are be equal no matter their order: doing set(sorted(set())), has not effect.

That's why I am proposing to return directly conf_arch, that is already a set.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
@vmezzela vmezzela merged commit 5585f7c into SUSE:devel Feb 16, 2026
1 check 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.

3 participants