Hi Mickael,
This is tricky and shows limits of "nested" feature.
The "derived" is usually maintained by the builders / generators, that are always project specific.
So builder X in project B doesn't know anything (and should not) about project A.
Therefore if it sets "derived" flag on C only.
So the "system" (in this case resources framework) should know better and set the same flag on all re-incarnations of C in all projects.
Assume now that we also have A/B/D, and D is "derived" in project A, because project A has builder that builds D. Following the logic above we should also set "derived" on B/D in project B.
This means, in setDerived() for every resource (not only for resources that are "nested") we must compute set of projects containing this resource. This is probably doable, but not sure how fast/slow it could be (we have also linked and virtual resources). This can seriously affect performance of setDerived().
More interesting will be, that the setDerived() changes on one project will require now resource locks taken/events sent on/to *other* projects.
This may affect all client code that sets resource locks per-project / resource (all properly implemented resource operations), but the underlined code will now "touch" seemingly "unrelated" resources, causing "nested rule errors" or eventually deadlocks?
This means, that if we do implement such "derived" propagation, we must perform it asynchronous to the original call, which will open a door for inconsistent resource states (C in B will be already derived but B/C in A will be seen as derived later). Not sure if this is something we can/should allow.
Kind regards,
Andrey Loskutov
Спасение утопающих - дело рук самих утопающих
https://www.eclipse.org/user/aloskutov
Gesendet: Dienstag, 21. Januar 2020 um 13:22 Uhr
Von: "Mickael Istria" <mistria@xxxxxxxxxx>
An: "Eclipse platform general developers list." <platform-dev@xxxxxxxxxxx>
Betreff: Re: [platform-dev] Marking nested projects as derived, what are the risks?
Thanks Andrey and Dani for the solid arguments. I think I have to give up on this idea then.
But that brings me to another question that could help improving some use-cases: if we have project A and its nested project B in A/B, and there is a folder A/B/C (which is duplicated as B/C in A, and as C in B). If C is marked as derived in *any* of the duplicates, shouldn't it automatically be marked as derived in all of them?
_______________________________________________ platform-dev mailing list platform-dev@xxxxxxxxxxx To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/platform-dev