Rust error: failed to download llvm from ci

Hello All!

I've been working, for quite some time now, on a custom release of OpenWRT for a board based on Mips MT7628 processor. I already use BuildRoot for other
embedded projects, so the transition to OpenWRT build environment was not a problem.

Recently, trying to build my image, I got the following error:

downloading https://ci-artifacts.rust-lang.org/rustc-builds/eeb90cda1969383f56a2637cbd3037bdf598841c/rust-dev-1.81.0-x86_64-unknown-linux-gnu.tar.xz curl: (22) The requested URL returned error: 404

ERROR: failed to download llvm from ci

HELP: There could be two reasons behind this:
    1) The host triple is not supported for `download-ci-llvm`.
    2) Old builds get deleted after a certain time.
HELP: In either case, disable `download-ci-llvm` in your config.toml:

[llvm]
download-ci-llvm = false

Build completed unsuccessfully in 0:00:49

Reading rust's documents and forum, I understood that from times to times
old builds of the llvm package get deleted. The error message also explains that and even suggests to disable the download of the llvm, forcing it to be built locally.

I have a few options on hand...

1 - change feeds/packages/lang/rust/Makefile and set llvm.download-ci-llvm to false, forcing llvm to be built locally and keep rust in version 1.81.0; or

2 - change feeds/packages/lang/rust/Makefile and set PKG_VERSION to 1.82.0 making sure to also provide a new PKG_HASH, so use a more recent version of rust with the llvm downloaded from a more recent build; or

3 - wait for the rust version get updated in the openwrt-23.05 branch.

Which is the normal or "right" way here, if I want to update Rust's version?
I change rust Makefile, commit the changes to OpenWRT and create a new Pull Request?
If so, how can I provide tests to guarantee that an updated rust version won't break anything else? Should I provide these tests?

I can automate the build process, using custom Makefiles, that can change OpenWRT files locally. Is this a common thing? Can it be done this way or should I avoid doing so?

Any suggestions and instructions are appreciated...

Regards.
C-Scherma.

1 Like

Number 3 will not happen.

Can you repeat your problem on a clean openwrt checkout switched to 23.05?

Shure!

Just built on a clean checkout on branch openwrt-23.05, but the result is the same.

I used the Debian docker container to build the image. https://openwrt.org/_export/code/docs/guide-user/virtualization/obtain.firmware.docker?codeblock=1

Here are the steps that I did to reproduce the error:

git clone https://git.openwrt.org/openwrt/openwrt.git

cd openwrt
ls -al
git checkout openwrt-23.05
cat feeds.conf.default
cat feeds.conf.default > feeds.conf
docker compose run --rm cont_openwrt bash

$ from the container

cd openwrt/
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig # Selected the Mediatek Mips as Target System and Rust under languages, generates .config file.
nproc
make -j17 download
make -j17 tools/install
make -j17 toolchain/install
make -j17 package/rust/host/compile V=s
...
...
...
   Compiling build_helper v0.1.0 (/workdir/openwrt/build_dir/target-mipsel_24kc_musl/host/rustc-1.81.0-src/src/tools/build_helper)
   Compiling xz2 v0.1.7
    Finished `dev` profile [unoptimized] target(s) in 13.06s
WARNING: The `change-id` is missing in the `config.toml`. This means that you will not be able to track the major changes made to the bootstrap configurations.
NOTE: to silence this warning, add `change-id = 127866` at the top of `config.toml`
downloading https://ci-artifacts.rust-lang.org/rustc-builds/eeb90cda1969383f56a2637cbd3037bdf598841c/rust-dev-1.81.0-x86_64-unknown-linux-gnu.tar.xz
curl: (22) The requested URL returned error: 404

ERROR: failed to download llvm from ci

    HELP: There could be two reasons behind this:
        1) The host triple is not supported for `download-ci-llvm`.
        2) Old builds get deleted after a certain time.
    HELP: In either case, disable `download-ci-llvm` in your config.toml:

    [llvm]
    download-ci-llvm = false

Build completed unsuccessfully in 0:00:23
make[2]: *** [Makefile:109: /workdir/openwrt/build_dir/target-mipsel_24kc_musl/host/rustc-1.81.0-src/.built] Error 1
make[2]: Leaving directory '/workdir/openwrt/feeds/packages/lang/rust'
time: package/feeds/packages/rust/host-compile#72.00#11.28#29.89
    ERROR: package/feeds/packages/rust [host] failed to build.
make[1]: *** [package/Makefile:127: package/feeds/packages/rust/host/compile] Error 1
make[1]: Leaving directory '/workdir/openwrt'
make: *** [/workdir/openwrt/include/toplevel.mk:233: package/rust/host/compile] Error 2

I’ve run into this exact problem trying to build v24.10.2, did you ever find a solution?

Edit: see also: https://github.com/openwrt/packages/issues/27331

The solution for me was to disable llvm download and let it be built locally. Later the maintainers disabled it in the build files, see: https://git.openwrt.org/?p=feed/packages.git;a=commit;h=b49fb106108abe21eba3c552d66c8a373dce6190

For 24.10 I could not find any commit disabling the llvm download, so I think it is enabled and the llvm pre-built packages for rust version 1.87 are no longer available. I’m not working with 24.10, so I can’t be shure of this.

For now I suggest you to disable the llvm download, editing rust language Makefile on: openwrt/feeds/packages/lang/rust/Makefile, and change the line where it says: --set=llvm.download-ci-llvm=true, to --set=llvm.download-ci-llvm=false

Before building again, make a clean of the rust build with: make package/rust/host/clean V=s.
Then compile everything again, letting rust build the llvm locally. It will take much longer to build. I recommend you to use the flags V=s on the compile command so you can have some feedback from the build process.

1 Like

Thanks so much for the help! I resorted to building 24.10 snapshot (?) / latest, but this will help me to build the latest stable tag.