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

Unable to use the GitHub Copilot plugin in Rider #223399

Open
jorisvandijk opened this issue Mar 27, 2023 · 10 comments
Open

Unable to use the GitHub Copilot plugin in Rider #223399

jorisvandijk opened this issue Mar 27, 2023 · 10 comments

Comments

@jorisvandijk
Copy link

Describe the bug

I'm unable to use the Copilot plugin in Rider as it won't let me log in and throws the following error:

"Failed to initiate the GitHub login process. Please try again."

Steps To Reproduce

Steps to reproduce the behavior:
I am following the steps as provided in the official documentation.

Expected behavior

I would expect it to open a webbrowser and let me connect the GitHub account to Rider.

Screenshots

Screenshot of the error in Rider

Additional context

I can manually connect my GitHub account in the settings in Rider, but that is apparently not enough for the Copilot plugin.

Notify maintainers

@raphaelr

Metadata

 ~ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.2.8, NixOS, 22.11 (Raccoon), 22.11.3339.da26ae9f6ce`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.1`
 - channels(joris): `"home-manager-22.11.tar.gz"`
 - channels(root): `"nixos-22.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@Krutonium
Copy link
Contributor

@jorisvandijk
Copy link
Author

jorisvandijk commented Mar 27, 2023

I worked around this by doing jank stuff. https://gitea.krutonium.ca/Krutonium/NixOS/src/branch/master/user/krutonium-hm-extras/packages.nix#L11-L22

Thank you for the suggestion. I gave it a try, but am not familiar with "jank stuff". I did the following, which did not work:

home.packages = with pkgs; 
    let
      riderScript = pkgs.writeShellScriptBin "rider"
        ''
          ${pkgs.steam-run}/bin/steam-run ${pkgs.jetbrains.rider}/bin/rider
        '';
      rider = pkgs.jetbrains.rider.overrideAttrs (oldAttrs: { meta.priority = 10; });
    in
  [
    steam-run
    jetbrains.rider
    ...
  ];

Any suggestions @Krutonium?

I should add I also tried without the pkgs. in front of each package as I run home.packages = with pkgs;

EDIT:
Interestingly, running rider with steam-run rider from terminal did allow me to log in. Unfortunately re-running it without steam-run breaks it again. For now I can manually run it with steam-run, but that's not really a solution to this bug.

@Krutonium
Copy link
Contributor

Krutonium commented Mar 27, 2023

You need to add rider and riderScript to your packages; and because of the implicit usage, you don't actually need to install steam-run or jetbrains.rider.

Basically what we're doing is replacing the rider that everything normally calls with our own that runs the proper executable through steam-run. (Decreasing the priority of the jetbrains.rider package allows us to overwrite it)

@raphaelr
Copy link
Contributor

raphaelr commented Mar 27, 2023

The error message is bad, it has nothing to do with logins. The file ~/.local/share/JetBrains/Rider2022.3/github-copilot-intellij/copilot-agent/bin/copilot-agent-linux is pointing to the wrong dynamic linker and needs to be patchelf'd.

$ nix-shell -p
$ patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) copilot-agent-linux

You'll have to repeat this step after every plugin update and ideally after every system update because $NIX_CC can get garbage collected.

@Krutonium
Copy link
Contributor

Would it be possible to nixify the plugins, similar to eg Gnome Addons?

@jorisvandijk
Copy link
Author

You'll have to repeat this step after every plugin update and ideally after every system update because $NIX_CC can get garbage collected.

That sounds very annoying to be honest. I'd second the motion of @Krutonium to Nixify :) (Obviously I have no idea how much of a hassle that is, probably way more than I'd imagine)

Thank you for the reply!

@jorisvandijk
Copy link
Author

jorisvandijk commented Mar 27, 2023

You need to add rider and riderScript to your packages

Yep, that did it! Thanks!

@Guekka
Copy link
Contributor

Guekka commented Apr 20, 2023

@Krutonium Have a look at #223593

@spy4x
Copy link

spy4x commented Mar 6, 2024

Same bug in WebStorm.

@vinstonsalim
Copy link

same in phpstorm

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

No branches or pull requests

6 participants