paritytech / orchestra

A partial actor pattern with a global orchestrator.
GNU General Public License v3.0
27 stars 3 forks source link

Version 0.3.7 introduces breaking changes #80

Closed abdulmth closed 4 months ago

abdulmth commented 4 months ago

The following project doesn't compile anymore when using the newest version 0.3.7 of orchestra.

[package]
name = "tempProj"
version = "0.1.0"
edition = "2021"

[dependencies]
cumulus-client-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.7.0" }

with the following error

   --> /.cargo/git/checkouts/polkadot-sdk-cff69157b985ed76/e046d3b/polkadot/node/overseer/src/lib.rs:460:1
    |
460 | / #[orchestra(
461 | |     gen=AllMessages,
462 | |     event=Event,
463 | |     signal=OverseerSignal,
464 | |     error=SubsystemError,
465 | |     message_capacity=2048,
466 | | )]
    | |__^ use of undeclared type `PriorityLevel`
    |
    = note: this error originates in the attribute macro `orchestra` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
    |
64  + use crate::gen::PriorityLevel;
    |
64  + use orchestra::PriorityLevel;
    |

error[E0412]: cannot find type `NormalPriority` in this scope
   --> /.cargo/git/checkouts/polkadot-sdk-cff69157b985ed76/e046d3b/polkadot/node/overseer/src/lib.rs:460:1
    |
460 | / #[orchestra(
461 | |     gen=AllMessages,
462 | |     event=Event,
463 | |     signal=OverseerSignal,
464 | |     error=SubsystemError,
465 | |     message_capacity=2048,
466 | | )]
    | |__^ not found in this scope
    |
    = note: this error originates in the attribute macro `orchestra` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
    |
64  + use crate::gen::NormalPriority;
    |
64  + use orchestra::NormalPriority;

Pinning the indirect orchestra dependency to the version 0.3.6 fixes the issue (Make sure the version is reflected in the cargo.lock file)

[package]
name = "tempProj"
version = "0.1.0"
edition = "2021"

[dependencies]
cumulus-client-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-crates-io-v1.7.0" }

[patch.crates-io]
orchestra = { git = "https://github.com/paritytech/orchestra.git", tag = "v0.3.6" }

I might be wrong but probably the latest release is the issue here.

AndreiEres commented 4 months ago

Thank you for letting us know. I'm really sorry about this.

Quick fix. Version 0.3.7 introduces sending priority messages to subsystems. If you don't need it, you can keep version 0.3.6. Or you can just import the necessary structs from orchestra.

Next steps. However, updating to the patch version shouldn't bring any code changes. I'll take care of that.

AndreiEres commented 4 months ago

@abdulmth, we yanked v0.3.7 and released v0.4.0.

It shouldn't require any changes if you only use macros. But you will need to add new methods for Sender implementations if you use any.