mojo icon indicating copy to clipboard operation
mojo copied to clipboard

[Modular CLI]: Can't install on arch linux

Open TheKaram opened this issue 1 year ago • 66 comments

Issue description

I have received an email from Modular to download Mojo but the installation script supports only Fedora and Ubuntu.

Steps to reproduce

Run the installation script on arch linux.

Version Info

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

I couldn't install it.

TheKaram avatar Sep 07 '23 17:09 TheKaram

We're triaging new platforms as requests come in, and prioritizing with respect to our roadmap. Other folks with the same request - please upvote this issue. Stay tuned!

bzcheeseman avatar Sep 07 '23 18:09 bzcheeseman

This is a working PKGBUILD file:

pkgname=modular
pkgver=0.1.4
pkgrel=1
pkgdesc="Modular installation tool"
url="https://developer.modular.com/download"
license=("custom:modular")
depends=(
    "python"
    "python-pip"
    "ncurses"
    "libxml2"
)
arch=("x86_64")
source=("https://dl.modular.com/public/installer/deb/debian/pool/any-version/main/m/mo/modular_$pkgver/modular-$pkgver-amd64.deb")
sha256sums=("7b958ac02260ae9a7224c6ae50860a4dd00089ffc00fc87a0c56585b34c10849")

package() {
    bsdtar -xf data.tar -C "$pkgdir/"
}

But due to some other issues, you still can't fully install mojo. This for one is due to the modular package manager not creating a custom Python venv (which can be easily fixed by invoking it in a shell which has a venv active). The however bigger problem is that the shipped lldb was compiled against an ncurses build which is not available on Arch Linux - the LLVM build that ModularML does needs to link against ncursesw, instead of ncurses in order for it to run on Arch Linux.

Janrupf avatar Sep 07 '23 18:09 Janrupf

Nice, thanks for the example. We'll take all this under advisement for when we get to Arch support :)

bzcheeseman avatar Sep 07 '23 18:09 bzcheeseman

You want your language to grow, it needs to be able to be installed anywhere. Let the packagers do their work. The only place this can currently be used is with Debian and RPM package managers, which is just disappointing.

Hopefully someday Mojo is truly open source because then it would be easier to actually install it in places and use it.

demizer avatar Sep 07 '23 18:09 demizer

I'm sorry you're disappointed! We are working on pushing things forward and expanding support, please do stay tuned.

bzcheeseman avatar Sep 07 '23 18:09 bzcheeseman

@bzcheeseman Could you please post an ETA on this thread, if and when there is one.

varasinguluri avatar Sep 07 '23 19:09 varasinguluri

Manually changed libpanelw.so & libncursesw.so per Janrupf's comment to the filenames lldb asks for, gives this error now.

In case it's of any help, here are the logs. Running wsl2 arch.

pond:lib duck$ modular install mojo
# Found release for https://packages.modular.com/mojo @ 0.2.1, installing to /home/duck/.modular/pkg/packages.modular.com_mojo
# Downloads complete, setting configs...
# Configs complete, running post-install hooks...
Requirement already satisfied: find_libpython==0.3.0 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from -r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 1)) (0.3.0)
Requirement already satisfied: papermill==2.4.0 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from -r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (2.4.0)
Requirement already satisfied: jupyter_client>=8.3.0 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from -r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 3)) (8.3.1)
Requirement already satisfied: ansiwrap in /home/duck/.python/pkgs/lib/python3.11/site-packages (from papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (0.8.4)
Requirement already satisfied: click in /home/duck/.python/pkgs/lib/python3.11/site-packages (from papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (8.1.7)
Requirement already satisfied: pyyaml in /home/duck/.python/pkgs/lib/python3.11/site-packages (from papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (6.0.1)
Requirement already satisfied: nbformat>=5.1.2 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (5.9.2)
Requirement already satisfied: nbclient>=0.2.0 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (0.8.0)
Requirement already satisfied: tqdm>=4.32.2 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (4.66.1)
Requirement already satisfied: requests in /home/duck/.python/pkgs/lib/python3.11/site-packages (from papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (2.31.0)
Requirement already satisfied: entrypoints in /home/duck/.python/pkgs/lib/python3.11/site-packages (from papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (0.4)
Requirement already satisfied: tenacity in /home/duck/.python/pkgs/lib/python3.11/site-packages (from papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (8.2.3)
Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from jupyter_client>=8.3.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 3)) (5.3.1)
Requirement already satisfied: python-dateutil>=2.8.2 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from jupyter_client>=8.3.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 3)) (2.8.2)
Requirement already satisfied: pyzmq>=23.0 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from jupyter_client>=8.3.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 3)) (25.1.1)
Requirement already satisfied: tornado>=6.2 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from jupyter_client>=8.3.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 3)) (6.3.3)
Requirement already satisfied: traitlets>=5.3 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from jupyter_client>=8.3.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 3)) (5.9.0)
Requirement already satisfied: platformdirs>=2.5 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from jupyter-core!=5.0.*,>=4.12->jupyter_client>=8.3.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 3)) (3.10.0)
Requirement already satisfied: fastjsonschema in /home/duck/.python/pkgs/lib/python3.11/site-packages (from nbformat>=5.1.2->papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (2.18.0)
Requirement already satisfied: jsonschema>=2.6 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from nbformat>=5.1.2->papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (4.19.0)
Requirement already satisfied: six>=1.5 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from python-dateutil>=2.8.2->jupyter_client>=8.3.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 3)) (1.16.0)
Requirement already satisfied: textwrap3>=0.9.2 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from ansiwrap->papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (0.9.2)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from requests->papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (3.2.0)
Requirement already satisfied: idna<4,>=2.5 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from requests->papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from requests->papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (2.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from requests->papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (2023.7.22)
Requirement already satisfied: attrs>=22.2.0 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from jsonschema>=2.6->nbformat>=5.1.2->papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (23.1.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from jsonschema>=2.6->nbformat>=5.1.2->papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (2023.7.1)
Requirement already satisfied: referencing>=0.28.4 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from jsonschema>=2.6->nbformat>=5.1.2->papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (0.30.2)
Requirement already satisfied: rpds-py>=0.7.1 in /home/duck/.python/pkgs/lib/python3.11/site-packages (from jsonschema>=2.6->nbformat>=5.1.2->papermill==2.4.0->-r /home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (0.10.2)
Testing `MODULAR_HOME=/home/duck/.modular`
* `/home/duck/.modular/pkg/packages.modular.com_mojo/bin/mojo`...
TEST: `mojo --help`... OK
TEST: `mojo run --help`... OK
TEST: `mojo build test_mandelbrot.mojo`... OK
TEST: `mojo build test_python.mojo`... OK
TEST: `mojo demangle`... OK
TEST: `mojo format`... OK
TEST: `mojo package`... OK
TEST: `mojo test_mandelbrot.mojo`... OK
TEST: `mojo test_python.mojo`... OK
== stdout ==

== stderr ==
/home/duck/.modular/pkg/packages.modular.com_mojo/bin/lldb: /usr/lib/libpanel.so.6: version `NCURSES6_5.0.19991023' not found (required by /home/duck/.modular/pkg/packages.modular.com_mojo/bin/../lib/liblldb.so.18git)
/home/duck/.modular/pkg/packages.modular.com_mojo/bin/lldb: /usr/lib/libncurses.so.6: version `NCURSES6_5.0.19991023' not found (required by /home/duck/.modular/pkg/packages.modular.com_mojo/bin/../lib/liblldb.so.18git)

TEST: `mojo repl`... ERROR
Traceback (most recent call last):
  File "/home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/self-test.py", line 342, in <module>
    main()
  File "/home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/self-test.py", line 338, in main
    tester.test(args.test_jupyter)
  File "/home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/self-test.py", line 275, in test
    self.test_mojo_repl()
  File "/home/duck/.modular/pkg/packages.modular.com_mojo/scripts/post-install/self-test.py", line 195, in test_mojo_repl
    assert False
AssertionError
modular: error: failed to run python:

ChadDuck avatar Sep 08 '23 03:09 ChadDuck

You want your language to grow, it needs to be able to be installed anywhere. Let the packagers do their work. The only place this can currently be used is with Debian and RPM package managers, which is just disappointing.

Hopefully someday Mojo is truly open source because then it would be easier to actually install it in places and use it.

Could not agree more. It's disappointing that modular first realised a locked-down cloud offering, and then a custom downloader that requires auth tokens and only supports a subset of one distro, before a simple and obvious binary tarball. Bad priorities. I'd suggest that the roadmap should be revisited.

lee-b avatar Sep 08 '23 07:09 lee-b

You won't go far with out neckbeards. Please get this on the AUR soon, TY.

Michaelmantion avatar Sep 08 '23 19:09 Michaelmantion

We appreciate your feedback. Please stay tuned for our future news!

smuniraj2018 avatar Sep 08 '23 23:09 smuniraj2018

Tickets should not be closed until the issues are resolved.

lee-b avatar Sep 08 '23 23:09 lee-b

I have made some experiments, i finally got it working, but it is not ideal.

image

I can add the steps to get it working to the PKGBUILD from @Janrupf. I'll do that later on.

Sharktheone avatar Sep 09 '23 01:09 Sharktheone

Okay, i have created a gist, i hope all the scripts are working, i could not test all of them

Sharktheone avatar Sep 09 '23 04:09 Sharktheone

both fresh install scripts work after changing lines 21-23 from:

    if [$authtoken != "done"] then
        modular auth $authtoken
    fi

to

    if [ $authtoken != "done" ] 
	then
        modular auth $authtoken
    fi

(added a space in the [] and moved then to a new line)

also echo is spelt ehco on line 17.

cluac7 avatar Sep 09 '23 08:09 cluac7

I have changed this in the gist, im not shure, but when coping the libraries to the OS library folders, you might need the libncurses.so.6 in both /lib/ and /usr/lib. I've added this also to the script.

Sharktheone avatar Sep 09 '23 12:09 Sharktheone

@Sharktheone how did you get arround the externally-managed-environment error when running the post-install hooks of the mojo installer(modular install mojo)

JustFrederik avatar Sep 09 '23 15:09 JustFrederik

@JustFrederik i just created a python venv and used this python version

Sharktheone avatar Sep 09 '23 17:09 Sharktheone

I created a venv and activated it, but i got the same error. Did you also set some env variables?

JustFrederik avatar Sep 09 '23 17:09 JustFrederik

no, just

python3 -m venv venv
source venv/bin/activate

modular install mojo

Sharktheone avatar Sep 09 '23 17:09 Sharktheone

I reinstalled python, modular, and recreated the venv and that solved it. Thanks

JustFrederik avatar Sep 09 '23 17:09 JustFrederik

Good, another opportunity would removing the EXTERNALLY-MANAGED file in /usr/lib/python3.11 or what ever your python version is

Sharktheone avatar Sep 09 '23 17:09 Sharktheone

Ty got it working on my Arch distro

Welcome to Mojo! 🔥 Expressions are delimited by a blank line. Type :mojo help for further assistance. 1> print("I use Arch Btw") 2. I use Arch Btw 2> ⏎

Michaelmantion avatar Sep 10 '23 08:09 Michaelmantion

@Sharktheone it might makes sense to create a custom venv to arch to use and activate automaticly everytime install is used(updating).

Something like this in(.bashrc/.zshrc):

function modular() {
    if [[ "$1" == "install" ]] ||  [[ "$1" == "uninstall" ]]; then
        source ~/.modular_venv/bin/activate
    fi
    command modular "$@"
}

function mojo() {
    if [[ "$1" == "update" ]]; then
        source ~/.modular_venv/bin/activate
        modular uninstall mojo 
        modular clean
        modular install mojo
    else
        command mojo "$@"
    fi
}

JustFrederik avatar Sep 10 '23 16:09 JustFrederik

custom venv... and activate automaticly everytime

direnv is helpful for that.

lee-b avatar Sep 10 '23 17:09 lee-b

@JustFrederik If you want i can include an option in the install script i wrote. But most of the time it is not a huge problem just activating a random venv to install / update mojo.

Sharktheone avatar Sep 10 '23 19:09 Sharktheone

@Sharktheone i added it to my zshrc file bc I wanted a easy way to update. It’s up to you if you think it’s worth adding.

JustFrederik avatar Sep 10 '23 19:09 JustFrederik

please support arch.

eramax avatar Sep 15 '23 18:09 eramax

please support arch.

It would be nice, we simply use an AUR package to install 🔥SDK on ArchLinux.

david-ragazzi avatar Sep 19 '23 16:09 david-ragazzi

please support arch.

It would be nice, we simply use an AUR package to install 🔥SDK on ArchLinux.

Yeah that would be great

AstralScribe avatar Sep 27 '23 16:09 AstralScribe

Please support arch.

jlb6907 avatar Sep 29 '23 14:09 jlb6907