Skip to content

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

Open
vazub wants to merge 1 commit intofinit-project:masterfrom
vazub:plugfix
Open

Use explicit plugin names to prevent subtle macro processing bugs#482
vazub wants to merge 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.

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.

1 participant