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

Comments

@marzolfb
Copy link

@marzolfb marzolfb commented Jun 16, 2019

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.

@vscodebot vscodebot bot added the new release label Jun 16, 2019
@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

This comment has been minimized.

Copy link
Member

@Tyriar Tyriar commented Jun 16, 2019

@joaomoreno

This comment has been minimized.

Copy link
Member

@joaomoreno 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

@jayschwa

This comment has been minimized.

Copy link

@jayschwa 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 and removed electron labels Jul 11, 2019
@Tyriar

This comment has been minimized.

Copy link
Member

@Tyriar 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.

@vscodebot

This comment has been minimized.

Copy link

@vscodebot 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!

@vscodebot vscodebot bot closed this Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.