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

Incorrect installation path when using downloadAndUnzipVSCode in versions 1.85.0 and above #255

Closed
umpox opened this issue Jan 11, 2024 · 3 comments
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@umpox
Copy link

umpox commented Jan 11, 2024

There seems to have been a regression somewhere with how resolveCliArgsFromVSCodeExecutablePath either downloads VS Code, or returns the correct CLI path. It is missing Visual Studio Code.app from the installation path.

Before (pre 1.85.0)

const vscodeExecutablePath = await downloadAndUnzipVSCode({ version: '1.84.0' })
Download location: .vscode-test/vscode-darwin-arm64-1.84.0/Visual Studio Code.app/Contents/Resources/app/bin/code

After (1.85.0 and after)

const vscodeExecutablePath = await downloadAndUnzipVSCode({ version: '1.85.0' })
Download location :.vscode-test/vscode-darwin-arm64-1.85.0/Contents/Resources/app/bin/code

resolveCliArgsFromVSCodeExecutablePath still expects "Visual Studio Code.app" in the path.

This causes the error:
.vscode-test/vscode-darwin-arm64-1.85.1/Visual Studio Code.app/Contents/Resources/app/bin/code: No such file or directory

@umpox umpox changed the title resolveCliArgsFromVSCodeExecutablePath returns an incorrect path OR downloads to an incorrect place for VS Code version 1.85.0 Incorrect installation path when using downloadAndUnzipVSCode in versions 1.85.0 and above Jan 11, 2024
@umpox
Copy link
Author

umpox commented Jan 11, 2024

Example code that errors:

import { exec } from 'child_process';

import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath } from '@vscode/test-electron';

async function main() {
    const vscodeExecutablePath = await downloadAndUnzipVSCode({ version: '1.85.0' })
    const [cli] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath)

    // Run a test message to check CLI works
    exec(`"${cli}" --version`, (error, stdout, stderr) => {
        if (error) {
            console.error(`error: ${error.message}`);
            return;
        }
        if (stderr) {
            console.error(`stderr: ${stderr}`);
            return;
        }
        console.log(`stdout: ${stdout}`);
    });
}

main()

@rtetley
Copy link

rtetley commented Jan 16, 2024

Do you get passed the download stage ? For me this:

const vscodeExecutablePath = await downloadAndUnzipVSCode('1.85.0');

Causes the error:

Downloading VS Code 1.85.0 from https://update.code.visualstudio.com/1.85.0/darwin-arm64/stable
gzip: stdin has more than one entry--rest ignored
tar: Child died with signal 13
tar: Error is not recoverable: exiting now
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
Emitted 'error' event on Socket instance at:
    at Socket.onerror (node:internal/streams/readable:785:14)
    at Socket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

No problem if I use version 1.84.0 though

@connor4312
Copy link
Member

Please upgrade to the latest version of @vscode/test-electron where this is fixed.

@connor4312 connor4312 added the *duplicate Issue identified as a duplicate of another issue(s) label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

3 participants