Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation failed on Windows 10 (add Win support) #37

Open
styfle opened this Issue Jan 4, 2019 · 7 comments

Comments

Projects
None yet
2 participants
@styfle
Copy link

styfle commented Jan 4, 2019

I installed rust stable.

Then I ran the following.

mkdir webrender-example
cd webrender-example
npm init -y
npm install --save node-webrender

Here's what happened:

> node-webrender@0.1.8 install C:\code\webrender-example\node_modules\node-webrender
> neon build

neon info forcing rebuild for new build settings
neon info running cargo
    Updating crates.io index
    Updating git repository `https://github.com/servo/webrender.git`
  Downloaded serde_derive v1.0.80
  Downloaded font-loader v0.7.0
  Downloaded lazy_static v1.1.0
  Downloaded time v0.1.40
  Downloaded rayon v1.0.2
  Downloaded neon-build v0.2.0
  Downloaded euclid v0.19.4
.......................Removed for brevity......................
   Compiling winapi-util v0.1.1
   Compiling time v0.1.40
   Compiling atty v0.2.11
   Compiling winit v0.17.2
   Compiling crossbeam-deque v0.2.0
   Compiling sha2 v0.8.0
   Compiling wincolor v1.0.1
   Compiling serde_derive v1.0.80
   Compiling neon-runtime v0.2.0
   Compiling font-loader v0.7.0
   Compiling termcolor v1.0.4
   Compiling env_logger v0.6.0
error: failed to run custom build command for `neon-runtime v0.2.0`
process didn't exit successfully: `C:\code\webrender-example\node_modules\node-webrender\native\target\debug\build\neon-runtime-5c8f3d65c2af5c1e\build-script-build` (exit code: 101)
--- stdout
'Skipping node-gyp installation as part of npm install.'
added 96 packages from 70 contributors and audited 184 packages in 7.067s
found 0 vulnerabilities

cargo:node_arch=x64

--- stderr
thread 'main' panicked at 'Couldn't find node_root_dir in node-gyp output.', libcore\option.rs:1008:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed
neon ERR! cargo build failed

Error: cargo build failed
    at Target.<anonymous> (C:\code\webrender-example\node_modules\neon-cli\lib\target.js:121:35)
    at step (C:\code\webrender-example\node_modules\neon-cli\lib\target.js:32:23)
    at Object.next (C:\code\webrender-example\node_modules\neon-cli\lib\target.js:13:53)
    at fulfilled (C:\code\webrender-example\node_modules\neon-cli\lib\target.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
npm WARN webrender-example@1.0.0 No description
npm WARN webrender-example@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-webrender@0.1.8 install: `neon build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-webrender@0.1.8 install script.

I'm guessing I need more dependencies like the ones listed in debian g++ cmake pkg-config python libfreetype6 libfreetype6-dev expat libexpat-dev but I'm not sure how to get all these on Windows.

@cztomsik

This comment has been minimized.

Copy link
Owner

cztomsik commented Jan 4, 2019

I think you only need to get nodejs headers (not sure how to do it, I'm not on windows anymore and I didn't yet had a time to try it in a VM)

But there's going to be another problem with NamedPipes (events are now handled through unix sockets so we need some fallback for windows) - I could use some help if you feel into it :-)

@cztomsik cztomsik added the help wanted label Jan 4, 2019

@styfle

This comment has been minimized.

Copy link
Author

styfle commented Jan 6, 2019

I was trying it out on Windows because I have TB of disk space to play with and my MacBook is almost full 😆

Although Windows support is desirable for cross compatibility, I probably won't be able to dedicate any time to helping 😐

@cztomsik

This comment has been minimized.

Copy link
Owner

cztomsik commented Jan 6, 2019

I will eventually take it once I get to setting up virtualbox on my desktop pc

@cztomsik

This comment has been minimized.

Copy link
Owner

cztomsik commented Jan 18, 2019

ok, so with new redesign, it shouldn't be that hard:

  • accept onEvent callback from js instead of socketPath
  • wrap it with napi_create_threadsafe_function and store it as an implementation of EventSender
  • EventSender.send would call napi_call_threadsafe_function
  • don't forget to call napi_release_threadsafe_function when it's dropped
  • add note about npm install --global --production windows-build-tools

It will require further additions to napi-rs

And we still need to check if npm install goes fine (if headers are in place)

@cztomsik cztomsik changed the title Installation failed on Windows 10 Installation failed on Windows 10 (add Win support) Jan 18, 2019

@cztomsik

This comment has been minimized.

Copy link
Owner

cztomsik commented Jan 24, 2019

seems like it will be even easier - all we need to do in feature/loop branch is to replace EventSender with sync implementation of EventHandlerCallback

sync calls do not require unix sockets and so it should (just) work
(no additions to napi-rs are needed)

@cztomsik cztomsik referenced this issue Jan 25, 2019

Merged

Feature/loop #65

@cztomsik

This comment has been minimized.

Copy link
Owner

cztomsik commented Jan 26, 2019

So, it's not so easy after all:

But even then it's still giving me unresolved external symbol errors for all napi_* and I have no idea why is that.

Not to mention that everything has to be compiled wth --release or the linker will bail out because of too many objects (seems to be a problem with rust).

This doesn't look good at all, help from anyone experienced with node.js native modules for win would be extremely helpful.

@cztomsik

This comment has been minimized.

Copy link
Owner

cztomsik commented Jan 26, 2019

apparently, node.js for windows is not only missing headers but also a .lib file needed for linking (which has to be downloaded too)

so far, I was able to get it compile but I can't verify if it's working because virtualbox can't do opengl (I'll try to test it with angle)

This was referenced Apr 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.