lannonbr / vsce-action

A GitHub Action to automate deploying VS Code extensions
MIT License
88 stars 14 forks source link

vsce release v1.103.0 breaks attempting to build #7

Closed sourishkrout closed 2 years ago

sourishkrout commented 2 years ago

Starting with https://github.com/microsoft/vscode-vsce/releases/tag/v1.103.0 it appears npm is attempting to build keytar and fails due to lack of a build subsystem.

Has this been a problem before? Trying out workarounds but wanted to highlight the issue.

/workspaces/vsce-action (master) $ docker build --no-cache .
[+] Building 7.9s (6/7)                                                                                                                                                                          
 => [internal] load build definition from Dockerfile                                                                                                                                        0.1s
 => => transferring dockerfile: 34B                                                                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                                                                           0.1s
 => => transferring context: 2B                                                                                                                                                             0.0s
 => [internal] load metadata for docker.io/library/node:10-slim                                                                                                                             0.4s
 => CACHED [1/3] FROM docker.io/library/node:10-slim@sha256:88932859e3d022d79161b99628c4c2c50e836437455e2d1b1a008d98367b10d6                                                                0.0s
 => [internal] load build context                                                                                                                                                           0.1s
 => => transferring context: 34B                                                                                                                                                            0.0s
 => ERROR [2/3] RUN npm i -g vsce                                                                                                                                                           7.2s
------                                                                                                                                                                                           
 > [2/3] RUN npm i -g vsce:                                                                                                                                                                      
#5 6.183 /usr/local/bin/vsce -> /usr/local/lib/node_modules/vsce/vsce                                                                                                                            
#5 6.197                                                                                                                                                                                         
#5 6.197 > keytar@7.7.0 install /usr/local/lib/node_modules/vsce/node_modules/keytar                                                                                                             
#5 6.197 > prebuild-install || npm run build                                                                                                                                                     
#5 6.197 
#5 6.410 prebuild-install WARN install EACCES: permission denied, access '/root/.npm'
#5 6.629 npm ERR! code EACCES
#5 6.630 npm ERR! syscall scandir
#5 6.630 npm ERR! path /root/.npm/_logs
#5 6.630 npm ERR! errno -13
#5 6.631 npm ERR! 
#5 6.631 npm ERR! Your cache folder contains root-owned files, due to a bug in
#5 6.631 npm ERR! previous versions of npm which has since been addressed.
#5 6.631 npm ERR! 
#5 6.631 npm ERR! To permanently fix this problem, please run:
#5 6.631 npm ERR!   sudo chown -R 65534:0 "/root/.npm"
#5 6.633 glob error { [Error: EACCES: permission denied, scandir '/root/.npm/_logs']
#5 6.633   errno: -13,
#5 6.633   code: 'EACCES',
#5 6.633   syscall: 'scandir',
#5 6.633   path: '/root/.npm/_logs' }
#5 6.646 
#5 6.646 > keytar@7.7.0 build /usr/local/lib/node_modules/vsce/node_modules/keytar
#5 6.646 > node-gyp rebuild
#5 6.646 
#5 6.772 gyp ERR! find Python 
#5 6.772 gyp ERR! find Python Python is not set from command line or npm configuration
#5 6.772 gyp ERR! find Python Python is not set from environment variable PYTHON
#5 6.772 gyp ERR! find Python checking if "python" can be used
#5 6.772 gyp ERR! find Python - "python" is not in PATH or produced an error
#5 6.772 gyp ERR! find Python checking if "python2" can be used
#5 6.772 gyp ERR! find Python - "python2" is not in PATH or produced an error
#5 6.772 gyp ERR! find Python checking if "python3" can be used
#5 6.772 gyp ERR! find Python - "python3" is not in PATH or produced an error
#5 6.772 gyp ERR! find Python 
#5 6.773 gyp ERR! find Python **********************************************************
#5 6.773 gyp ERR! find Python You need to install the latest version of Python.
#5 6.773 gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
#5 6.773 gyp ERR! find Python you can try one of the following options:
#5 6.773 gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
#5 6.773 gyp ERR! find Python   (accepted by both node-gyp and npm)
#5 6.773 gyp ERR! find Python - Set the environment variable PYTHON
#5 6.773 gyp ERR! find Python - Set the npm configuration variable python:
#5 6.773 gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
#5 6.773 gyp ERR! find Python For more information consult the documentation at:
#5 6.773 gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
#5 6.773 gyp ERR! find Python **********************************************************
#5 6.773 gyp ERR! find Python 
#5 6.774 gyp ERR! configure error 
#5 6.774 gyp ERR! stack Error: Could not find any Python installation to use
#5 6.774 gyp ERR! stack     at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:307:47)
#5 6.775 gyp ERR! stack     at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:136:21)
#5 6.775 gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:179:16)
#5 6.775 gyp ERR! stack     at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:271:16)
#5 6.775 gyp ERR! stack     at exithandler (child_process.js:301:5)
#5 6.775 gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:313:5)
#5 6.775 gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
#5 6.775 gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
#5 6.775 gyp ERR! stack     at onErrorNT (internal/child_process.js:415:16)
#5 6.775 gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:63:19)
#5 6.775 gyp ERR! System Linux 5.4.0-1062-azure
#5 6.775 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
#5 6.776 gyp ERR! cwd /usr/local/lib/node_modules/vsce/node_modules/keytar
#5 6.776 gyp ERR! node -v v10.24.1
#5 6.776 gyp ERR! node-gyp -v v5.1.0
#5 6.776 gyp ERR! not ok 
#5 6.780 npm ERR! code ELIFECYCLE
#5 6.780 npm ERR! errno 1
#5 6.780 npm ERR! keytar@7.7.0 build: `node-gyp rebuild`
#5 6.780 npm ERR! Exit status 1
#5 6.781 npm ERR! 
#5 6.781 npm ERR! Failed at the keytar@7.7.0 build script.
#5 6.781 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
#5 7.042 npm ERR! code ELIFECYCLE
#5 7.042 npm ERR! errno 243
#5 7.044 npm ERR! keytar@7.7.0 install: `prebuild-install || npm run build`
#5 7.044 npm ERR! Exit status 243
#5 7.044 npm ERR! 
#5 7.044 npm ERR! Failed at the keytar@7.7.0 install script.
#5 7.044 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
#5 7.068 
#5 7.068 npm ERR! A complete log of this run can be found in:
#5 7.068 npm ERR!     /root/.npm/_logs/2021-11-03T22_17_57_750Z-debug.log
------
executor failed running [/bin/sh -c npm i -g vsce]: exit code: 243
worksofliam commented 2 years ago

Having the same issue. Very out of the blue.

worksofliam commented 2 years ago

Whatever has happened has completely ruined my deployment process. What a shame.

I had to re-write my simple deployment script to remove the dep on this action.

Here's the commit for that: https://github.com/halcyon-tech/vscode-ibmi/commit/0227b787c0cdfd8027c2967035dcac6aadcafd7b

sourishkrout commented 2 years ago

Same. To workaround it with minimal changes I downgraded/pinned vsce in my fork. feel free to use @worksofliam.

-        uses: lannonbr/vsce-action@2.0.0
+        uses: sourishkrout/vsce-action@2.0.1
sourishkrout commented 2 years ago

Actually just identified the issue and made a PR with a fix: https://github.com/lannonbr/vsce-action/pull/8.

The problem is the underlying outdated node:10-slim image. It'll work with node:16-slim.

Published a tag on my fork to do just that:

-        uses: lannonbr/vsce-action@2.0.0
+        uses: sourishkrout/vsce-action@2.0.2
sourishkrout commented 2 years ago

Actually just identified the issue and made a PR with a fix: #8.

The problem is the underlying outdated node:10-slim image. It'll work with node:16-slim.

Published a tag on my fork to do just that:

-        uses: lannonbr/vsce-action@2.0.0
+        uses: sourishkrout/vsce-action@2.0.2

OK - I spoke too soon. Now I'm getting:

node:internal/modules/cjs/loader:1183
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: libsecret-1.so.0: cannot open shared object file: No such file or directory
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/vsce/node_modules/keytar/lib/keytar.js:1:14)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
  code: 'ERR_DLOPEN_FAILED'
}

It appears this is a newish pending issue with vsce: https://github.com/microsoft/vscode-vsce/issues/645

sourishkrout commented 2 years ago

Published tag 0.0.3 that pins vsce to 1.102.0 using node:16-slim which I will use until the original issue is fixed.

-        uses: lannonbr/vsce-action@2.0.0
+        uses: sourishkrout/vsce-action@2.0.3
joaomoreno commented 2 years ago
prebuild-install WARN install EACCES: permission denied, access '/root/.npm'

Interesting. Using prebuild-install, keytar should just have downloaded precompiled binaries for your platform, but it kinda got stuck on this error unfortunately.

Does prebuild-install manage to download it if you change the permissions on that file?

lannonbr commented 2 years ago

Just pushed a 3.0.0 tag for this action that includes @sourishkrout's PR to update the dockerfile to node 16. Closing this for now.