Skip to content

Conversation

@workingjubilee
Copy link

@workingjubilee workingjubilee commented May 31, 2025

Maintainer: @lu-zero
Compile tested: None
Run tested: None

Description: Using the download-ci-llvm flag that is offered by rust-lang/rust's bootstrap process can accelerate builds in local development but will break in CI if the version of rustc is not kept in tight lockstep with upstream's rustc. It also depends on a number of assumptions that hinge on having a git-maintained repo instead of e.g. a tarball, and can induce breakage from that as well. Avoid future breakage by ceasing to use it.

Fixes: #26623

@workingjubilee
Copy link
Author

This is an alternative to #26643 which will patch out the undesired behavior at the cost of exposing OpenWRT packages to breakage, especially if reused in other distros.

@lu-zero
Copy link
Contributor

lu-zero commented May 31, 2025

I expect somebody complaining about long build times :/

@workingjubilee
Copy link
Author

workingjubilee commented May 31, 2025

You can add this to the bootstrap.toml:

[target.x86_64-unknown-linux-gnu]
llvm-config = "/path/to/llvm-config"

with the obvious caveat of the path being whatever

We support the current LLVM and LLVM-1 with our rustc precisely so that distros can reuse their LLVMs.

@lu-zero
Copy link
Contributor

lu-zero commented May 31, 2025

in the long run I hope we'll be able to use it.

@workingjubilee
Copy link
Author

We are probably happy to work with you on other solutions for improving distro build times if reusing your distro's LLVM is not adequate. But as things currently stand, I don't think you want to be using our CI-cached LLVMs because it's kinda just tempting fate. Right now we simply are not even thinking about the possibility of a downstream using it. So I think this patch is still more correct even if you want other things now or in the future.

@lu-zero
Copy link
Contributor

lu-zero commented May 31, 2025

I agree in principle, just that if somebody came up with using the ci-cache, I'm sure they will complain now ^^;

@workingjubilee
Copy link
Author

It was added in #20686 to get around properly integrating OpenWRT's LLVM into the rustc build with the necessary flags and error handling to have a desirable experience.

You can land quick hacks as you may, but eventually the piper comes calling.

@smallprogram
Copy link

After testing, the compilation time increased exponentially. This is a nightmare for Github action.

@workingjubilee
Copy link
Author

You seem to have an LLVM in your base image but it isn't being reused for rustc.

@workingjubilee
Copy link
Author

workingjubilee commented Jun 1, 2025

Where does llvm-config get installed to? "/usr/bin/llvm-config"?

@smallprogram
Copy link

Where does llvm-config get installed to? "/usr/bin/llvm-config"?

From the ubuntu-latest image of github action, there is no llvm-config file in the /usr/bin/ directory, only these three files: /usr/bin/llvm-config-18
/usr/bin/llvm-config-17
/usr/bin/llvm-config-16

@workingjubilee
Copy link
Author

Hrm? I meant the OpenWRT repo? Do you not have a prebuilt image of that?

@lu-zero
Copy link
Contributor

lu-zero commented Jun 1, 2025

Keep in mind that in OpenWRT llvm is basically just used for the eBPF support and it is quite optional ^^;

@rockdrilla
Copy link
Contributor

Despite being used in a quite few packages OpenWrt's LLVM builds a LOT of time. 😆

@BKPepe
Copy link
Member

BKPepe commented Jun 7, 2025

@workingjubilee Would it be possible to look at the failing check about formalities, please? :)

@1715173329
Copy link
Member

Kind ping.

@lu-zero
Copy link
Contributor

lu-zero commented Jun 23, 2025

@1715173329 shall we bite the bullet and rework the llvm support so we can lean on it?

@1715173329
Copy link
Member

shall we bite the bullet and rework the llvm support so we can lean on it?

Hmmm sorry for my poor English. Do you mean make use of the llvm toolchain on the host, or from the llvm-bpf package, or something else?

@lu-zero
Copy link
Contributor

lu-zero commented Jun 23, 2025

Something that can be done is to have an llvm build that covers host, target and bpf as part of the toolchain, then use it to build rust and any other package that can use the llvm provided.

@1715173329
Copy link
Member

Something that can be done is to have an llvm build that covers host, target and bpf as part of the toolchain, then use it to build rust and any other package that can use the llvm provided.

That sounds good. Cc @dangowrt

gsanchietti added a commit to NethServer/nethsecurity that referenced this pull request Aug 19, 2025
Paramiko requies rust.
But the rust build is broken on upstream: openwrt/packages#26644
gsanchietti added a commit to NethServer/nethsecurity that referenced this pull request Aug 19, 2025
Paramiko requies rust.
But the rust build is broken on upstream: openwrt/packages#26644
gsanchietti added a commit to NethServer/nethsecurity that referenced this pull request Aug 19, 2025
Paramiko requies rust.
But the rust build is broken on upstream: openwrt/packages#26644
@BKPepe BKPepe force-pushed the download-llvm-ci-false branch from ddaeda2 to 23b7a04 Compare January 6, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust 1.87.0 compile error llvm.download-ci-llvm cannot be set to true

6 participants