Skip to content

Conversation

markuslevonyak
Copy link
Contributor

Summary

Fixes a bug in rinf gen (present in v8.7.0) where name conflicts between signal and non-signal structs/enums in different modules cause generation to abort, depending on module processing order.

Problem

In Rinf v8.7.0, the rinf gen command fails when a signal struct or enum shares the same name as a non-signal struct or enum in another module. This occurs only if the signal's module is processed before the non-signal's module. The processing order appears to be filesystem-dependent (e.g., alphabetical or OS-specific directory listing), leading to inconsistent behavior across environments.

For example:

  • Signal: SomeRequest in module1.rs (marked as a signal).
  • Non-signal: SomeRequest in module2.rs (not a signal).

If module1 is processed first, rinf gen aborts with:

Error: Duplicated signals named `SomeRequest` were found

If module2 is processed first, generation succeeds without issues.

Fix

  • Updated the signal validation logic in rust_crate_cli/src/tool/generate.rs to perform uniqueness checks only after confirming that a struct or enum is indeed a signal (previously, checks occurred before this confirmation).
  • This change avoids incorrectly flagging non-signal types as duplicates, ensuring consistent generation regardless of module processing order.

@temeddix
Copy link
Member

Thank you very much for the fix. I'll publish a new version right away :)

@temeddix temeddix merged commit a0e09d6 into cunarist:main Jul 15, 2025
23 checks passed
@markuslevonyak markuslevonyak deleted the check-signal-name-only-for-signals branch July 15, 2025 15:39
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