pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

[Bug][IDE]: VSCode extension doesn't work with older GLIBC

Open alexanderpils opened this issue 8 months ago • 8 comments

Describe the Bug

I wanted to try out the VSCode extension, but got this error, it seems I have a too old version of GLIBC (2.34) but 2.39 is needed, therefor I am not sure if this is a bug or it's just on my side, but sadly I can't update this system, so maybe there is the option to lower the required version.

Codebase

No response

IDE Setup

I am running pyrefly 0.14.0 VSCode 1.99.3
CentOS Stream 9

Output

/home/user/.vscode-server/extensions/meta.pyrefly-0.14.0-linux-x64/bin/release/pyrefly: /usr/lib64/libc.so.6: version `GLIBC_2.39' not found (required by /home/user/.vscode-server/extensions/meta.pyrefly-0.14.0-linux-x64/bin/release/pyrefly) [Error - 7:06:37 AM] Client Pyrefly language server: connection to server is erroring. Shutting down server. [Error - 7:06:37 AM] Stopping server failed Error: Client is not running and can't be stopped. It's current state is: starting at xd.shutdown (/home/user/.vscode-server/extensions/meta.pyrefly-0.14.0-linux-x64/dist/extension.js:39:8615) at xd.stop (/home/user/.vscode-server/extensions/meta.pyrefly-0.14.0-linux-x64/dist/extension.js:39:8194) at xd.stop (/home/user/.vscode-server/extensions/meta.pyrefly-0.14.0-linux-x64/dist/extension.js:39:44100) at xd.handleConnectionError (/home/user/.vscode-server/extensions/meta.pyrefly-0.14.0-linux-x64/dist/extension.js:39:13955) at processTicksAndRejections (node:internal/process/task_queues:95:5) at runNextTicks (node:internal/process/task_queues:64:3) at process.processImmediate (node:internal/timers:454:9) [Error - 7:06:37 AM] Server initialization failed. Message: write EPIPE Code: -32099 [Error - 7:06:37 AM] Pyrefly language server client: couldn't create connection to server. Message: write EPIPE Code: -32099 [Error - 7:06:37 AM] Restarting server failed Message: write EPIPE Code: -32099 [Error - 7:06:37 AM] The Pyrefly language server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information. /home/user/.vscode-server/extensions/meta.pyrefly-0.14.0-linux-x64/bin/release/pyrefly: /usr/lib64/libc.so.6: version `GLIBC_2.39' not found (required by /home/user/.vscode-server/extensions/meta.pyrefly-0.14.0-linux-x64/bin/release/pyrefly)

Other Attempts

No response

alexanderpils avatar May 06 '25 07:05 alexanderpils

We can potentially use a older ubuntu image to produce the linux build that has a lower glibc requirement. However, the oldest one provided by GitHub is ubuntu 22.04, which requires glibc 2.35, so unfortunately it still won't solve your problem.

SamChou19815 avatar May 06 '25 18:05 SamChou19815

You're right — that wouldn't solve my issue, but I’d still recommend providing wheels for Ubuntu 22.04. Its end-of-life is in 2027, so it’s still widely used.

That said, I’m not deeply familiar with the intricacies of this topic, so I might be off base. However, I use Ruff — which is also built with Rust and relies on glibc — and it works well on my system. Perhaps there's an opportunity to follow a similar approach to how they build their wheels? From what I can tell, they use the manylinux image and glibc 2.17+.

alexanderpils avatar May 07 '25 07:05 alexanderpils

We have a few options:

  • Build with musl for statically-linked dependencies. I bet this would impact our performance and we'd have to benchmark it (source)
  • use an image from an older OS like ubuntu 20.04

I tried option 2 and it seems to build. can you test that this extension works on your machine?

pyrefly-linux-x64.zip

kinto0 avatar May 09 '25 17:05 kinto0

We use jemalloc explicitly, so the cost of musl and static linking might be lower. But let's see if @alexanderpils can already get it working with the older Ubuntu.

ndmitchell avatar May 18 '25 19:05 ndmitchell

Yes it is working now! Thank you!

alexanderpils avatar May 19 '25 06:05 alexanderpils

Hi there, I'm currently using pyrefly vscode extension==0.17.1 on a Linux server with glibc==2.28 and I still got the same glibc error like

[Error - 9:32:16 AM] The Pyrefly language server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
/home/user/.vscode-server/extensions/meta.pyrefly-0.17.1-linux-x64/bin/release/pyrefly: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /home/user/.vscode-server/extensions/meta.pyrefly-0.17.1-linux-x64/bin/release/pyrefly)

Please tell me if I'm missing something.

NisFu-gh avatar May 29 '25 01:05 NisFu-gh

Hi there, I'm currently using pyrefly vscode extension==0.17.1 on a Linux server with glibc==2.28 and I still got the same glibc error like

[Error - 9:32:16 AM] The Pyrefly language server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
/home/user/.vscode-server/extensions/meta.pyrefly-0.17.1-linux-x64/bin/release/pyrefly: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /home/user/.vscode-server/extensions/meta.pyrefly-0.17.1-linux-x64/bin/release/pyrefly)

Please tell me if I'm missing something.

Thanks for the report! This one's a lot older than the other one - you are not missing something.

We're looking into static linking in order to support any version of glibc. If it doesn't have a performance degradation, it should work for you. Stay tuned.

If you're really blocked in the meantime and want to compile your own platform's pyrefly, you can set it as pyrefly.lspPath in vscode settings adn reload your window.

kinto0 avatar May 29 '25 15:05 kinto0

Hi there, I'm currently using pyrefly vscode extension==0.17.1 on a Linux server with glibc==2.28 and I still got the same glibc error like

[Error - 9:32:16 AM] The Pyrefly language server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
/home/user/.vscode-server/extensions/meta.pyrefly-0.17.1-linux-x64/bin/release/pyrefly: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /home/user/.vscode-server/extensions/meta.pyrefly-0.17.1-linux-x64/bin/release/pyrefly)

Please tell me if I'm missing something.

@NisFu-gh can you try this version? it should fix it for you. if so, we will do a release

pyrefly-linux-x64 (1).zip

kinto0 avatar May 30 '25 18:05 kinto0

@kinto0 Hi, I can confirm that the version you provided works well. It would be great if we can have this in the following release.

NisFu-gh avatar Jun 03 '25 02:06 NisFu-gh

@kinto0 Hi, I can confirm that the version you provided works well. It would be great if we can have this in the following release.

awesome! v0.18.0 has it in it. thanks for your report!!

kinto0 avatar Jun 03 '25 13:06 kinto0