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

TMC plugin not working in NixOS #705

Open
JeztC opened this issue Dec 31, 2023 · 1 comment
Open

TMC plugin not working in NixOS #705

JeztC opened this issue Dec 31, 2023 · 1 comment
Assignees

Comments

@JeztC
Copy link

JeztC commented Dec 31, 2023

Describe the bug
TMC extension is not working on NixOS, and doesn't let me login or choose courses with the extension.

To Reproduce
Steps to reproduce the behavior:

  1. Download TMC plugin from the extensions
  2. Click the TMC plugin menu to open it
  3. Error appears in the output

Expected behavior
Normally the extension would let the user login to TMC.

Screenshots
nix

Desktop (please complete the following information):

  • OS: NixOS 23.11.2217.d02d818f22c7 (Tapir) x86_64
  • VSCodium Version: 1.84.2
  • TMC Extension Version: 2.2.4

TMC Extension logs

[2024-01-06 10:45:34:090] [INFO] VSCodium version: 1.84.2
[2024-01-06 10:45:34:090] [INFO] moocfi.test-my-code version: 2.2.4
[2024-01-06 10:45:34:090] [INFO] Currently open workspace: CsharpProject
[2024-01-06 10:45:34:090] [INFO] Platform linux Arch x64
[2024-01-06 10:45:34:090] [INFO] TMC-Langs version: tmc-langs-cli-x86_64-unknown-linux-gnu-0.36.0
[2024-01-06 10:45:34:091] [INFO] Running "/home/jesse/.config/VSCodium/User/globalStorage/moocfi.test-my-code/cli/tmc-langs-cli-x86_64-unknown-linux-gnu-0.36.0" "tmc" "--client-name" "vscode_plugin" "--client-version" "2.2.4" "logged-in"
[2024-01-06 10:45:34:091] [DEBUG] Backend at https://tmc.mooc.fi
[2024-01-06 10:45:34:091] [DEBUG] Config dir at undefined
[2024-01-06 10:45:34:094] [DEBUG] stderr
Could not start dynamically linked executable: /home/jesse/.config/VSCodium/User/globalStorage/moocfi.test-my-code/cli/tmc-langs-cli-x86_64-unknown-linux-gnu-0.36.0
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld

[2024-01-06 10:45:34:094] [ERROR] Failed to check if authenticated:
Langs process ended without result data.
[2024-01-06 10:45:34:094] [ERROR] The above error may have been caused by an interfering antivirus program. Please add an exception for the following folder:
/home/jesse/.config/VSCodium/User/globalStorage/moocfi.test-my-code/cli
[2024-01-06 10:45:34:095] [ERROR] Error during initialization: Empy Langs Response Error: Langs process ended without result data.
@Heliozoa Heliozoa self-assigned this Jan 4, 2024
@Heliozoa
Copy link
Collaborator

Sorry to get back to you late.

The extension uses an additional CLI binary for some of its functionality (https://github.com/rage/tmc-langs-rust) and we haven't considered NixOS support for it before since it hasn't come up, but we'd like to support it if we can.

I was unable to find a good solution for distributing a precompiled binary for NixOS, though possibly just because I'm not familiar with Nix. Seems like the preferred method is to compile the programs yourself? I haven't come up with a good way to integrate that with the extension, if you're well versed with nix and have some thoughts let me know. Currently, we just identify the the platform the extension is running on and download the appropriate executable from our servers.

For now, I've committed a default.nix file for the CLI. If you clone the repository (https://github.com/rage/tmc-langs-rust), build it with nix and replace the executable at the path in the error message, it should hopefully work without issues. If something is off with the default.nix file, an issue or PR is appreciated too.

Starting from the next release of the CLI, we'll also publish a version of the binary that should work on NixOS, but will not work on Java extensions (the binary will be built targeting musl, which doesn't support dynamic linking which the Java support relies on). The next release of the extension after that would then add logic to download the musl build if NixOS is detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants