Closed mateodif closed 4 months ago
Here is an excerpt from my conversation with @jeaye. If your goal is to contribute to jank's compiler/runtime and not care strongly about running it on Arch, give distrobox
a try.
So, I just saw this recently on my Arch distrobox as well. Unfortunately, there's no way around it right now. The problem is this: Cling is stuck using LLVM 13, which has some C++20 support. We're using that C++20 support by enabling -std=gnu++20 (gnu++20 vs c++20 grants us GNU extensions too).
HOWEVER, the latest
GCC (pacman package gcc-libs) versions (14+)
on Arch use a bunch of new C++20 features which Cling's old LLVM 13 just can't handle. But it's all still technically C++20. This leaves us with only two choices.
- Stop using C++20 in jank, since we don't actually have good support for it on LLVM 13
- Stop using Arch, since its C++20 headers are living too far in the future
We rely heavily on C++20 features, at this point. In particular, concepts. That's not something I can remove reasonably. So I changed my Arch distrobox to an
Ubuntu 24.04 distrobox
today and everything's back to working normally. But this will ultimately break when Ubuntu gets onto GCC 14.This is yet another reason why we need to get off of Cling and onto upstream LLVM.
I also tried downgrading gcc-libs and relevant packages, but a whole bunch of other system packages rely on that and I broke everything and got my Arch into a state where even pacman didn't work. I had to manually untar the package files in my system in order to get things working again... so don't try that.
If you're not using distrobox already, definitely give it a go.
distrobox create --image ubuntu:24.04 jank
Then just distrobox enter jank whenever you want to develop. It'll keep you in the same directory with your same shell.
The doc/build.md file in the jank repo has the Ubuntu deps needed. Just copy/paste that guy in once you're in your distrobox. They're persistent, so you only need to do that once.
Hey Mateo! Thanks for reporting. Thanks, Saket, for jumping in as well. As Saket said, jank can't build under Arch right now, due to Arch using a GCC version which is too shiny for Cling. This will be resolved once I can finish the migration to Clang 19 (blocked on a Clang bug right now).
Using libc++ (instead of libstdc++) isn't going to work unless you recompile ALL jank dependencies (include Cling/Clang/LLVM) using libc++. In my experience, this isn't feasible.
So, using distrobox, as Saket said I said, is the way forward for now! I'll leave this issue open until jank has finished the migration to Clang 19.
This issue should be resolved, since the port to Clang 19 has been merged! Please delete (or back up) your build
directories and go through the build.md
doc again. If you hit any issues, let me know.
Hello :) I'm trying to get jank to compile under Arch Linux and I'm having some issues.
First, I had to change add back some flags (lines 81 and 86 of
CMakeLists.txt
) in order to use LLVM's C++ stdlib since I was facing issues during compilation with GCC's stdlib.After this change I'm able to successfully compile
jank
, but I'm facing an error while linking:At this point, I'm out of ideas. Not sure how to proceed. Eventually, I would like to publish a package to the Arch User Repository in order to make trying out jank easier :)