-
Notifications
You must be signed in to change notification settings - Fork 289
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
Does not work if target is a nixos #648
Comments
For people just trying to get this working, the following works for me:
One possible fix (hacky but better than nothing) for the extension authors: automate these steps in the server install script buried inside the extension: @@ -126,6 +126,16 @@ then
echo "WARNING: $VSCH_DIR/server.sh doesn't exist. Download/untar may have failed."
fi
+ # If we're running on NixOS, then use the required installed nodejs-10_x dependency
+ if [ -d /nix -a "$(echo /usr/bin/*)" == "/usr/bin/env" ]; then
+ if nix-store --query --requisites /run/current-system | grep nodejs-10 > /dev/null; then
+ (cd $VSCH_DIR; rm node; ln -s $(which node))
+ else
+ echo Need nodejs-10_x to be installed on NixOs >&2
+ exit 1
+ fi
+ fi
+
rm vscode-server-linux-$VSCODE_ARCH.tar.gz
cd $STASHED_WORKING_DIR
I've tested this, but it's quite faffy extracting this source shell script from the minified js inside the |
Sorry but can you explain why you need to do this and what's different about the nixOS node version? |
@simonchatts your code could simply be replaced with a nix-shell -p nodejs invocation every time they need to run node |
The reason the node executable can't be run is because the executable is 32-bit |
Looks like it's actually just missing a dependency. Nixos handles deps with Nix, so it makes sense that it wouldn't be there. |
This StackExchange post seems to shed some light on solutions: https://unix.stackexchange.com/questions/522822/different-methods-to-run-a-non-nixos-executable-on-nixos |
Thanks. I'm thinking this is basically a variant of #103 which covers issues with our native binaries not running on machines that are missing dependencies. They should be statically linked (or allow running an external |
In any case, it would be much nicer to use a local nodejs instead of dumping 80MB into the user's homedir. The server is just a node script and dependencies; bundle it, minify, try to run with local node, if that doesn't work try some fallbacks like nix-shell and only then download a binary. |
@roblourens Is there any way we can work something up along the lines of what @wmertens is talking about regarding using a local |
I am not planning anything like that right now. |
@roblourens As you are someone who doesn't use NixOS, or any of the other distros having problems like this, I can appreciate that your position... but is there any way we can meet somewhere in the middle? I'm a sysadmin who has a bunch of developers I want to get up and running on this extension and my options aren't great at the moment. What can the NixOS community do for you to make this happen? |
If I may cast my voice, all of the targets we deploy also use NixOS and
many of my coworkers make use of vscode as the best platform for
programming on Linux. We would definitely be appreciative if this were
solved somehow. I can imagine a world where config settings could solve the
problem on NixOS without compromising other systems.
…On Tue, Jul 16, 2019, 7:03 PM Aaron Andersen ***@***.***> wrote:
@roblourens <https://github.com/roblourens> As you are someone who
doesn't use NixOS, or any of the other distros having problems like this, I
can appreciate that your position... but is there any way we can meet
somewhere in the middle? I'm a sysadmin who has a bunch of developers I
want to get up and running on this extension and my options aren't great at
the moment. What can the NixOS community do for you to make this happen?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#648?email_source=notifications&email_token=ABESJBKIW322BEYAYWLBBULP7Z4XHA5CNFSM4HW5D2KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2CZJHA#issuecomment-512070812>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABESJBITSSPZ7I4UPWQV2ATP7Z4XHANCNFSM4HW5D2KA>
.
|
@roblourens How about a setting in the editor extension that lets you
choose a path to a node binary to symlink to? That would work for all
distros.
You can even make it an array of paths, the first one that exists wins.
|
Isn't this about all of our native dependencies and not just node? Having users set up custom server configurations that swap out different dependencies with their own versions, even just for node, introduces a lot of complexity for us especially when trying to debug issues over github. We have enough issues just trying to support the most basic configurations 😁 |
I didn't notice any binary issues with the node modules, are they part of
the install blob or are they installed on the fly? The biggest issue here
is the binary node not working and you can easily check its version, as
well as putting in the issue template that custom node binaries are not
supported?
|
@roblourens I've had a developer on using this extension with NixOS for the morning and they have reported that their usual php workflow is operating flawlessly. They're asking me what it will take to replicate this across all our web servers. After running 🤷♂️ |
Native code is used for search, syntax highlighting, internal logging which tends to break the product when it can't be initialized, a remote handshake module which is responsible for the error messages in #103, any third party extensions that assume they are in a normal remote environment will break, and probably some other stuff I'm not thinking of. Maybe some of that works for you now but it could break later then we will be back trying to patch it with another hack. The point is that all of this has to be considered in the context of #103. |
Ok, how about an unsupported "build local" install mode, where instead of
downloading a binary, it uses a local node install to install the vscode
remote module? Npm will take care of all native building.
So then the remote requirements are: sshd running, node v10+ in path. If
the install fails, good luck.
|
@wmertens After the somewhat ominous warning from @roblourens is it time to start considering alternatives such as |
Urgh. Maybe just some ld preload that provides the missing /lib/ld-linux*? |
Actually I think @roblourens is right. The reason why the So its likely that #103 would fix this. |
@luxferresum I'll be very glad to see resolution to this. For now I'm continuing to have a few developers test out the extension with the custom Thanks for your continued efforts on this extension @roblourens. Sorry for any hassle we have caused. |
Steps to Reproduce:
The problem seems to be that
/home/lux/.vscode-server/bin/553cfb2c2205db5f15f3ee8395bbd5cf066d357d/node
can not be executed. I'm not really sure why. Running it inside aubuntu
docker container works. That way I could figure out it seems to be a nodev10.2.1
. However I'm not sure which version.https://nodejs.org/dist/v10.2.1/node-v10.2.1-linux-x64.tar.gz
runs just fine.The text was updated successfully, but these errors were encountered: