Skip to content

Use explicit plugin names to prevent subtle macro processing bugs#482

Merged
troglobit merged 1 commit intofinit-project:masterfrom
vazub:plugfix
Mar 16, 2026
Merged

Use explicit plugin names to prevent subtle macro processing bugs#482
troglobit merged 1 commit intofinit-project:masterfrom
vazub:plugfix

Conversation

@vazub
Copy link

@vazub vazub commented Mar 6, 2026

Here is the problem I recently encountered - no plugins were loading, even those statically compiled-in by default.

After a few days of debugging, I found out that __FILE__ macro was getting corrupted on expansion/processing, most likely due to either too long of a path (in my edge case it was something like /home/bazub/.cache/kiss/proc/9352/build/finit/src/../plugins/procps.c), or due to basename/trim processing, or some other factor.

Initial mitigation idea was to change all instances to __FILE_NAME__ macro, which is supported by Clang, and GCC12+, but it proved to be inconsistent - some plugins were still unrecognized and failing.

The final solution turned out to be even simpler - just use the explicit static names. Macro processing magic is completely unnecessary here, and just wastes cycles, while introducing subtle bugs in the process. KISS is the way.

Copy link
Collaborator

@troglobit troglobit left a comment

Choose a reason for hiding this comment

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

Reluctantly approved 😅

@troglobit troglobit merged commit 4867b72 into finit-project:master Mar 16, 2026
2 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