modularml / mojo

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

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

Open TheKaram opened 10 months ago

TheKaram commented 10 months ago

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.
bzcheeseman commented 10 months ago

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!

Janrupf commented 10 months ago

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.

bzcheeseman commented 10 months ago

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

demizer commented 10 months ago

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.

bzcheeseman commented 10 months ago

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

varasinguluri commented 10 months ago

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

ChadDuck commented 10 months ago

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:
lee-b commented 10 months ago

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.

Michaelmantion commented 10 months ago

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

smuniraj2018 commented 10 months ago

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

lee-b commented 10 months ago

Tickets should not be closed until the issues are resolved.

Sharktheone commented 10 months ago

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 commented 10 months ago

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

cluac7 commented 10 months ago

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.

Sharktheone commented 10 months ago

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.

JustFrederik commented 10 months ago

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

Sharktheone commented 10 months ago

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

JustFrederik commented 10 months ago

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

Sharktheone commented 10 months ago

no, just

python3 -m venv venv
source venv/bin/activate

modular install mojo
JustFrederik commented 10 months ago

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

Sharktheone commented 10 months ago

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

Michaelmantion commented 10 months ago

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")

  1. I use Arch Btw 2> ⏎

JustFrederik commented 10 months ago

@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
}
lee-b commented 10 months ago

custom venv... and activate automaticly everytime

direnv is helpful for that.

Sharktheone commented 10 months ago

@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.

JustFrederik commented 10 months ago

@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.

eramax commented 10 months ago

please support arch.

david-ragazzi commented 10 months ago

please support arch.

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

AstralScribe commented 10 months ago

please support arch.

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

Yeah that would be great

jlb6907 commented 10 months ago

Please support arch.

travisddavies commented 10 months ago

Please support Arch

AgentLoneStar007 commented 10 months ago

Yes, please support Arch Linux. I wanna switch my Discord.py bot to Mojolang.

AgentLoneStar007 commented 9 months ago

When Arch support Get on this pls

travisddavies commented 9 months ago

Arch install when image

dasTholo commented 9 months ago

I shall continue to bully Mojo devs until support is added. Join me fellow Arch users, and let us commence in meme-ing the crap out of this issue.

That doesn't help anyone. Why don't you create an AUR package for arch and everyone gets something out of it. That's Open Source

Aur package docs

tunalad commented 9 months ago

the most mentally stable arch user

fabrizio-ferrari commented 9 months ago

the most mentally stable arch user

Are you seriously judging all Arch users because of the behavior of one annoying guy?

AgentLoneStar007 commented 9 months ago

Heh heh heh heh heh

tunalad commented 9 months ago

the most mentally stable arch user

Are you seriously judging all Arch users because of the behavior of one annoying guy?

as an arch user myself, I absolutely am doing that

Sharktheone commented 9 months ago

Why don't you create an AUR package for arch and everyone gets something out of it. That's Open Source

I've been working on my script to install it, so it clould work with the AUR. But i need a few days to get it ready.

AgentLoneStar007 commented 9 months ago

If anyone on Arch wants to use Mojo, here's a script someone made: https://github.com/Sharktheone/arch-mojo

I'll look into porting it to an AUR package later.

jackos commented 9 months ago

@AgentLoneStar007 thank you for relinking the workaround that @Sharktheone produced. Please don't use spamming as a tactic, that's not helpful to anyone, and stops users from finding helpful workarounds like @Sharktheone produced.

Sharktheone commented 9 months ago

If anyone on Arch wants to use Mojo, here's a script someone made: https://github.com/Sharktheone/arch-mojo

I'll look into porting it to an AUR package later.

I am already on it, creating an AUR package.

Sharktheone commented 9 months ago

I have completed the two PKGBUILD files, but I am not shure, how we should handle this with versioning and the packages.

I would create one package for modular from the PKGBUILD from Janrupf and a second for mojo. For the mojo packages I am not sure, how we should handle this with versioning, since modular just installs the newest version. mojo-git would be an option and updating the version manually, because I thing checking the newest version in the PKGBUILD is more work than just updating it manually. We could also just do a pkg mojo-libs, but i think this goes completely misses the point from just typing in yay -S mojo or paru -S mojo

Kamek437 commented 9 months ago

Link? https://github.com/Sharktheone/arch-mojo For anyone coming along.

david-ragazzi commented 9 months ago

I have completed the two PKGBUILD files, but I am not shure, how we should handle this with versioning and the packages.

I would create one package for modular from the PKGBUILD from Janrupf and a second for mojo. For the mojo packages I am not sure, how we should handle this with versioning, since modular just installs the newest version. mojo-git would be an option and updating the version manually, because I thing checking the newest version in the PKGBUILD is more work than just updating it manually. We could also just do a pkg mojo-libs, but i think this goes completely misses the point from just typing in yay -S mojo or paru -S mojo

I think is simpler packages like "mojo-0.1", "mojo-0.2", etc.

Sharktheone commented 9 months ago

You mean for versioning? The main problem is, i cannot influence the version of mojo, that is being installed. Maybe a package called mojo makes sense, which has only to purpose to depend on modular and mojo-git

david-ragazzi commented 9 months ago

You mean for versioning? The main problem is, i cannot influence the version of mojo, that is being installed. Maybe a package called mojo makes sense, which has only to purpose to depend on modular and mojo-git

Oh yes.. I don't know the internals.. I this case, just mojo makes sense..

WebReflection commented 9 months ago

@Kamek437 python script worked out of the box to me https://github.com/modularml/mojo/issues/572#issuecomment-1752202145 and I hope this lands in AUR soon although it was also unexpectedly sketchy to curl your file that doesn't understand ArchLinux ... may I suggest to add the provided link in the Distro-specific Setup which currently only shows Ubuntu 20?

Basically an ArchLinux entry in the select that either points at the community GitHub hosted page or the AUR module, once it gets out?

Thank you!

Sharktheone commented 9 months ago

I want to upload it to the AUR soon™. I only procrastinate this since - uh - two weeks... 😅