emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.61k stars 3.28k forks source link

issue finding node.exe #15300

Open richardlalancetteyoui opened 2 years ago

richardlalancetteyoui commented 2 years ago

Hey all,

I am getting intermittent issues not finding node.exe when I use the steps provided by the documentation.

          emsdk/emsdk install latest
          emsdk/emsdk activate latest
          emsdk/emsdk_env.ps1 

make -C docs result:

make: Entering directory 'C:/wm/DW-Hub/docs'
emcc  src/main.cpp src/Device.cpp src/imgui_impl_glfw.cpp src/imgui_impl_opengl3.cpp src/imgui.cpp src/imgui_draw.cpp src/imgui_demo.cpp src/imgui_widgets.cpp src/imgui_tables.cpp src/yoga/Yoga.cpp src/yoga/YGValue.cpp src/yoga/YGStyle.cpp  src/yoga/YGNodePrint.cpp src/yoga/YGNode.cpp src/yoga/YGLayout.cpp  src/yoga/YGEnums.cpp src/yoga/YGConfig.cpp src/yoga/Utils.cpp src/yoga/log.cpp  src/yoga/event/event.cpp  src/yoga/internal/experiments.cpp -std=c++11 -o imgui.js -lGL -s USE_WEBGL2=1 -s USE_GLFW=3 -s FULL_ES3=1 -O2 --preload-file data -s WASM=1 -Isrc -Isrc/yoga
emcc: warning: cannot check node version: [WinError 2] The system cannot find the file specified [-Wversion-check]
shared:INFO: (Emscripten: Running sanity checks)
emcc: error: The configured node executable (['C:/wm/DW-Hub/emsdk/node/14.15.5_64bit/bin/node.exe']) does not seem to work, check the paths in C:\wm\DW-Hub\emsdk\.emscripten ([WinError 2] The system cannot find the file specified)
make: *** [Makefile:21: imgui.js] Error 1
make: Leaving directory 'C:/wm/DW-Hub/docs'
richardlalancetteyoui commented 2 years ago

If I navigate to C:/wm/DW-Hub/emsdk/node/14.15.5_64bit/bin/ node.exe is really not at the location.

image

richardlalancetteyoui commented 2 years ago

The odd thing is that github action workflow is still working fine.

name: Build wasm based imgui POC
on: [push]

jobs:
  setup-emscripten:
    runs-on: windows-latest
    name: Setup emscripten
    steps:
      - name: pre-setup
        run: git config --system core.longpaths true
      - name: Checkout
        uses: actions/checkout@v1
      - name: Test emscripten
        run: |
          emsdk/emsdk install latest
          emsdk/emsdk activate latest
          emsdk/emsdk_env.ps1 
          make -C docs
richardlalancetteyoui commented 2 years ago

And this might come handy.

The additional following precompiled SDKs are also available for download:
         sdk-releases-upstream-e13a2d74c5fa5f175ae7cffd4197fe7f78bea304-64bit
    *    sdk-releases-upstream-c69458f1bbf3ef5b8da4e934de210659cc9bca04-64bit   INSTALLED
         sdk-releases-fastcomp-edf24e7233e0def312a08cc8dcec63a461155da1-64bit
         sdk-releases-fastcomp-536568644fd67d53778f6111fdd5f64ad3f4c539-64bit
         sdk-fastcomp-1.38.30-64bit
         sdk-fastcomp-1.38.31-64bit

The following SDKs can be compiled from source:
         sdk-upstream-main-64bit
         sdk-fastcomp-tag-1.38.30-64bit
         sdk-fastcomp-tag-1.38.31-64bit

The following precompiled tool packages are available for download:
           releases-upstream-e13a2d74c5fa5f175ae7cffd4197fe7f78bea304-64bit
    (*)    releases-upstream-c69458f1bbf3ef5b8da4e934de210659cc9bca04-64bit     INSTALLED
           releases-fastcomp-edf24e7233e0def312a08cc8dcec63a461155da1-64bit
           releases-fastcomp-536568644fd67d53778f6111fdd5f64ad3f4c539-64bit
           fastcomp-clang-e1.38.30-64bit
           fastcomp-clang-e1.38.31-64bit
    (*)    node-14.15.5-64bit           INSTALLED
     *     python-3.9.2-1-64bit         INSTALLED
     *     java-8.152-64bit             INSTALLED
           emscripten-1.38.30
           emscripten-1.38.31
           gnu-2.5.4
           mingw-7.1.0-64bit
sbc100 commented 2 years ago

You you try re-installing node:

$ rm -rf emsdk/node
$ emsdk/emsdk install node-14.15.5-64bit

When you do this you will the URL from which the tar archive is being downloaded... all the install step is doing is downloading and extracting that tar archive.. any idea why that would not work on your machine?

richardlalancetteyoui commented 2 years ago

You you try re-installing node:

$ rm -rf emsdk/node
$ emsdk/emsdk install node-14.15.5-64bit

When you do this you will the URL from which the tar archive is being downloaded... all the install step is doing is downloading and extracting that tar archive.. any idea why that would not work on your machine?

Indeed, I reinstall the entire sdk using this.

emsdk/emsdk install latest
emsdk/emsdk activate latest
emsdk/emsdk_env.ps1 
rlalance commented 2 years ago

@sbc100 That actually worked! Wondering why emsdk/emsdk install latest does not install node properly, but at least, I have a way forward. Thank you! You can close this.

sbc100 commented 2 years ago

emsdk/emsdk install latest should indeed install node correctly part of installing latest is to install node-14.15.5-64bit.. its just one of the dependencies of latest. You can try again by rm -rf emsdk/upstream emsdk/node and then emsdk/emsdk install latest. You should see both upstream and node re-installed.

rlalance commented 2 years ago

Thank you so much! I've been banging my head on this for hours! 🤗

richardlalancetteyoui commented 2 years ago

ah finally. Issue reproduced on github workflow too.

image

Was wondering if it would ever break :D

sbc100 commented 2 years ago

Well, if you can figure out why the extraction of node.exe doesn't seem to work that would be very interesting!

Can you link to your github workflow file? Are you using any unusual stuff like mingw or cygwin?

rlalance commented 2 years ago

Flow is pretty simple. windows-latest

name: Build wasm based imgui POC
on: [push]

jobs:
  setup-emscripten:
    runs-on: windows-latest
    name: Setup emscripten
    steps:
      - name: pre-setup
        run: git config --system core.longpaths true
      - name: Checkout
        uses: actions/checkout@v1
      - name: Test emscripten
        run: |
          emsdk/emsdk install latest
          emsdk/emsdk activate latest
          emsdk/emsdk_env.ps1 
          make -C docs
sbc100 commented 2 years ago

I think you might need to debug the archive extraction process to find out why that file is missing when the extraction happens.

rlalance commented 2 years ago

Yup, intermittent too.

sbc100 commented 2 years ago

Yup, intermittent too.

Well that makes no sense at all! .. how odd

rlalance commented 2 years ago

Starting to wonder. Maybe it's because emsdk is commited to my repo... (I did this to speed up the build) Then I run the commands on top of it, and it does not like it.

sbc100 commented 2 years ago

Do you have the downloaded binaries checked in too? Or just the emsdk scripts?

richardlalancetteyoui commented 2 years ago

Oh. I do! To latest.

sbc100 commented 2 years ago

It seems likely here is some kind of issue with the checked-in version of the node tree. When you see the failure as I assume the "install" step is not actually doing anything since the binaries are already part of the checked-out tree. Therefore it seems likely the tree git repo itself is missing the node.exe file? Can you see that file among the files checked into git?

Kutalia commented 8 months ago

To me the issue was using WSL when emsdk was itself installed from Windows. If you install emsdk from Windows, you can't use it in WSL (even after correctly setting path) and vice versa.

rlalance commented 8 months ago

Closing this as I have moved on to another project. But, great info! Thank you guys!