seo-rii / electron-acrylic-window

Add acrylic effect to your electron application
MIT License
280 stars 23 forks source link

Intermittent error when building on windows in Github actions #84

Open nikhilro opened 2 years ago

nikhilro commented 2 years ago

Hey there,

This is not specific to your project but maybe you've seen this before and might have some ideas. We are an electron app for Mac and Windows. We are having issues building Windows on Github Actions due to this intermittent error.

npm ERR! gyp: C:\Users\runneradmin\AppData\Local\node-gyp\Cache\16.13.2\common.gypi not found (cwd: D:\a\sp-menubar\sp-menubar\node_modules\electron-acrylic-window) while reading includes of binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (D:\a\sp-menubar\sp-menubar\node_modules\node-gyp\lib\configure.js:259:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.20348
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\a\\sp-menubar\\sp-menubar\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\a\sp-menubar\sp-menubar\node_modules\electron-acrylic-window
Full log ``` npm ERR! code 1 npm ERR! path D:\a\sp-menubar\sp-menubar\node_modules\electron-acrylic-window npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@8.4.1 npm ERR! gyp info using node@16.13.2 | win32 | x64 npm ERR! gyp info find Python using Python version 3.9.9 found at "C:\hostedtoolcache\windows\Python\3.9.9\x64\python3.exe" npm ERR! gyp http GET nodejs.org/download/release/v16.13.2/node-v16.13.2-headers.tar.gz npm ERR! gyp http 200 nodejs.org/download/release/v16.13.2/node-v16.13.2-headers.tar.gz npm ERR! gyp http GET nodejs.org/download/release/v16.13.2/SHASUMS2[56](https://github.com/superpoweredapp/sp-menubar/runs/5158102324?check_suite_focus=true#step:7:56).txt npm ERR! gyp http GET nodejs.org/download/release/v16.13.2/win-x86/node.lib npm ERR! gyp http GET nodejs.org/download/release/v16.13.2/win-x64/node.lib npm ERR! gyp http GET nodejs.org/download/release/v16.13.2/win-arm64/node.lib npm ERR! gyp http 200 nodejs.org/download/release/v16.13.2/win-x86/node.lib npm ERR! gyp http 404 nodejs.org/download/release/v16.13.2/win-arm64/node.lib npm ERR! gyp http 200 nodejs.org/download/release/v16.13.2/win-x64/node.lib npm ERR! gyp http 200 nodejs.org/download/release/v16.13.2/SHASUMS256.txt npm ERR! gyp info find VS using VS2022 (17.0.32112.339) found at: npm ERR! gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" npm ERR! gyp info find VS run with --verbose for detailed information npm ERR! gyp info spawn C:\hostedtoolcache\windows\Python\3.9.9\x64\python3.exe npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args 'D:\\a\\sp-menubar\\sp-menubar\\node_modules\\node-gyp\\gyp\\gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'msvs', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args 'D:\\a\\sp-menubar\\sp-menubar\\node_modules\\electron-acrylic-window\\build\\config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args 'D:\\a\\sp-menubar\\sp-menubar\\node_modules\\node-gyp\\addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args 'C:\\Users\\runneradmin\\AppData\\Local\\node-gyp\\Cache\\16.13.2\\common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\runneradmin\\AppData\\Local\\node-gyp\\Cache\\16.13.2', npm ERR! gyp info spawn args '-Dnode_gyp_dir=D:\\a\\sp-menubar\\sp-menubar\\node_modules\\node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\runneradmin\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.13.2\\\\<(target_arch)\\\\node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=D:\\a\\sp-menubar\\sp-menubar\\node_modules\\electron-acrylic-window', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'D:\\a\\sp-menubar\\sp-menubar\\node_modules\\electron-acrylic-window\\build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp: C:\Users\runneradmin\AppData\Local\node-gyp\Cache\16.13.2\common.gypi not found (cwd: D:\a\sp-menubar\sp-menubar\node_modules\electron-acrylic-window) while reading includes of binding.gyp while trying to load binding.gyp npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess.onCpExit (D:\a\sp-menubar\sp-menubar\node_modules\node-gyp\lib\configure.js:2[59](https://github.com/superpoweredapp/sp-menubar/runs/5158102324?check_suite_focus=true#step:7:59):16) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:3[90](https://github.com/superpoweredapp/sp-menubar/runs/5158102324?check_suite_focus=true#step:7:90):28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) npm ERR! gyp ERR! System Windows_NT 10.0.20348 npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\a\\sp-menubar\\sp-menubar\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd D:\a\sp-menubar\sp-menubar\node_modules\electron-acrylic-window npm ERR! gyp ERR! node -v v16.13.2 npm ERR! gyp ERR! node-gyp -v v8.4.1 npm ERR! gyp ERR! not ok ```

Running on node 16.13.2, npm 8.1.2, node-gyp 8.4.1 and vs version 2022 (tried it with 2019 too, actions doesn't have 2017).

This doesn't seem specific to this project. Found someone else who had the same issue with another native module https://github.com/AceCentre/EyeCommander/issues/51.

Appreciate any pointers! Please feel free to close the issue if it's not relevant

pe3ep commented 2 years ago

same issue, pls help

tscpp commented 2 years ago

I don't think any other visual studio version except 2017 will work. I tried to build the project with 2019 before (#68), and it did not work.

However, this do not look like node-gyp is breaking before even trying to build. Can you provide the actions config and try to build locally?

nikhilro commented 2 years ago

Sorry for the late reply and thanks v much for your help 🙏

Here is the rough config:

  build_win:
    name: Build and Deploy for Windows
    runs-on: windows-2022
    defaults:
      run:
        shell: bash

    steps:
      - name: Print node and npm info
         run: |
          node --version
          npm --version
          npm list -g

      - name: Get dependencies from package.json
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
        run: |
          npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
          npx node-gyp --version
          npm install

It definitely works but only intermittently which is the weird thing. Yup, locally everything works cause the setup is 2017, as recommended.

nikhilro commented 2 years ago

Ended up figuring out a way to have vs2017 and node 14, everything good now. Thanks again!

seo-rii commented 2 years ago

Due to the basic setting of GitHub, it will have to be resolved in vs 2019. Let me take a look at this problem.

nikhilro commented 2 years ago

Turns out this will fail on March 15th when Github Actions removes support for the vs2017 version altogether. https://github.com/actions/virtual-environments/issues/4312

I have tried all possible scenarios I could think of with newer machines but nothing. Anything work for you?

davej commented 2 years ago

Noting that this issue is also seen on Azure Pipelines. I think they are probably running on the same MS-hosted VMs so probably not that surprising.

rathboma commented 1 year ago

@nikhilro what are you doing to solve this now? Just hitting it for some packages