mirror of
https://git.yoctoproject.org/poky
synced 2026-04-20 18:32:12 +02:00
cargo: Add CARGO_LOCK_PATH for path to Cargo.lock
When building a workspace enabled project, the Cargo.lock is found at the root of the project, not alongside the Cargo.toml. Expose CARGO_LOCK_PATH so it can be explicitly configured. (From OE-Core rev: 30159f88a97c73d234f69c5800ba2adb0e26ad44) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
dddfe1e3f4
commit
6543d3c5e9
@@ -40,6 +40,9 @@ CARGO_SRC_DIR ??= ""
|
||||
# The actual path to the Cargo.toml
|
||||
CARGO_MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml"
|
||||
|
||||
# Path to Cargo.lock
|
||||
CARGO_LOCK_PATH ??= "${@ os.path.join(os.path.dirname(d.getVar('CARGO_MANIFEST_PATH', True)), 'Cargo.lock')}"
|
||||
|
||||
CARGO_RUST_TARGET_CCLD ??= "${RUST_TARGET_CCLD}"
|
||||
cargo_common_do_configure () {
|
||||
mkdir -p ${CARGO_HOME}/bitbake
|
||||
@@ -168,8 +171,7 @@ python cargo_common_do_patch_paths() {
|
||||
# here is better than letting cargo tell (in case the file is missing)
|
||||
# "Cargo.lock should be modified but --frozen was given"
|
||||
|
||||
manifest_path = d.getVar("CARGO_MANIFEST_PATH", True)
|
||||
lockfile = os.path.join(os.path.dirname(manifest_path), "Cargo.lock")
|
||||
lockfile = d.getVar("CARGO_LOCK_PATH", True)
|
||||
if not os.path.exists(lockfile):
|
||||
bb.fatal(f"{lockfile} file doesn't exist")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user