Is it possible to have a dependency from on barrel to another

Former Member
Former Member

I am trying to add a dependency from Barrel A to Barrel B.

If I add the dependency from Project C to Barrel B there is no problem.  But I  cannot add a dependency from one barrel to the other.  I get an error "Undefined Symbol "B" detected

I have tried to create a barrels.jungle file in Barrel A but that does not seem to help.

Can this even be done?

  • Former Member
    0 Former Member over 5 years ago

    Any help here?  I am stuck with some reuse of code if barrels can't depend on other barrels

  • I don't think you can.  Why not just do what works with Proj C having a dependency on both barrels?

    A barrel file isn't a compiled unit.  It's a zip of the barrel project and gets re-compiles every time it's used for each target, and a barrel compiling another barrel while it's being compiled would be a bit of a challenge.

  • So there's no way to add a reference one barrel from another barrel?  Has anything in this regard changed in the last two years?  Unless I'm misunderstanding something, this greatly limits the re-usability (and usefulness) of barrels.

    a barrel compiling another barrel while it's being compiled would be a bit of a challenge

    I'll admit that I don't know much about compilers in general (and not really anything about Monkey C compilers), but there must be a way to ensure that each barrel gets compiled only once not matter how many barrels reference it.  Maybe it's a challenge, but I would think a worthwhile challenge.