Skip to content

error running tests on windows #22400

Closed

Description

@bughit

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
  • Operating System:
    • win7 x64 sp1

I followed the directions for building headers for testing in the testing doc

ninja -C out\Testing-x86 third_party\electron_node:headers

cd out\Testing-x86
mkdir gen\node_headers\Release
copy electron.lib gen\node_headers\Release\node.lib
C:\electron-build\electron-gn\src\electron>npm run test

> [email protected] test C:\electron-build\electron-gn\src\electron
> node ./script/spec-runner.js

Triggering runners: main, remote, native
npx: installed 1 in 1.884s
yarn install v1.15.2
warning package.json: No license field
warning [email protected]: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window
Output:
C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window>if not defined npm_config_node_gyp (node "C:\Users\user1\AppData\Local\Programs\node
\current\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\user1\AppData\Local\Programs\node\npm\no
de_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp: C:\electron-build\electron-gn\src\out\undefined\gen\node_headers\common.gypi not found (cwd: C:\electron-build\electron-gn\src\electron\spec\node_modules\i
s-valid-window) while reading includes of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\user1\AppData\Local\Programs\node\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Users\\user1\\AppData\\Local\\Programs\\node\\current\\node.exe" "C:\\Users\\user1\\AppData\\Local\\Programs\\node\\npm\\node_modules\\npm\\
node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window
gyp ERR! node -v v12.13.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
✗ Failed to yarn install in 'C:\electron-build\electron-gn\src\electron\spec'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `node ./script/spec-runner.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user1\AppData\Roaming\npm-cache\_logs\2020-02-26T19_39_55_132Z-debug.log

The one obvious problem that jumps out is

gyp: C:\electron-build\electron-gn\src\out\undefined\gen\node_headers\common.gypi not found 

Is it trying to refer to C:\electron-build\electron-gn\src\out\Testing-x86\gen\node_headers\include\node\common.gypi ?

Activity

  1. codebytere commented on Feb 27, 2020

    @codebytere
    Member

    If you set process.env.ELECTRON_OUT_DIR to Testing-x86 that'll address it. We default our possible out directories to check for 'Testing', 'Release', 'Default' so if it's not one of those and the env var is not set it'll be undefined. That should prolly be more clear in docs though and throw an error, so i'll try to get to that soon.

    also - you should be using build-tools; it automatically handles this.

  2. bughit commented on Feb 27, 2020

    @bughit
    ContributorAuthor

    it gets further after setting ELECTRON_OUT_DIR but fails building is-valid-window

    C:\electron-build\electron-gn\src\electron>npm run test
    
    > [email protected] test C:\electron-build\electron-gn\src\electron
    > node ./script/spec-runner.js
    
    Triggering runners: main, remote, native
    OUT_DIR is: Testing-x86
    npx: installed 1 in 3.428s
    yarn install v1.15.2
    warning package.json: No license field
    warning [email protected]: No license field
    [1/4] Resolving packages...
    [2/4] Fetching packages...
    info [email protected]: The platform "win32" is incompatible with this module.
    info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
    [3/4] Linking dependencies...
    [4/4] Building fresh packages...
    error C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window: Command failed.
    Exit code: 1
    Command: node-gyp rebuild
    Arguments:
    Directory: C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window
    Output:
    C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window>if not defined npm_config_node_gyp (node "C:\Users\user1\AppData\Local\Programs\node
    \current\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\user1\AppData\Local\Programs\node\npm\no
    de_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
    Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
      main.cc
      impl_win.cc
      win_delay_load_hook.cc
    C:\electron-build\electron-gn\src\out\Testing-x86\gen\node_headers\include\node\node_api.h(7,1): warning C4005: 'NAPI_EXTERN': macro redefinition (compiling sou
    rce file ..\src\main.cc) [C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window\build\is_valid_window.vcxproj]
    C:\electron-build\electron-gn\src\out\Testing-x86\gen\node_headers\include\node\js_native_api.h(29): message : see previous definition of 'NAPI_EXTERN' (compili
    ng source file ..\src\main.cc) [C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window\build\is_valid_window.vcxproj]
         Creating library C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window\build\Release\is_valid_window.lib and object C:\electron-buil
    d\electron-gn\src\electron\spec\node_modules\is-valid-window\build\Release\is_valid_window.exp
    main.obj : error LNK2001: unresolved external symbol napi_get_boolean [C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window\build\is_val
    id_window.vcxproj]
    main.obj : error LNK2001: unresolved external symbol __imp_napi_is_buffer [C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window\build\is
    _valid_window.vcxproj]
    main.obj : error LNK2001: unresolved external symbol napi_throw_error [C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window\build\is_val
    id_window.vcxproj]
    main.obj : error LNK2001: unresolved external symbol __imp_napi_get_buffer_info [C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window\bu
    ild\is_valid_window.vcxproj]
    main.obj : error LNK2001: unresolved external symbol __imp_napi_module_register [C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window\bu
    ild\is_valid_window.vcxproj]
    main.obj : error LNK2001: unresolved external symbol napi_define_properties [C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window\build\
    is_valid_window.vcxproj]
    main.obj : error LNK2001: unresolved external symbol napi_get_cb_info [C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window\build\is_val
    id_window.vcxproj]
    C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window\build\Release\is_valid_window.node : fatal error LNK1120: 7 unresolved externals [C
    :\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window\build\is_valid_window.vcxproj]
    gyp ERR! build error
    gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
    gyp ERR! stack     at ChildProcess.onExit (C:\Users\user1\AppData\Local\Programs\node\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
    gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
    gyp ERR! System Windows_NT 6.1.7601
    gyp ERR! command "C:\\Users\\user1\\AppData\\Local\\Programs\\node\\current\\node.exe" "C:\\Users\\user1\\AppData\\Local\\Programs\\node\\npm\\node_modules\\npm\\
    node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
    gyp ERR! cwd C:\electron-build\electron-gn\src\electron\spec\node_modules\is-valid-window
    gyp ERR! node -v v12.13.1
    gyp ERR! node-gyp -v v5.0.5
    gyp ERR! not ok
    info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
    ✗ Failed to yarn install in 'C:\electron-build\electron-gn\src\electron\spec'
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] test: `node ./script/spec-runner.js`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] test script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\user1\AppData\Roaming\npm-cache\_logs\2020-02-27T16_59_29_464Z-debug.log
    
  3. bughit commented on Feb 27, 2020

    @bughit
    ContributorAuthor

    @codebytere Can you keep this open for the next (unresolved symbols) issue?

    Assuming those symbols are supposed to be provided by copy electron.lib gen\node_headers\Release\node.lib they are indeed missing. For example

    • napi_get_boolean is not there but _napi_get_boolean is
    • __imp_napi_is_buffer is not there but _napi_is_buffer is
  4. bughit commented on Feb 27, 2020

    @bughit
    ContributorAuthor

    created a new one #22432

  5. codebytere commented on Feb 27, 2020

    @codebytere
    Member

    thanks @bughit, appreciated

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions