Skip to content

APIs removed in V8 7.0 and native addons #23122

Description

@addaleax

Currently, CITGM failures are dominated by addons failing because of APIs that were removed in V8 7.0 (Example run).

Most of the removed functions are simple wrappers that take now-required arguments from other sources, for example, the now-removed value->ToString() was essentially just a shorthand for value->ToString(Isolate::GetCurrent()->GetCurrentContext()).FromMaybe(Local<String>()).

Most of these APIs (all widely used ones, at least) do currently not print deprecation warnings when building with Node 10.

So, the question is: What, if anything, do we do about this?

We have the option of maintaining the deprecated APIs ourselves for a while, but I’m not sure how people feel about that.

We can also do ecosystem outreach on our own, but I highly doubt that that is going to restore CITGM results in time for Node 11, and given the large number of addons that are affected by this, we definitely can’t address all cases where this is an issue by ourselves.

Activity

  1. added
    v8 engineIssues and PRs related to the V8 dependency.
    addonsIssues and PRs related to native addons.
    on Sep 27, 2018
  2. added this to the milestone on Sep 27, 2018
  3. devsnek commented on Sep 27, 2018

    @devsnek
    Member

    wasn't our big plan always to shim 68 and 69 for 10.x and them push 70 to 11.x?

  4. targos commented on Sep 27, 2018

    @targos
    Member

    @devsnek this issue is about 11.x

  5. targos commented on Sep 27, 2018

    @targos
    Member

    /cc @nodejs/v8-update

  6. bnoordhuis commented on Sep 27, 2018

    @bnoordhuis
    Member

    Most of these APIs (all widely used ones, at least) do currently not print deprecation warnings when building with Node 10.

    What if we float a patch that changes that? Doesn't break ABI but should result in a flurry of bug reports against add-ons that need upgrading.

    I highly doubt that that is going to restore CITGM results in time for Node 11

    If 2018-10-23 is still the target date then I agree. Floating shims for a release cycle doesn't trouble me.

  7. addaleax commented on Sep 28, 2018

    @addaleax
    MemberAuthor

    The V8 commit in question is v8/v8@5acf205, btw. I don’t know if there are others that are relevant.

    Most of these APIs (all widely used ones, at least) do currently not print deprecation warnings when building with Node 10.

    What if we float a patch that changes that? Doesn't break ABI but should result in a flurry of bug reports against add-ons that need upgrading.

    That seems like a good idea. Looking into it, it’s doable but it’s not trivial because some of the replacement APIs don’t even exist in Node 10.

  8. refack commented on Sep 28, 2018

    @refack
    Contributor

    BTW: 7.0 is not stable yet, we could petition for reverting of v8/v8@5acf205.

  9. addaleax commented on Sep 28, 2018

    @addaleax
    MemberAuthor

    @nodejs/v8 ^^^

  10. hashseed commented on Sep 28, 2018

    @hashseed
    Member

    I just took a look. It seems the change in question is a mix of removing APIs that are marked V8_DEPRECATED and V8_DEPRECATE_SOON. We are conforming to the policy of marking a deprecated API for at least one version before removing. For the latter, we unfortunately are not.

    @danelphick has offered to partially revert this change to address the latter. I.e. instead of removing, we would move them to V8_DEPRECATED. We will still remove APIs that were already marked V8_DEPRECATED though.

    However, the underlying issue here is that V8 version bumps happen a lot more often than Node.js. If V8 was to accommodate to Node.js' deprecation policy, we would need a whole year to remove an API. We did that previously with the legacy debugging protocol, but I don't think this is something we can do in general.

    I think we need an actual discussion on this underlying issue, going forward.

    The motivation behind this particular change is to share objects between isolates in order to save memory. That means that where we derived the isolate from the object via GetIsolate(), we no longer can do that and require the embedder to pass the isolate explicitly.

  11. addaleax commented on Sep 28, 2018

    @addaleax
    MemberAuthor

    @hashseed Some of the APIs just used Isolate::GetCurrent() under the hood … is that a valid option?

    The motivation behind this particular change is to share objects between isolates in order to save memory.

    That sounds exciting :)

  12. hashseed commented on Sep 28, 2018

    @hashseed
    Member

    I think in this particular change it's possible to shim the removed API with a floating patch.

    However, this may not solve similar issues in the future.

  13. hashseed commented on Sep 28, 2018

    @hashseed
    Member

    Would it be possible to restate Node.js' deprecation policy towards native modules to exclude V8's API? Rationale:

    • It's easier for us :)
    • Node.js doesn't own V8's API.
    • NAPI is a viable alternative.
    • As module author, you could track node's master branch to detect API issues early.
  14. targos commented on Sep 28, 2018

    @targos
    Member

    We have some text in the collaborator guide: https://github.com/nodejs/node/blob/master/COLLABORATOR_GUIDE.md#breaking-changes-and-deprecations

    Note that errors thrown, along with behaviors and APIs implemented by dependencies of Node.js (e.g. those originating from V8) are generally not under the control of Node.js and therefore are not directly subject to this policy. However, care should still be taken when landing updates to dependencies when it is known or expected that breaking changes to error handling may have been made. Additional CI testing may be required.

  15. 39 remaining items

  16. removed this from the milestone on Oct 17, 2018
  17. added a commit that references this issue on Nov 5, 2018
  18. Trott commented on Nov 21, 2018

    @Trott
    Member

    Should this remain open? If so, is there anything specific that is actionable at this time?

  19. refack commented on Nov 21, 2018

    @refack
    Contributor

    We added #23426 which adds warnings for APIs that are V8_IMMINENT_DEPRECATION. This should give addon writers earlier notice about depredations.
    I think that was the low hanging fruit.

  20. BridgeAR commented on Jan 4, 2020

    @BridgeAR
    Member

    There was no activity for over a year and we are now at V8 8.0. I guess this is resolved and I am closing this. Please reopen in case there is more left to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    addonsIssues and PRs related to native addons.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions