modularml / mojo

The Mojo Programming Language
https://docs.modular.com/mojo
Other
22.04k stars 2.54k forks source link

[Modular CLI] install modular command tool without require root permissions #3034

Open shanguanma opened 2 weeks ago

shanguanma commented 2 weeks ago

Issue description

Currently modular is the only tool to install mojo and MAX, but it requires root privileges, which greatly limits those users who do not have privileges, such as ordinary users on computing clusters. I don't quite understand why an installation tool must obtain root privileges. And currently only the window WSL2 linux subsystem is supported in the Windows environment, why is there no support for WSL1 subsystem. I don't know if there are plans to improve it in the future.

Steps to reproduce

$ curl -s https://get.modular.com | sh -
It looks like you are using WSL1 which is unsupported by Modular.
We recommend switching your Linux distribution to run with WSL2 instead.
See https://learn.microsoft.com/en-us/windows/wsl/install#upgrade-version-from-wsl-1-to-wsl-2 to learn how to switch to WSL2.

Version Info

- Provide Modular CLI version by pasting the output of `modular -v`
- What OS did you install modular CLI on ?
Sharktheone commented 2 weeks ago

There were some issues with WSL1, for example when downloading mojo packages it often just got stuck, so chances are high even if the check wouldn't be there, you still wouldn't be able to install / run mojo.

shanguanma commented 2 weeks ago

There were some issues with WSL1, for example when downloading mojo packages it often just got stuck, so chances are high even if the check wouldn't be there, you still wouldn't be able to install / run mojo.

However,the modular(i.e.: modular 0.2.2 (95d42445)) can be installed successfully, although there will be the following complaints every time it is run.

$ modular -v
[764:764:20240613,094129.771037:ERROR exception_handler_server.cc:361] getsockopt: Invalid argument (22)
[762:762:20240613,094129.775058:ERROR socket.cc:153] unhandled cmsg 0, 0
Failed to initialize Crashpad.  Crash reporting will not be available.  Cause: crashpad failed to start handler
modular 0.2.2 (95d42445)

and
 $ mojo -v
[777:777:20240613,174314.942186:ERROR exception_handler_server.cc:361] getsockopt: Invalid argument (22)
[775:775:20240613,174314.946522:ERROR socket.cc:153] unhandled cmsg 0, 0
Failed to initialize Crashpad.  Crash reporting will not be available.  Cause: crashpad failed to start handler
mojo 0.5.0 (6e50a738)
Sharktheone commented 2 weeks ago

I think I saw a fix for that somewhere... Does the ~/.modular/crashdb folder exist? If not, you might need to create it, for some version it fixed it, and for newer it doesn't, but maybe you can give it a try.

I don't know the exact errors that WSL1 brings with it, but if you could install modular 0.2.2 I guess, you're just lucky 😉

shanguanma commented 2 weeks ago

I think I saw a fix for that somewhere... Does the ~/.modular/crashdb folder exist? If not, you might need to create it, for some version it fixed it, and for newer it doesn't, but maybe you can give it a try.

I don't know the exact errors that WSL1 brings with it, but if you could install modular 0.2.2 I guess, you're just lucky 😉

I have try install newer mojo via exist modular. it doesn't work, the log is as follows:

$ modular install mojo
[782:782:20240613,174729.505656:ERROR exception_handler_server.cc:361] getsockopt: Invalid argument (22)
[780:780:20240613,174729.506158:ERROR socket.cc:153] unhandled cmsg 0, 0
Failed to initialize Crashpad.  Crash reporting will not be available.  Cause: crashpad failed to start handler
modular: error: http error: failed to reach URL https://packages.modular.com/mojo/1.root.json with cURL error Timeout was reached -