epi-project / brane

Programmable Orchestration of Applications and Networking
Apache License 2.0
10 stars 7 forks source link

Mismatching enum-debug versions #158

Open DanielVoogsgerd opened 1 week ago

DanielVoogsgerd commented 1 week ago

I think I have found why the enum-debug package is a pain to update every time.

The past couple of times, I just assumed I had messed up an cargo update for any of our workspace packages (and I might have). But while updating the enum-debug package again on the policy reasoner, I again ran into the same problem.

Digging into it some more, I realized that the problem is something different.

In brane-ast we use enum-debug-derive on the edge struct. That struct is then exported to the policy reasoner workflow package. This package imports EnumDebug so it can call edge.variant(), but that version of EnumDebug is different, as we just tried to update it.

I don't particularly like it, but what we could do to mitigate this is re-export EnumDebug in the crates that use it and just use the associated trait.

However, I am very open to alternatives.

Edit: The wisdom provided to me by pressing the submit button, immediately enlightened me that this is only the case when enum-debug has a major version bump. Something in me tells me that the two major updates in as many months are an exception, aren't they, @Lut99 ?

Lut99 commented 6 days ago

Uhm... yes? :P

Well I mean, AFAIK we're literally the only ones using this crate. So up to this point I've been very happy-go-lucky with breaking changes. But I'll keep it a little more minimum, if you prefer :innocent:

DanielVoogsgerd commented 2 days ago

Closing this as we think/hope enum-debug won't update too much. If this changes, we can reconsider.

DanielVoogsgerd commented 17 hours ago

There goes my hope. Enum-debug strikes again.

So I think this is because Cargo cannot determine that enum-debug 1.0.0 must be compatible with 1.1.0 because they are using git tags, which are not necessarily semver. One solution for this particular problem would be releasing the crate on crates.io. Something you might want to consider. In the meantime (tomorrow), I will try to get policy reasoner updated akin to the Brane update. That should resolve this instance of the issue, but I think preventing these headaches in the future is worthwhile.