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

Anything/extensions using execFile targetting something installed via snap (Linux packages) swallow stdout #75581

Closed
marzolfb opened this issue Jun 16, 2019 · 5 comments
Assignees
Labels
linux Issues with VS Code on Linux *out-of-scope Posted issue is not in scope of VS Code snap Issues related to the snap package upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@marzolfb
Copy link

Electron/vscode (not sure which but guessing vscode), seems to swallow stdout when executing something that was installed via snap on Linux.

  • VSCode Version: 1.35.1
  • OS Version: Ubuntu Linux 19.04

Steps to Reproduce:

  1. Install a package via snap. It can be any package (even sudo snap install hello-world) but I started noticing the problem with go, so let's stick with that:
sudo snap install --classic go

And the end of that, you should have a go binary available at /snap/bin/go (which symlinks to /usr/bin/snap)

  1. For comparison, manually install a go distribution. At the end of that you should have a go binary available at /usr/local/go/bin/go.

  2. Debug a node app (I first noticed a problem when debugging the vscode-go extension). Create an empty directory and add a new app.js file with these contents and launch a debugger:

var cp = require('child_process');
cp.execFile("/snap/bin/go", ['version'], {}, (err, stdout, stderr) => {
    console.log(`/snap/bin/go version: -->${stdout.trim()}<--`); 
});

cp.execFile("/usr/local/go/bin/go", ['version'], {}, (err, stdout, stderr) => {
    console.log(`/usr/local/go/bin/go version: -->${stdout.trim()}<--`);
});

You will see:

/usr/local/go/bin/go version: -->go version go1.12.6 linux/amd64<--
/snap/bin/go version: --><--

what you would expect to see is:

/usr/local/go/bin/go version: -->go version go1.12.6 linux/amd64<--
/snap/bin/go version: -->go version go1.12.6 linux/amd64<--

Incidentally/correspondingly, when you run node app.js in an integrated terminal within vscode you get the unexpected output while if you run the same command outside vscode in a terminal you get the expected output.

Does this issue occur when all extensions are disabled?: Yes

This issue seems identical/related but I will say I installed the exact same node version (10.15.2) and invoked the node repl in a terminal and ran this:

child_process.execFile('/snap/bin/go', ['version'], {}, (err, stdout, stderr) => { console.log(err, stdout, stderr); })

and I got back what I would expect:

null 'go version go1.12.6 linux/amd64\n' ''

So, that leads me to at least narrow it down to being a vscode/electron issue rather than a broader node issue.

@marzolfb marzolfb changed the title Anything/extensions using execFile targetting something installed via snap (Linux packages) Anything/extensions using execFile targetting something installed via snap (Linux packages) swallow stdout Jun 16, 2019
@Tyriar
Copy link
Member

Tyriar commented Jun 16, 2019

FYI @flexiondotorg

@Tyriar Tyriar added linux Issues with VS Code on Linux snap Issues related to the snap package upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Jun 16, 2019
@vscodebot vscodebot bot removed the new release label Jun 17, 2019
@joaomoreno
Copy link
Member

joaomoreno commented Jun 19, 2019

@Tyriar This doesn't appear related to VS Code running in a snap package, but to Electron spawning snap processes. Did I get that right?

cc @deepak1556 @bpasero

@joaomoreno joaomoreno added electron Issues and items related to Electron and removed snap Issues related to the snap package labels Jun 19, 2019
@jayschwa
Copy link

jayschwa commented Jul 10, 2019

@joaomoreno, I do think it's related to VS Code in a snap. When I run VS Code from a .deb installation, I don't encounter the problem. Additionally, I ran https://github.com/electron/electron-quick-start with Electron v4.2.5 (VS Code's current version) and could not reproduce the problem.

@Tyriar Tyriar added snap Issues related to the snap package and removed electron Issues and items related to Electron labels Jul 11, 2019
@Tyriar
Copy link
Member

Tyriar commented Oct 10, 2019

Looks like it's tracked in nodesource/distributions#663, you might also want to report to the snapcraft team. Closing since we cannot action this on our side.

@Tyriar Tyriar added the *out-of-scope Posted issue is not in scope of VS Code label Oct 10, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 10, 2019

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linux Issues with VS Code on Linux *out-of-scope Posted issue is not in scope of VS Code snap Issues related to the snap package upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants