Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Building Atom against Node.js 10 fails with error building dependency #17370

Closed
1 task done
karthanistyr opened this issue May 20, 2018 · 2 comments
Closed
1 task done

Comments

@karthanistyr
Copy link

Prerequisites

Description

Building Atom against Node.js 10.x fails while building one of the deep-nested dependencies nan, at least on linux.

../../nan/nan_maybe_43_inl.h:112:15: error: « class v8::Object » n'a pas de membre nommé « ForceSet »
   return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
               ^~~~~~~~

This has to do with a dependency tree that eventually pulls nan@2.7.0.

The culprit seems to be electron-link@0.2.0 (atom/atom/script/package.json), which depends on leveldown@^1.6.0 (atom/electron-link/package.json).

leveldown@^1.6.0 is resolved as leveldown@1.9.0 which itself requires nan@~2.7.0 (Level/leveldown/package.json).

It very well looks like nan was only changed to not use the deprecated v8::Object::ForceSet call somewhere between v2.7.0 and v.2.8.0 (and only made it into a release in v2.8.0).

I have isolated the Node.js code change that removed the deprecated function, which now breaks nan for versions below v2.8.0 against Node.js 10, at this commit, tagged for Node.js v10.0.0 and v10.1.0.

Ideally I think the dependencies should be bumped up to the extent of what's possible, failing that the build requirements should limit the latest usable Node.js version to v9.x.

Steps to Reproduce

Following instructions found at https://flight-manual.atom.io/hacking-atom/sections/hacking-on-atom-core/#platform-linux

  1. Ensure environment is set to run node v10.x
% node --version
v10.1.0
  1. Clone repository and start building according to instructions (link above). Don't forget to run the recommended platform/distro-specific commands (e.g. Arch Linux-specific)
  2. Watch build fail while building nan (actual error will be buried under lots of node error output)

Expected behavior:
Build should succeed.

Actual behavior:
Build fails while building a dependency (nan@2.7.0) due to its using a now-removed (as of Node.js 10), long-deprecated call to v8::Object::ForceSet.

Reproduces how often:
Always reproduces.

Versions

 % atom --version
Atom    : 1.26.1
Electron: 1.8.4
Chrome  : 59.0.3071.115
Node    : 8.2.1
 % apm --version
(node:12736) ExperimentalWarning: The fs.promises API is experimental
apm  1.19.0
npm  6.0.1
node 10.1.0 x64
atom 1.26.1
python 2.7.15
git 2.17.0

Additional Information

There seems to be no workaround other than making it so that Atom is somehow built against Node.js 9.x or below (e.g. setting up a docker build environment, a VM, or plain downgrading...). While this issue is not resolved, the flight manual will state wrong requirements (as it does not limit the upper version of a compatible Node.js):

Requirements
...
Node.js 6.x or later (we recommend installing it via nvm)

On a side note, I am the author of this thread at discuss.atom.io, but did not wait for a response to post this issue.

@Arcanemagus
Copy link
Contributor

Thanks for taking the time to contribute!

We noticed that this is a duplicate of atom/electron-link#11. You may want to subscribe there for updates.

Because we treat our issues list as the Atom team's backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn't an exact duplicate but is closely related.

For information on how to use GitHub's search feature to find out if something is a duplicate before filing, see the How Can I Contribute? section of the Atom CONTRIBUTING guide.

@lock
Copy link

lock bot commented Nov 17, 2018

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Nov 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants