vp-build/common/build-style/cargo.sh
Johannes a2be11a086 build-style/cargo.sh: run cargo install with --locked
Without --locked, cargo ignores the Cargo.lock file during install
and rebuilds the crate with updated dependencies.
This wastes time and makes builds unreproducable.
2019-09-26 15:11:46 +02:00

24 lines
461 B
Bash

#
# This helper is for building rust projects which use cargo for building
#
do_build() {
: ${make_cmd:=cargo}
${make_cmd} build --release --target ${RUST_TARGET} ${configure_args}
}
do_check() {
: ${make_cmd:=cargo}
${make_cmd} test --release ${make_check_args}
}
do_install() {
: ${make_cmd:=cargo}
${make_cmd} install --path . --target ${RUST_TARGET} --root="${DESTDIR}/usr" \
--locked ${make_install_args}
rm "${DESTDIR}"/usr/.crates.toml
}