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

Support RedHat 8.x on official Zed binaries (glibc 2.28) #21055

Open
1 task done
Timmmm opened this issue Nov 22, 2024 · 3 comments
Open
1 task done

Support RedHat 8.x on official Zed binaries (glibc 2.28) #21055

Timmmm opened this issue Nov 22, 2024 · 3 comments

Comments

@Timmmm
Copy link

Timmmm commented Nov 22, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Zed currently requires glibc 2.29, which is not available on older Linux distros. I'm using RHEL 8 which only has 2.28.

I thought using the unofficial Flatpak version would work around this (isn't that the point of Flatpak?) but no, exactly the same issue. Soured my opinion of Flatpak a bit tbh, if it doesn't even avoid Linux's biggest binary compatibility clusterfuck.

Anyway is there any chance you could compile Zed with an older version? E.g. you could use Rocky 8. Here's an example where I did this.

Environment

RHEL 8 / Glibc 2.28

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

No response

@Timmmm Timmmm added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Nov 22, 2024
@jansol jansol added enhancement [core label] linux and removed bug [core label] triage Maintainer needs to classify the issue labels Nov 22, 2024
@notpeter
Copy link
Member

For reference, our official binaries for the GUI do not support RHEL 8.x, but the zed-remote-server binaries do (no glibc requirement at all).

You can absolutely build from source on Redhat 8.x. You should be able to follow the normal Building Zed for Linux docs. I recommend you checkout tags that match our released versions (e.g. v0.162.3 or whatever) as a random commit off main may be less stable.

To be honest, we don't have official RHEL 8.x compatible binaries because the primary use case for old RHEL and clones was for zed-remote-server. I put in the bulk of the work here to make sure it could build on almalinux:8 under Docker, but you're the first person to actually request builds for RHEL 8.x:

There's some extra complexity for creating our CI release builds under Docker, but nothing too crazy. I'll see if I can get it going.

@notpeter notpeter added enterprise and removed admin read Pending admin review labels Nov 26, 2024
@notpeter notpeter changed the title Support older Linux distros Support RedHat 8.x on official Zed binaries (glibc 2.28) Nov 26, 2024
@Timmmm
Copy link
Author

Timmmm commented Nov 26, 2024

Ugh I had a whole comment here and then Linux's brilliant memory management kicked in and hard rebooted my machine (obviously what desktop users want when you run out of memory!).

Anyway TL;DR, I tried building from source and had two issues:

  1. linux/script tries to enable the crb DNF repo but on RHEL8 it's actually codeready-builder-for-rhel-8-x86_64-rpms (who can keep track of this stuff?)
  2. It tries to use mold even if you don't have Mold installed. I don't know if there's any way of making mold optional in .cargo/config.toml but I would suggest at least adding a warning box to the Building Zed for Linux page. It doesn't mention Mold at all, and most people probably don't have it so I think almost everyone would run into this?

Apart from that it built perfectly! Took a while, but nothing crazy considering how big of a project it is.

@notpeter
Copy link
Member

notpeter commented Nov 26, 2024

  1. Happy to accept PRs to make script/linux work on RHEL 8.x
  2. Yeah, I believe our build scripts now require mold. Looks like script/linux should've outputted something if mold was unavailable:

    zed/script/linux

    Lines 11 to 20 in 489900e

    function finalize {
    # after packages install (curl, etc), get the rust toolchain
    which rustup > /dev/null 2>&1 || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
    # verify the mold situation
    if ! command -v mold >/dev/null 2>&1; then
    echo "Warning: Mold binaries are unavailable on your system." >&2
    echo " Builds will be slower without mold. Try: script/install-mold" >&2
    fi
    echo "Finished installing Linux dependencies with script/linux"
    }

    Perhaps that message should more explicitly say "ERROR" not "WARNING".

We have a dedicated script for installing mold, crazily named script/install-mold. I have been hesitant to call this by default from script/linux since it just downloads a binary from github releases and plops it in /usr/local/bin/mold -- since everything else in script/linux only downloads official distribution packages, I'd rather be a good houseguest and only plop binaries in /usr/local/bin when explicitly asked to. Similar problems occur with very old distros and cmake versions, see also script/install-cmake.

Anyways, happy to review PRs to improve this process or documentation. I did my best, but without a RHEL 8.x license I can only test on clones (Rocky, Alma, etc) which only goes so far. Thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants