How to compile mib files with circular dependency?

I am trying to use snmp4j-smi-pro compile Cisco mib files, that get from cisco-mibs/v2 at main · cisco/cisco-mibs · GitHub
among them, and import one OID from each other, caused circular dependency – so no matter which file I compiles first, always fail since unknown dependent.
How to work around this issue?

First of all, as a MIB Designer you should avoid circular dependencies - I think it is obvious that isn’t a good idea :wink:
You can try to put both MIB definitions into a single file. That could fix the issue for SNMP4J-SMI-PRO (although that depends on the concrete MIB modules and how the dependencies are defined).
A workaround that would work in any case, is the following:

  1. Remove (or comment out) the IMPORT in MIB A and the corresponding object(s) that references MIB module B.
  2. Compile MIB A and B.
  3. Read the objects and imports removed/commented out in step 1 in MIB module A and recompile MIB A.

Hope this helps.