Hi API Council,In looking over the Fuchsia API evolution guidelines, some of the examples on the page seem inconsistent with the rest of the page.Specifically:
- The diagram at the top of the page shows a four-step lifecycle: Added, Deprecated, Removed (legacy), and Deleted.
- The text at the end says that, when removing an API, we should maintain legacy support by setting `legacy=true`.
So far, so good.But in the examples in the "Deprecating FIDL APIs" section, the `removed` attribute is added without `legacy=true`.So, if I just skim the page for examples to follow, I'll fail to preserve ABI.To avoid that risk, I'd like to update those examples to either include `legacy=true`, or to have `deprecated=N, removed=N+2`.
Alternatively, I could add a cautionary note in that section that those examples are only speaking to what the compiler allows, not what's good practice.WDYT?--
--
You received this message because you are subscribed to the Google Groups "api-council" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-council...@fuchsia.dev.
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/api-council/CAENAxg0J9C_7Cz0ZDX-63uZoFTzD8RdzJ%2BOEcC5pQaT0pC4CPQ%40mail.gmail.com.
Thanks for the feedback! I'm happy to help make the change in the doc, if someone can confirm.On Wed, Jun 28, 2023 at 1:45 PM 'Mukesh Agrawal' via api-council <api-c...@fuchsia.dev> wrote:Hi API Council,In looking over the Fuchsia API evolution guidelines, some of the examples on the page seem inconsistent with the rest of the page.Specifically:
- The diagram at the top of the page shows a four-step lifecycle: Added, Deprecated, Removed (legacy), and Deleted.
- The text at the end says that, when removing an API, we should maintain legacy support by setting `legacy=true`.
So far, so good.But in the examples in the "Deprecating FIDL APIs" section, the `removed` attribute is added without `legacy=true`.So, if I just skim the page for examples to follow, I'll fail to preserve ABI.To avoid that risk, I'd like to update those examples to either include `legacy=true`, or to have `deprecated=N, removed=N+2`.cc @Hunter Freyer -- WDYT?
We can't remove the legacy flag because removed=N does not always mean "removed" in the API lifecycle sense, it can also mean "replaced". For example, changing a string bound:library test;protocol Foo {@available(removed=2) Bar(struct { baz string:10; });@available(added=2) Bar(struct { baz string:20; });}Using legacy=true here would be an error because there would be two coexisting methods named "Bar".There are some other cases where legacy=true is unnecessary, such as removing a constant or a type alias, or removing a table field if you would just be ignoring the field anyway.
Short termChange the example of deprecating a method, to include legacy=true, perhapswith a comment referencing the "Preserving ABI" section.
Longer termRevise the API evolution guidelines to make it clear thatHow does that sound?
- "API" includes many different elements (libraries, methods, constants, etc)
- Different elements have different deprecation guidelines/policies
- Methods specifically have the policy that they must have legacy=true when they're removed
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/api-council/CAENAxg0F81O7XrYWuTwT54BX%2BMZrpLCjz859drh8TQsoWhCXwg%40mail.gmail.com.
library test;protocol Foo {@available(removed=2) Bar(struct { baz string:10; });@available(added=2) Bar(struct { baz string:20; });}
IIUC "legacy" is only relevant when _removing_ a method - "deprecated" APIs must continue to be supported until they're removed, to allow clients a window during which to migrate off them.But yes, updating the documentation to state that "legacy=true" should be added alongside "removed" seems reasonable given the current tooling.
The semantics around "legacy" seem a little fuzzy, IMO. The documentation refers to the platform's implementation of the API being preserved, but in general that is not sufficient for fuchsia platform APIs, whose implementations in a system may be provided from outside the platform itself.Taking fuchsia.web, provided by Chromium, as an example, when the fuchsia.web.Frame.CreateView() is removed (since it has been replaced by CreateView2()), in order for Chromium targeting a post-removal API level to continue to support the ABI, it will need to have FIDL bindings generated with that API still available.It does look like the "legacy" flag was added only after RFC0083 had been accepted - I'd recommend that we review whether the current definition & implementation actually makes sense (perhaps in conjunction with cleaning up "transitional"!).
On Wed, Jul 26, 2023 at 5:14 AM Wez <w...@google.com> wrote:IIUC "legacy" is only relevant when _removing_ a method - "deprecated" APIs must continue to be supported until they're removed, to allow clients a window during which to migrate off them.But yes, updating the documentation to state that "legacy=true" should be added alongside "removed" seems reasonable given the current tooling.+1, I misread that. It is an error to use legacy=true when something is only deprecated, not removed.