It never ends… it never ends!!
In other news I've found a very interesting bug in the zig cmake scripts :(
Oh cripes it just installs under the executable name clang-22
@mcc do they at least make ‘clang’ a symlink so you could theoretically change it? Or is this some kind of “some clangs are more default than others” type situation?
Okay so it appears the debian equivalent of xcode-select is `update-alternatives`
This is…
This is not user friendly.
I do not know which key to set to change my clang. I don't know how to get it to list all keys. I can tell it to run with --all, and then it has me re-assign every executable on the computer, beginning with `animate`. This is scary and I bailed.
I have filed an issue / support request on zig at https://codeberg.org/ziglang/zig/issues/37729 . Hopefully they don't mind support requests in the issues
@mcc My usual sledgehammer approach, where it's possible, is to uninstall all the other packages (eg clang-19) - which should (if the packages are created right, they're not always) make the one remaining clang the default. Then reinstall the other clang packages if needed (this should not change the default).
This obviously has a number of failure modes, so isn't always possible!
@mal3aby I don't want to alter the behavior of my system just for zig tho
@mcc Ah, sorry, maybe I misunderstood - I thought you wanted to make bare "clang" point to "clang-22" rather than "clang-19"?
@mal3aby sorry— early on, I thought that were one thing that might fix my problem. So it's a thing I was trying to figure out how to do, but it wasn't what I want permanently
@mcc I think in this case the Debian equivalent of xcode-select is update-alternatives, if /usr/bin/clang is a symlink to the actual /usr/bin/clang-nn executable then update-alternatives is how you would update it to point to the version you want.
@mcc does Debian still use /etc/alternatives and update-alternatives ?
@mcc This is exactly the problem that is solved with containerized development environments. Unless you really don't like containerization. Then it doesn't help at all.
@mcc I think you set `CC=clang-22` and something similar for CXX in your environment variables.
@mcc because LLVM is too cool for¹ pkgconf what you're likely after is setting the LLVM_CONFIG environment variable to point at your llvm-config-22 binary (it's probably /usr/bin/llvm-config-22?).
This should get whatever build system you care about to get its LLVM configuration from the -22 toolchain.
You might need the llvm-22-dev package installed to get that binary? apt-file search llvm-config-22 will tell you what package you're after.
¹: or, rather more charitably, is used on lots of platforms, on only one of which is pkgconf the universal choice for this sort of thing
@RAOF hi, thanks. It gets a little more complicated later in the thread and I posted an issue with much detail. They need all three of llvm, clang (and not just the executable—they need libclang, they need the library, they need the headers) and ldd. They have written their own cmake find_package implementations for clang and ldd. Currently it appears they find llvm successfully, their clang find only half works, and ldd find fails catastrophically and silently (but I don't reach link so whatev)
@RAOF I'm not sure but I **think** they're assuming a clang installation lays out its files in a certain way on disk, but Debian has a slightly different directory layout, and Debian assumes this is safe because there is some way of discovering the directory layout once you know where anything is but instead their excessively-homerolled cmake scripts just assume things. I think.
@mcc
I am mad at CMake, too, but not over LLVM.
It isn't finding OpenGL/glx when I build gogglesmm, but it does when I build the fox gui toolkit for gogglesmm 😭
Yours sounds much harder
@mcc I’m just curious, why build from source and not just download the Linux binary release and put it in your PATH?
Are you wanting to modify/hack on the compiler itself? Or are there other motivations I don’t understand?
@SilbinaryWolf The download instructions say "there may be a package for your Linux distribution". There is not. In my experience, generic binary packages for Linux which are not targeted to a particular distribution and not using "container" formats such as docker or flatpak are flaky. By contrast, the build looked like a straightforward cmake build and I did not anticipate problems.
Additionally, at some later date I may hack on the compiler.
@SilbinaryWolf Wait, hold on. I thought you were responding to a later post in the thread. Are you talking about LLVM or Zig?
@mcc Oh I meant Zig itself, but I mean I get what you’re saying I think.
After 1.5 years of using Linux, Im shocked when non package managed binary or AppImage works and doesn’t fall over due to a glibc incompatibility or missing shared object
Hey question. Debian has a clang-18, a clang-19, and a clang-22 package in apt. If I run sudo apt-install clang-22, then open a new shell, then type clang --version, it's a clang 19. How can I get a shell with clang-22, and/or is there a way to tell cmake "I've got a clang-19 and a clang-22, use the clang-22"? How do I xcode-select in Linux