msteen / nixos-vsliveshare

Live Share support in Visual Studio Code for NixOS
MIT License
24 stars 7 forks source link

No Such File or Directory #1

Closed rawkode closed 4 years ago

rawkode commented 5 years ago

Hi @msteen, have you seen this error with your own setup? Any advice, please?

msteen commented 5 years ago

AFAIK that happens when you use vsliveshare as provided by Microsoft, i.e. the version unpatched for NixOS usage. Do you have services.vsliveshare.enableWritableWorkaround = true;?

I just tested it on my setup and it no longer seems to work, so I will try and update it again, probably again a case of the latest version needing slightly different patches. I will let you know when I get it working on my setup. Thanks for reporting!

rawkode commented 5 years ago

If I can help, please let me know. I'd love to get this working

msteen commented 5 years ago

I will try and make some time tonight or tomorrow to try and make it work again.

msteen commented 5 years ago

Update: I updated the extension to the latest version and modified the patch accordingly, and updated vscode to the latest version (so the extension ought to work with that version of vscode), but unfortunately I do not see the extension show up. When I test the dotnet executable directly it does work without error, so it seems to be related to some change in the JavaScript of the extension. I will need a deeper look into the code to see what I might need to change to get it to work again. If it is really important to get it to work as soon as possible, you might also try and downgrade vscode to the version it had when the extension had version 1.0.67.

msteen commented 5 years ago

After experimenting a bit I found out that my patch broke things in the latest version. As far as I have tested it seems like it is no longer necessary to add those patches except for the check of permissions. I am able to use liveshare again on my machine while running the latest version of vscode.

jamescostian commented 4 years ago

I believe this error is back with a vengence. I was able to get it to work, but when I restarted VS Codium I got the same error again. I'm using almost the exact config from the README, but with the correct path for me (which goes to VS Codium's ~/.vscode-oss instead of VS code's ~/.vscode).

If close VS Codium, set services.vsliveshare.enableWritableWorkaround = false; and then run nixos-rebuild switch and then set it back to true and run nixos-rebuild switch yet again, then it works the next time I start VS Codium - until I close VS Codium and open it again :sob:

Ptival commented 4 years ago

@jamescostian any update?

The enableWritableWorkaround does not seem to work for me, I get error messages about a path in the nix store being read-only.

jamescostian commented 4 years ago

I decided to use a different work-around for all of my NixOS-only issues: stop using NixOS. This work-around requires a good amount of changes, but it does fix a lot, including this, for me.

msteen commented 4 years ago

@Ptival I will take a look at it again later today and see if I can create a more robust workaround then this easily broken source patch.

@jamescostian Sorry to hear that. NixOS is indeed not without its issues. For me the benefits still outweigh the issues.

rawkode commented 4 years ago

I did the same. Went back to Arch because I need live share to pair at work. I would love to see this fixed once and for all and want to thank you for your efforts thus far, @msteen

Ptival commented 4 years ago

Actually it worked for me, at least once. What was hard was to regenerate the ~/.vscode/extensions folder, because the write workaround won't necessarily be rebuilt by a nixos rebuild switch if the configuration has not changed otherwise.

I'm not sure whether my installation is stable though! :-) And in general, VSCode extensions seem to be complicated. So thanks for looking at it if you have time, but no worries!

msteen commented 4 years ago

I am actually not using vsliveshare myself at the moment, hence I am definitely not the best maintainer for this project, but I like the feature and want it to work under NixOS, so I will try and to make it work again. I just did some experiments and think I will be able to make it work such that it will automatically rebuild the extension when an update comes in, you will only have to reload the vscode window one extra time (to reload the then patched extension). It might take me some time to get this done, since the extension fails to build at the moment (some dotnet libraries won't copy anymore).

msteen commented 4 years ago

@rawkode I managed to fix the extension for the latest version and rather than using a patch file, whose context is easily broken by updates, I now patch it by replacing a few function headers and making them return the constants I want, whose code has been the same since the first version I patched, so it should no longer easily break on the patch.

@Ptival I redid the way the module works. In hindsight you want to have all workarounds enabled in all cases, so I simply removed those options and enabled them always. Rather than only triggering the fix when the service restarts, I made it so that you can either update the extension manually through a command or have it automatically update the extension when a new version arrives (see the updated README).

rawkode commented 4 years ago

Great job, can't wait to try this when I get home.

Thanks @msteen