Fix the two most common causes of CI build failures
Currently it appears that all CI builds are failing due to two dependency issues:
Case 1: Fails due to xargo installed by cargo newer than locked version specified in mk/depends.mk
XARGO_VERSION=0.3.20 (from mk/depends.mk:16)
Finished release [optimized] target(s) in 4m 22s Installing /root/.cargo/bin/xargo Installing /root/.cargo/bin/xargo-check Installed package `xargo v0.3.21` (executables `xargo`, `xargo-check`) Summary Successfully installed cargo-config, cargo-xbuild, xargo! mk/depends.mk:18: *** xargo 0.3.20 not found, run "cargo install --force --version 0.3.20 xargo". Stop. ERROR: Job failed: exit code 1
Case 2: Fails to install cargo-xbuild because it's asking for the xargo version of cargo-xbuild i.e. 0.3.20
Finished release [optimized] target(s) in 41.33s Installing /root/.cargo/bin/cargo-config Installed package `cargo-config v0.1.1` (executable `cargo-config`) Updating crates.io index error: could not find `cargo-xbuild` in registry `https://github.com/rust-lang/crates.io-index` with version `=0.3.20` ERROR: Job failed: exit code 101
These errors should be easy to remedy by fixing a few mistakes in the .gitlab-ci.yml for this repo
img: script: - | source "$HOME/.cargo/env" && cargo install --version 0.1.1 cargo-config && cargo install --version 0.3.20 cargo-xbuild && cargo install xargo && make ci-img IMG_TAG=$CI_COMMIT_REF_NAME artifacts: paths: - build/img/ expire_in: 1 week
Currently the script is trying to
cargo install --version 0.3.20 cargo-xbuild, cargo-xbuild has been on version 0.5.x since 2018, whereas the very latest currently available version of xargo is 0.3.21. I think this is a matter of a simple typo. To fix this I would recommend modifying the .gitlab-ci.yml for this repo to:
img: script: - | source "$HOME/.cargo/env" && cargo install --version 0.1.1 cargo-config && cargo install cargo-xbuild && cargo install --version 0.3.20 xargo && make ci-img IMG_TAG=$CI_COMMIT_REF_NAME artifacts: paths: - build/img/ expire_in: 1 week
Unless there is a specific version of cargo-xbuild that is required, but I have searched the repo and been unable to find a reference to cargo-xbuild other than in the .gitlab-ci.yml.
I look forward to seeing CI builds start to pass, because right now they aren't helpful as it appears that they all fail on this minor typo.