Open juerware opened 1 month ago
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.
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 ???
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?
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.
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
You might try using the backports of mesa drivers for Ubuntu20/22 available in a PPA as described here: https://github.com/zed-industries/zed/issues/16428#issuecomment-2295322255.
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 :+1:
Check for existing issues
Describe the bug / provide steps to reproduce it
When executing command line after clone the repository:
Repository commit: 2a649fa82
Environment
This is the system:
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.Zed.log