Disable clang version pinning #131

Closed
opened 2024-08-04 20:15:02 +01:00 by alerque · 4 comments

I just setup an AUR package for git-next. In the process I had some trouble with dependencies because the build system used a hard coded clang version. I suspect this was done because at some point the project needed at least clang-16. The trouble is that isn't the current version any more, and Arch Linux comes with clang-18 out of the box.

I did a bit of hacking and just ripped out the hard coded value with s/clang-16/clang/g and the build worked fine. I would suggest doing this a the project level so folks with things newer than the minimum supported version can just get on with their lives without the hassle. A note about needing a minimum of clang-16 in the docs is probably enough.

I just setup an [AUR package for `git-next`](https://aur.archlinux.org/packages/git-next). In the process I had some trouble with dependencies because the build system used a hard coded clang version. I suspect this was done because at some point the project needed *at least* clang-16. The trouble is that isn't the current version any more, and Arch Linux comes with clang-18 out of the box. I did a bit of hacking and just ripped out the hard coded value with `s/clang-16/clang/g` and the build worked fine. I would suggest doing this a the project level so folks with things newer than the minimum supported version can just get on with their lives without the hassle. A note about needing a minimum of clang-16 in the docs is probably enough.
Owner

The clang is only there to improve compile-time speed. I'll have a proper read through your investigation when I'm back at the computer.

Thanks for your feedback. I hope you find git-next useful.

The clang is only there to improve compile-time speed. I'll have a proper read through your investigation when I'm back at the computer. Thanks for your feedback. I hope you find `git-next` useful.
Author

The clang is only there to improve compile-time speed.

I understand that is a possible motivation, but that's now what your code does. The way it is now the project will not compile at all on a system without clang-16. You have hard coded the linker such that anybody doing an x86-64 build must do so with a specific (outdated) version of clang.

> The clang is only there to improve compile-time speed. I understand that is a possible motivation, but that's now what your code does. The way it is now the project will not compile at all on a system without `clang-16`. You have hard coded the linker such that anybody doing an x86-64 build must do so with a specific (outdated) version of clang.
Author

I just looked at your changeset and pulling it out of .cargo/config.toml seems like the right move, but if you still want the speed boost in Docker where you control the environment you can set those things in the $HOME/.cargo/config.toml file for the user (this is what I do on my bare metal host system to get clang/mold by default for all Rust work).

I just looked at your changeset and pulling it out of `.cargo/config.toml` seems like the right move, but if you still want the speed boost in Docker where you control the environment you can set those things in the `$HOME/.cargo/config.toml` file for the user (this is what I do on my bare metal host system to get clang/mold by default for all Rust work).
Owner

The speed difference for building from clean was only a little over 2 seconds. I'll reconsider the docker build. But not today, now I sleep. 😴

Thanks for creating the AUR.

The speed difference for building from clean was only a little over 2 seconds. I'll reconsider the docker build. But not today, now I sleep. 😴 Thanks for creating the AUR.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: kemitix/git-next#131
No description provided.