coder / code-server

VS Code in the browser
https://coder.com
MIT License
67.57k stars 5.54k forks source link

[Bug report] C++ extension not works on my x64 server #3924

Closed HuJK closed 2 years ago

HuJK commented 3 years ago

OS/Web Information

Steps to Reproduce

  1. Create a clean environment: https://github.com/HuJK-TestRepo/code-server-bug-reproduce
    git clone https://github.com/HuJK-TestRepo/code-server-bug-reproduce
    cd code-server-bug-reproduce
    docker build -t code-server-bug-reproduce .
    docker run --rm -it -p 45654:45654 code-server-bug-reproduce
  2. goto ip:45654
  3. install C++ extension
  4. open folder /root
  5. open main.cpp

Expected

C++ extension runs normally

Actual

C++ extension not working as expected with error: This Linux arm64 version of the extension is incompatible with your OS. Please download and install the "cpptools-linux.vsix" version of the extension.

Logs

[2021-08-08T07:59:44.047Z] info  Wrote default config file to ~/.config/code-server/config.yaml
[2021-08-08T07:59:44.383Z] info  code-server 3.11.1 c680aae973d83583e4a73dc0c422f44021f0140e
[2021-08-08T07:59:44.384Z] info  Using user-data-dir ~/.local/share/code-server
[2021-08-08T07:59:44.393Z] info  Using config file ~/.config/code-server/config.yaml
[2021-08-08T07:59:44.393Z] info  HTTP server listening on http://0.0.0.0:45654 
[2021-08-08T07:59:44.393Z] info    - Authentication is disabled 
[2021-08-08T07:59:44.393Z] info    - Not serving HTTPS 
[2021-08-08T08:00:02.146Z] debug forking vs code...
[2021-08-08T08:00:02.445Z] debug setting up vs code...
[2021-08-08T08:00:02.448Z] debug vscode got message from code-server {"type":"init"}
[2021-08-08T08:00:03.097Z] debug vscode got message from code-server {"type":"socket"}
[2021-08-08T08:00:03.101Z] debug protocol Initiating handshake... {"token":"ac08c10c-7b38-4d8c-b887-35b5c2d51942"}
[2021-08-08T08:00:03.111Z] debug protocol Handshake completed {"token":"ac08c10c-7b38-4d8c-b887-35b5c2d51942"}
[2021-08-08T08:00:03.112Z] debug management Connecting... {"token":"ac08c10c-7b38-4d8c-b887-35b5c2d51942"}
[2021-08-08T08:00:03.113Z] debug vscode 1 active management connection(s)
[2021-08-08T08:00:03.472Z] debug Making request {"uri":"https://api.github.com/repos/cdr/code-server/releases/latest"}
[2021-08-08T08:00:03.498Z] debug vscode got message from code-server {"type":"socket"}
[2021-08-08T08:00:03.498Z] debug protocol Initiating handshake... {"token":"8055ab76-f6e1-43a8-a8fb-51594642c73d"}
[2021-08-08T08:00:03.618Z] debug protocol Handshake completed {"token":"8055ab76-f6e1-43a8-a8fb-51594642c73d"}
[2021-08-08T08:00:03.619Z] debug exthost Connecting... {"token":"8055ab76-f6e1-43a8-a8fb-51594642c73d"}
[2021-08-08T08:00:03.619Z] debug exthost Getting NLS configuration... {"token":"8055ab76-f6e1-43a8-a8fb-51594642c73d"}
[2021-08-08T08:00:03.620Z] debug vscode 1 active exthost connection(s)
[2021-08-08T08:00:03.620Z] debug exthost Spawning extension host... {"token":"8055ab76-f6e1-43a8-a8fb-51594642c73d"}
[2021-08-08T08:00:03.642Z] debug exthost Waiting for handshake... {"token":"8055ab76-f6e1-43a8-a8fb-51594642c73d"}
[2021-08-08T08:00:03.922Z] debug got latest version {"latest":"3.11.1"}
[2021-08-08T08:00:03.923Z] debug comparing versions {"current":"3.11.1","latest":"3.11.1"}
[2021-08-08T08:00:04.004Z] debug exthost Handshake completed {"token":"8055ab76-f6e1-43a8-a8fb-51594642c73d"}
[2021-08-08T08:00:04.004Z] debug exthost Sending socket {"token":"8055ab76-f6e1-43a8-a8fb-51594642c73d"}
 INFO Installing extension: ms-vscode.cpptools
 INFO Downloaded extension: ms-vscode.cpptools /root/.local/share/code-server/CachedExtensionVSIXs/ms-vscode.cpptools-1.5.1
 INFO Extracted extension to /root/.local/share/code-server/extensions/.a2093314-522e-4391-a722-35ea915bd216: ms-vscode.cpptools
 INFO Renamed to /root/.local/share/code-server/extensions/ms-vscode.cpptools-1.5.1
 INFO Installation completed. ms-vscode.cpptools
 INFO Extensions installed successfully: ms-vscode.cpptools
[2021-08-08T08:00:20.200Z] debug management Disposing... {"token":"ac08c10c-7b38-4d8c-b887-35b5c2d51942"}
[2021-08-08T08:00:20.202Z] debug management Closed {"token":"ac08c10c-7b38-4d8c-b887-35b5c2d51942"}
[2021-08-08T08:00:20.221Z] debug setting up vs code...
[2021-08-08T08:00:20.222Z] debug vscode got message from code-server {"type":"init"}
[2021-08-08T08:00:20.244Z] debug exthost Got disconnected message {"token":"8055ab76-f6e1-43a8-a8fb-51594642c73d"}
[2021-08-08T08:00:20.244Z] debug exthost Disconnected {"token":"8055ab76-f6e1-43a8-a8fb-51594642c73d"}
[2021-08-08T08:00:20.599Z] debug vscode got message from code-server {"type":"socket"}
[2021-08-08T08:00:20.601Z] debug protocol Initiating handshake... {"token":"1e1849a1-f95e-4a78-9e37-5d90b2fff7f3"}
[2021-08-08T08:00:20.648Z] debug protocol Handshake completed {"token":"1e1849a1-f95e-4a78-9e37-5d90b2fff7f3"}
[2021-08-08T08:00:20.648Z] debug management Connecting... {"token":"1e1849a1-f95e-4a78-9e37-5d90b2fff7f3"}
[2021-08-08T08:00:20.649Z] debug vscode 1 active management connection(s)
[2021-08-08T08:00:20.957Z] debug got latest version {"latest":"3.11.1"}
[2021-08-08T08:00:20.958Z] debug comparing versions {"current":"3.11.1","latest":"3.11.1"}
[2021-08-08T08:00:21.001Z] debug vscode got message from code-server {"type":"socket"}
[2021-08-08T08:00:21.002Z] debug protocol Initiating handshake... {"token":"b4a8a4d8-eb49-4290-bf64-9f120c6a7606"}
[2021-08-08T08:00:21.242Z] debug exthost Exited {"code":0,"token":"8055ab76-f6e1-43a8-a8fb-51594642c73d"}
[2021-08-08T08:00:21.242Z] debug exthost Disposing... {"token":"8055ab76-f6e1-43a8-a8fb-51594642c73d"}
[2021-08-08T08:00:21.242Z] debug exthost Closed {"token":"8055ab76-f6e1-43a8-a8fb-51594642c73d"}
[2021-08-08T08:00:21.243Z] debug protocol Handshake completed {"token":"b4a8a4d8-eb49-4290-bf64-9f120c6a7606"}
[2021-08-08T08:00:21.243Z] debug exthost Connecting... {"token":"b4a8a4d8-eb49-4290-bf64-9f120c6a7606"}
[2021-08-08T08:00:21.244Z] debug exthost Getting NLS configuration... {"token":"b4a8a4d8-eb49-4290-bf64-9f120c6a7606"}
[2021-08-08T08:00:21.244Z] debug vscode 1 active exthost connection(s)
[2021-08-08T08:00:21.244Z] debug exthost Spawning extension host... {"token":"b4a8a4d8-eb49-4290-bf64-9f120c6a7606"}
[2021-08-08T08:00:21.253Z] debug exthost Waiting for handshake... {"token":"b4a8a4d8-eb49-4290-bf64-9f120c6a7606"}
[2021-08-08T08:00:21.606Z] debug exthost Handshake completed {"token":"b4a8a4d8-eb49-4290-bf64-9f120c6a7606"}
[2021-08-08T08:00:21.607Z] debug exthost Sending socket {"token":"b4a8a4d8-eb49-4290-bf64-9f120c6a7606"}

Screenshot

image

Notes

This issue can be reproduced in VS Code: Not sure

goddade commented 3 years ago

same problem.

hyoputer commented 3 years ago

I recommend you refer to #2120. A rather temporary fix is to manually download the right version of the vsix file from the cpptools releases page and install it from there.

HuJK commented 3 years ago

At the moment our plan is to switch to Open VSX which will deprecate our marketplace. Originally posted by @code-asher in https://github.com/cdr/code-server/issues/2120#issuecomment-896135918

Oh, The real problem is the runtime license of vscode-cpptools are not fully open sourced mentioned here: https://github.com/open-vsx/publish-extensions/pull/250

So this C++ extension will still not available after this upgrade😢. But this is Microsoft's problem, there are nothing we can do... Or can we?

jsjoeio commented 3 years ago

It restricts usage to Microsoft products. We accept only open source licenses in this publishing repository.

I don't think so sadly 😢 cc @code-asher

code-asher commented 3 years ago

Oh right I forgot about the license issue. Yeah I don't think we can do anything about it. I've heard there are some alternative extensions but I don't recall what they were and from what I heard they don't work as well anyway.

vipwp commented 2 years ago

@HuJK You can download cpptools-linux.vsix from https://github.com/microsoft/vscode-cpptools/releases, and than use "install from vsix". It works for me.

HuJK commented 2 years ago

The problem is the extension is free to distribute, but not open source. And open-vsx accepts open source extensions only.

I think there is four solution.

  1. Use the marketplace hosted by Microsoft directly.
    • Disadvantage: not sure it is legal or not.
  2. Download vsix and install manually.
    • Disadvantage: can't auto upgrade.
  3. Create another registry provides it. Just like nonfree distros in debian, allow users to choose
    • Disadvantage: host and maintain registries costs money.
  4. Convince open-vsx add a contrib , nonfree divisions which allows extensions such as this extension.
    • Disadvantage: eclipse foundation may not accept our suggestion.
jsjoeio commented 2 years ago

Use the marketplace hosted by Microsoft directly.

We can't do this for legal reasons 😢 Against their TOS.

Create another registry provides it. Just like nonfree distros in debian, allow users to choose

code-server currently has a private closed-source extension marketplace but we're trying to move away from that since it's too much time + effort to maintain and Open VSX is better anyway.

Convince open-vsx add a contrib , nonfree divisions which allows extensions such as this extension.

Hey, if you start the discussion, I'm happy to chime in and say it would help code-server.

Download vsix and install manually.

This is our best solution for now :(

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.