-
Notifications
You must be signed in to change notification settings - Fork 727
Description
Environment data
dotnet --info output:
.NET SDK:
Version: 7.0.102
Commit: 4bbdd14480
Runtime Environment:
OS Name: nixos
OS Version: 23.05
OS Platform: Linux
RID: linux-x64
Base Path: /nix/store/b5sc5y8f64bxl7bw835ayc4hnnndmhrx-dotnet-sdk-7.0.102/sdk/7.0.102/
Host:
Version: 7.0.2
Architecture: x64
Commit: d037e070eb
.NET SDKs installed:
3.1.426 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/sdk]
6.0.405 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/sdk]
7.0.102 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.32 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.13 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.2 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.32 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.13 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.2 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_ROOT [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined]
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
VS Code version: 1.75.0
C# Extension version: 1.25.4 (but happens sinde v1.25.1-beta2 when #4738 got merged)
OmniSharp log
2023-02-05 16:09:02.874 [error] Activating extension ms-dotnettools.csharp failed due to an error:
2023-02-05 16:09:02.874 [error] Error: Error: Command failed: uname -m
/bin/sh: line 1: uname: command not found
/bin/sh: line 1: uname: command not found
at /nix/store/dq5cgsfmh9r491qwaiwi5mmln533gbfv-vscode-extension-ms-dotnettools-csharp-1.25.4/share/vscode/extensions/ms-dotnettools.csharp/dist/extension.js:2:763831
at ChildProcess.exithandler (node:child_process:415:5)
at ChildProcess.emit (node:events:526:28)
at maybeClose (node:internal/child_process:1092:16)
at Socket.<anonymous> (node:internal/child_process:451:11)
at Socket.emit (node:events:526:28)
at Pipe.<anonymous> (node:net:687:12)
Steps to reproduce
- Open VSCode with v1.25.4
- Open Extension Host output
- See error
Expected behavior
Extension opens and works.
Actual behavior
Error when invoking uname -m as we no longer inherit the process' env vars.
Additional context
In NixOS, uname is not located in neither /bin nor /usr/bin (which is what child_process checks by default if env.PATH is not specified), so the call to invoke uname should include the process' PATH to be able to find it.
In my system it's located at /run/current-system/sw/bin/uname (which is a symlink that resolves to /nix/store/jynqcrh9yxh59w3sckkzmsz9n4r4iv0r-coreutils-full-9.1/bin/uname but that could change at any moment so the most reliable method to find it to have the process' PATH).
This was introduced in #4738 which sends in an empty object to child_process (and that makes in no longer inherit the env vars from process.env).