Coder Social home page Coder Social logo

Comments (5)

drahnr avatar drahnr commented on July 26, 2024

The issue with declaring tow #[orchestra::orchestra(..)] annotated types, with similar subsystems, yields two types of identical name, and a bunch of internal types with identical names than the original ones, but they don't have the same type id from a rustc perspective/are disjunct types. Hence why you run into the issue.

I only have ugly solutions for you. Happy to share if interested. (Hint: Modified import paths in all subsystems based on a feature-flag, I strongly recommend against that).

from orchestra.

drahnr avatar drahnr commented on July 26, 2024

The best approach might be to make the macro #[cfg(feature =.. )] aware and allow conditional compilation of fields of one orchestra declarated struct Foo.

from orchestra.

skunert avatar skunert commented on July 26, 2024

The best approach might be to make the macro #[cfg(feature =.. )] aware and allow conditional compilation of fields of one orchestra declarated struct Foo.

So basically we would pass different feature flags depending on whether we compile for cumulus or polkadot and then disable some of the subsystems, but reuse the same orchestra? Did I understand that correctly?

One other solution (also hacky) I was thinking about was to introduce one more abstraction level below the macro level. And then reuse the same code but declare the subsystems separately in cumulus.

from orchestra.

drahnr avatar drahnr commented on July 26, 2024

The best approach might be to make the macro #[cfg(feature =.. )] aware and allow conditional compilation of fields of one orchestra declarated struct Foo.

So basically we would pass different feature flags depending on whether we compile for cumulus or polkadot and then disable some of the subsystems, but reuse the same orchestra? Did I understand that correctly?

Yes, that's correct.

One other solution (also hacky) I was thinking about was to introduce one more abstraction level below the macro level. And then reuse the same code but declare the subsystems separately in cumulus.

I am not sure I understand what you mean. Also note, that this is quite a bit of work and would add further complexity to the proc-macro, which is not desirable.

So far, the DummySubsystems seem to be the easiest path.

Chaninging the number of subsystems will percolate through quite some code in polkadot (i.e. the overseer down to service and cli due to the impl OverseerGen which takes args for all subsystems, it's specific to polkadot, still something to consider).

Let me think about this for a few days, I have a hunch where we could go with something like !/Infallible as a subsystem of which the orchestra proc-macro is aware.

Let's do a call on Friday~ish?

from orchestra.

skunert avatar skunert commented on July 26, 2024

Thanks for the help! I think a call might be useful!

from orchestra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.