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

Error when installing from repository on ubuntu 20.04 #15468

Closed
1 task done
juerware opened this issue Jul 30, 2024 · 8 comments
Closed
1 task done

Error when installing from repository on ubuntu 20.04 #15468

juerware opened this issue Jul 30, 2024 · 8 comments
Labels
bug [core label] linux open source Open source community projects, contributions, etc panic / crash [core label] platform support An umbrella label for all platforms

Comments

@juerware
Copy link

juerware commented Jul 30, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

When executing command line after clone the repository:

Repository commit: 2a649fa

# bash script/linux 
+ which rustup
++ command -v sudo
+ maysudo=/usr/bin/sudo
++ command -v apt-get
+ apt=/usr/bin/apt-get
+ [[ -n /usr/bin/apt-get ]]
+ deps=(gcc g++ libasound2-dev libfontconfig-dev libwayland-dev libxkbcommon-x11-dev libssl-dev libstdc++-12-dev libzstd-dev libvulkan1 libgit2-dev make clang mold jq gettext-base elfutils libsqlite3-dev)
+ /usr/bin/sudo /usr/bin/apt-get install -y gcc g++ libasound2-dev libfontconfig-dev libwayland-dev libxkbcommon-x11-dev libssl-dev libstdc++-12-dev libzstd-dev libvulkan1 libgit2-dev make clang mold jq gettext-base elfutils libsqlite3-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libfontconfig1-dev' instead of 'libfontconfig-dev'
E: Unable to locate package libstdc++-12-dev
E: Couldn't find any package by regex 'libstdc++-12-dev'
E: Unable to locate package mold

Environment

This is the system:

# cat /etc/*rele*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS"
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

Zed.log
@juerware juerware added admin read Pending admin review bug [core label] panic / crash [core label] triage Maintainer needs to classify the issue labels Jul 30, 2024
@SomeoneToIgnore
Copy link
Contributor

Looks like nobody considered Ubuntu 20.04 when creating the script.

I see no mold for 20.04 in the official repos: https://packages.ubuntu.com/search?keywords=mold
and I presume other libs may have the same issue.

Somebody with Ubuntu 20.04 needs to propose changes to that script, otherwise the issue risks staying up ~268 days until 23 April 2025 (Ubuntu 20.04 EOL) and then it will be closed.

Alternatively, welcome to use any other means to install those packages in your system, edit the script to omit those and move on.
mold is not really required, as it is used to speed up linking, the rest of the libraries seems needed though.

@juerware
Copy link
Author

The problem is to compile mold in ubuntu 20.04 because of:

fatal error: concepts: No such file or directory

In ubuntu 20.04 there is no stable repository for "You need a C++20 compiler, like GCC 10.2.0"
In fact in "https://github.com/rui314/mold#installation" there is no right status for ubuntu 20.04

Any solution ???

@SomeoneToIgnore
Copy link
Contributor

mold is not really required, as it is used to speed up linking, the rest of the libraries seems needed though.

Keep the old linker and tolerate larger build times?

@notpeter notpeter added linux open source Open source community projects, contributions, etc platform support An umbrella label for all platforms and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jul 30, 2024
@notpeter
Copy link
Member

I switched to libstdc++-10-dev instead of libstdc++-12-dev (because that's what's available) and grabbed a statically compiled copy of mold v2.32.1 from the mold github releases and I got it to compile and run zed --help in a docker container. I don't have a GUI there so I can't test whether the graphical bits actually work.

My install script:

maysudo=$(command -v sudo || command -v doas || true)
deps=(
    gcc
    g++
    libasound2-dev
    libfontconfig-dev
    libwayland-dev
    libxkbcommon-x11-dev
    libssl-dev
    libstdc++-10-dev
    libzstd-dev
    libvulkan1
    libgit2-dev
    make
    clang
    curl
    jq
    gettext-base
    elfutils
    libsqlite3-dev
)
$maysudo apt-get install -y "${deps[@]}"

#rustup
which rustup > /dev/null 2>&1 || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

# mold
# which mold > /dev/null 2>&1 || curl -s -L https://github.com/rui314/mold/releases/download/v2.32.1/mold-2.32.1-aarch64-linux.tar.gz | $maysudo tar xvz --strip-components=1 -C /usr/local
which mold > /dev/null 2>&1 || curl -s -L https://github.com/rui314/mold/releases/download/v2.32.1/mold-2.32.1-x86_64-linux.tar.gz | $maysudo tar xvz --strip-components=1 -C /usr/local
which mold
mold --version

Then the following worked:

cd zed
cargo run -- --help

Perhaps someone else with Ubuntu 20.04 on native hardware could test and see if that's enough or whether the graphical bits immediately fail.

@notpeter notpeter changed the title Error when installing from repository on ubuntu 20.4 Error when installing from repository on ubuntu 20.04 Aug 9, 2024
@just-an-engineer
Copy link

just-an-engineer commented Aug 19, 2024

I just tried to build it as well on Ubuntu 20 (before coming across this, and here are some of my notes)

From the Linux script, it wasn't able to locate package by regex libstdc++-12-dev, however, it didn't seem to make a difference, as even though I installed the 10-dev one, I ended up uninstalling it and it didn't make an impact.

I seemed to have issues with zstd-sys, and ended up running both of these, so I'm not too sure which one it is

cargo add zstd-sys
sudo apt install libzstd-dev

I also had a linking error where it couldn't find a certain symbol, and I had to install libxbcommon-x11-dev, which I think (along with libzstd-dev) should be included with the other dependencies in the script. I ran sudo apt install libxkbcommon-x11-dev and it seemed to work.

After that, I was able to build, but got a NoSupportedDeviceFound, which I did find in other issues, and at that point I decided to wait until I upgrade my entire system in a few months and retry.
I think the above packages I mentioned should be included in the package, as well as put mold into the documentation, at least. I changed the linker outlined in the config.toml, so perhaps just adding that to the readme that you can change it there to gold/lld/etc (whatever preferred local linker they want). I had a myriad of other problems with trying to compile mold like some other people mentioned here.
I don't want to make a PR or anything myself if I can't actually build it and get it working to truly confirm. But if there's no progress on this issue in a few months, I'll go through the motions of building Zed on a completely fresh install, and even mess around with trying other version of Ubuntu and such if I have the time.

For specs, I'm on Ubuntu 20 (focal), integrated graphics w/ amdgpu and ati for the driver, wayland for display but x.org for the server, x86_64

EDIT: said gold instead of mold. Gy bad

@notpeter
Copy link
Member

You might try using the backports of mesa drivers for Ubuntu20/22 available in a PPA as described here: #16428 (comment).

@just-an-engineer
Copy link

Thank you, that worked. I'll keep the notes I have, and when I go through the process again with a clean box, if I encounter the same errors, I'll be a bit more meticulous and push a PR then to make the install process a bit cleaner. I don't want to clutter up the mess even more if it was just a me-error.
Thank you again 👍

@notpeter
Copy link
Member

I'm going to go ahead and close this. We would welcome a PR to improve instructions for building from source on Ubuntu 20.04, but realistically 20.04 is going to be poorly supported by Zed as we approach the April 2025 EOL.

Separately, due to GitHub Actions deprecating Ubuntu 20.04 Linux ARM we've been forced to make our Linux ARM builds have a minimum requirement of >=22.04 because of glibc minimum versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] linux open source Open source community projects, contributions, etc panic / crash [core label] platform support An umbrella label for all platforms
Projects
None yet
Development

No branches or pull requests

4 participants