Skip to content
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

Enabling arm64 support for omakub #29

Closed
wants to merge 20 commits into from
Closed

Conversation

iljo-dp
Copy link

@iljo-dp iljo-dp commented Jun 7, 2024

Hey I'm trying to incoporate arm64 support under this script as mentioned in

Currently NOT every app will work, with the biggest app that doesn't work being chrome
We can go chrome flatpak for example here, but leaving that up to you @dhh
Currently I am NOT finished doing every app and checking every package.
A good rule of thumb, If I haven't changed anything it probability works on arm unless it is farther down the list then docker.sh
Further I haven't checked YET
I haven't also done neovim(even though it is easy) since I was waiting for the other pull request about neovim to be finished before doing neovim stuff in this pull

@iljo-dp
Copy link
Author

iljo-dp commented Jun 7, 2024

this is in reference to #29 not wholly done yet but I'm getting very very close. But I need to leave for an exam right now, sorry to ping @dhh but is this a good way of handing it?

@iljo-dp
Copy link
Author

iljo-dp commented Jun 7, 2024

Out of what I've done already
Chrome, Signal, dropbox-nautilus, Zoom
Those are the apps which currently don't have a native arm version for linux(yet). We could use flatpaks or webapps for any of these options. DHH chooses which he prefers where

@iljo-dp
Copy link
Author

iljo-dp commented Jun 7, 2024

I'm pretty sure if you merge this piece of code there will be arm64 support for all the app installs, I also found a way to get automatically the latest ruby version automatically
@dhh could you review the code?

@iljo-dp
Copy link
Author

iljo-dp commented Jun 7, 2024

the ruby push is to fix #38 which is something you noted
And the latest push about pinta is me reversing an error I made while very sleepy yesterday

install/app-chrome.sh Outdated Show resolved Hide resolved
the issue with app-localsend needs to be resolved by dhh, but the -y fix was already implemented here before
@iljo-dp
Copy link
Author

iljo-dp commented Jun 8, 2024

if you could, would you mind looking at this pr @dhh

@coffeejunk
Copy link
Contributor

This is great, however, the current version will make the login hang due to the migration to mise (#36).

The initial install of mise will fail (silently) since it's not (yet) targeting arm64 and after the logout the system will hang on the installation confirmation.

@coffeejunk coffeejunk mentioned this pull request Jun 8, 2024
@iljo-dp
Copy link
Author

iljo-dp commented Jun 8, 2024

This is great, however, the current version will make the login hang due to the migration to mise (#36).

The initial install of mise will fail (silently) since it's not (yet) targeting arm64 and after the logout the system will hang on the installation confirmation.

Great I didn't catch that, thanks a lot and I'il implement it now

now I really think we should be ready for a merger or changes as to how we handle the non supported arm packages
@iljo-dp
Copy link
Author

iljo-dp commented Jun 8, 2024

Thanks a lot for the feedback, should be fixed now
Now I think we are ready for a merger unless dhh decides what he wants to do with the non arm native apps

wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1>/dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list
wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=${ARCH}] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: i guess you could also set arch=amd64,arm64 to support both?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean? Current we use ARCH to get the architecture, ARCH is a global variable set in the main sh script ran on starting omakub. And then ARCH indeed is arm64 or amd64, whatever ARCH is automatically set to at the start. What do you mean here, what do I need to change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so ARCH is dynamically set based on what architecture you use, so just doing arch=${ARCH} should work no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roele That'll fetch package info for the other architecture as well, however.

The arch can just be omitted, too. Then it'll use the default Apt::Architectures, which is just the native amd64/arm64.

@coffeejunk
Copy link
Contributor

Screenshot 2024-06-09 at 10 41 13 PM

🎉

@iljo-dp
Copy link
Author

iljo-dp commented Jun 10, 2024

🎉

thanks a lot for testing and verifying, are there any issues with the installing? of the apps? (ignoring the issues I already know about with missing apps)

@coffeejunk
Copy link
Contributor

@iljo-dp you can view the install log here: https://gist.github.com/coffeejunk/f228157342789a629425579ee5918b09

@iljo-dp
Copy link
Author

iljo-dp commented Jun 10, 2024

added a zoom webapp when using arm64, this uses Chromium..
Chromium itself isn't yet installed by default, and we are still discussing internally whether or not to opt for chromium or something else;

@iljo-dp
Copy link
Author

iljo-dp commented Jun 10, 2024

and this last commit is just fixing compatibility between my branch and the main branch

@iljo-dp
Copy link
Author

iljo-dp commented Jun 11, 2024

@dhh what do we still need before a merger would be possible?

# Determine architecture
ARCH=$(dpkg --print-architecture)
export ARCH

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nice property of the install/* scripts is that they can be invoked independently. Introducing global env vars breaks that. Would keep this invocation in each script.

Alternatively, you could

: "${ARCH:=$(dpkg --print-architecture)}"

in the scripts to lazy-set the env var.

install.sh Outdated Show resolved Hide resolved
install/app-github-cli.sh Outdated Show resolved Hide resolved
install/app-lazydocker.sh Outdated Show resolved Hide resolved
install/app-lazydocker.sh Outdated Show resolved Hide resolved
install/app-zellij.sh Outdated Show resolved Hide resolved
install/app-zoom.sh Outdated Show resolved Hide resolved
install/docker.sh Outdated Show resolved Hide resolved
wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1>/dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list
wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=${ARCH}] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roele That'll fetch package info for the other architecture as well, however.

The arch can just be omitted, too. Then it'll use the default Apt::Architectures, which is just the native amd64/arm64.

gtk-launch dropbox.desktop
elif [[ $ARCH == "arm64" ]]; then
#https://packages.ubuntu.com/noble/nautilus-dropbox
echo "Dropbox is not supported on arm64 architecture."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk building from source seems kinda sketchy? we could do that but ehh...
Maestral seems nice, and is perhaps something @dhh would like also, perhaps as just a replacement for dropbox?

@iljo-dp
Copy link
Author

iljo-dp commented Jun 11, 2024

Thanks a lot for the amazing feedback @jeremy I'll work on it all tomorrow, current I don't have the time but thanks a lot for the deep thorough help I'll make it work tomorrow, thanks a lot I really mean it.

Copy link
Author

@iljo-dp iljo-dp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot for the amazing feedback, most of it should be finished by now thanks a lot again we wouldn't have done this without you

wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1>/dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list
wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=${ARCH}] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean? Current we use ARCH to get the architecture, ARCH is a global variable set in the main sh script ran on starting omakub. And then ARCH indeed is arm64 or amd64, whatever ARCH is automatically set to at the start. What do you mean here, what do I need to change?

wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1>/dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list
wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=${ARCH}] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so ARCH is dynamically set based on what architecture you use, so just doing arch=${ARCH} should work no?

install/app-pinta.sh Outdated Show resolved Hide resolved
install/app-localsend.sh Show resolved Hide resolved
install/app-github-cli.sh Outdated Show resolved Hide resolved
install/app-lazygit.sh Outdated Show resolved Hide resolved
sudo apt update
sudo apt install -y signal-desktop
elif [[ $ARCH == "arm64" ]]; then
echo "Signal Desktop is only available for amd64 architecture."
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow, sounds great I'il look into it soon :D

install/app-vscode.sh Show resolved Hide resolved
install/app-zoom.sh Outdated Show resolved Hide resolved
gtk-launch dropbox.desktop
elif [[ $ARCH == "arm64" ]]; then
#https://packages.ubuntu.com/noble/nautilus-dropbox
echo "Dropbox is not supported on arm64 architecture."
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk building from source seems kinda sketchy? we could do that but ehh...
Maestral seems nice, and is perhaps something @dhh would like also, perhaps as just a replacement for dropbox?

@iljo-dp
Copy link
Author

iljo-dp commented Jun 12, 2024

I'il fix the other stuff soon, I got an exam to take tomorrow so currently I'm working for that, sorry to let y'all down for now

@Clay26
Copy link

Clay26 commented Jun 13, 2024

For Neovim, the latest available version for ARM in the apt repository is 0.7.2, even when using ppa:neovim-ppa/stable, which is not supported by LazyVim (see requirements). One option is to install from source. Here's how I currently install Neovim on my ARM machines (credit to Carlos Hurtado):

sudo apt-get install ninja-build \
gettext libtool libtool-bin \
autoconf automake cmake g++ \
pkg-config unzip
git clone https://github.com/neovim/neovim.git
cd neovim
git pull
git checkout stable
sudo make CMAKE_BUILD_TYPE=Release CMAKE_INSTALL_PREFIX=/opt/nvim install
echo 'export PATH="/opt/nvim/bin:$PATH"' >> ~/.bashrc

@nahue
Copy link

nahue commented Jun 13, 2024 via email

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
rm google-chrome-stable_current_amd64.deb
elif [[ $ARCH == "arm64" ]]; then
Copy link

@dre-hh dre-hh Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chromium has no widevine on arm64, thereofre cannot play netflix, spotify etc.
Also it might require certain flags for launching with gpu acceleration suuport to watch youtube properly. (guess the latter can only be properly tested on the actual device)
For widevine people often pull some bins from chromeos projects

Copy link

@dre-hh dre-hh Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some recent reserach on this, there is still no binary package with widevine for ubuntu or an arm browser which ships with it.

AsahiLinux is hosting a widevine installer script from crhomeos project which is pulling it from googleapis.com

And Brave browser published a manual how to link it #28903.

Chrome has released an arm64 version for windows. Guess a an arm chrome with widevine support is also likely to happen in future. But for now, probably going asahilinux way is best: adding custom installer, updater via chromeos binaries. Probably its best done in another PR once arm support ist merged

Version=1.0
Name=Spotify
Comment=Spotify online music player
Exec=xdg-open --app=https://open.spotify.com/ --name=Spotify
Copy link

@dre-hh dre-hh Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this opening in Chromium? I believe that also won't run without widevine

@Clay26
Copy link

Clay26 commented Jul 3, 2024

Hi @iljo-dp,

I wanted to check in on this PR. Are you still working on it? Is there anything I can assist with to help move this forward?

Thanks!

@Clay26
Copy link

Clay26 commented Jul 3, 2024

I believe we also need to build alacrity from source since there's no available packages for aarch64

@rwiankowski
Copy link

I believe we also need to build alacrity from source since there's no available packages for aarch64

You can install alacritty using snap: sudo snap install alacritty --classic

It works out of the box on a fresh arm64 Ubuntu install

@dhh
Copy link
Member

dhh commented Jul 27, 2024

This PR needs a major overhaul. Anyone interested in investigating? For now, I'd prefer if we just don't install an application if it's not available as arm64. Then we fill in as they become available.

@IbrahimTanyalcin
Copy link

Any news on this PR?, it is essentially aims the same as #227. In 227 if things fail, installation continues, essentially skipping those that are faulty/Not available and generates a report in the root dir so that they can be retried later as they are available.

@iljo-dp iljo-dp closed this by deleting the head repository Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants