Skip to content

Commit 653bf62

Browse files
authored
Merge pull request #28 from rust-embedded/fix-caching-issues
Fix caching issues
2 parents 481b1a6 + 30ff1e7 commit 653bf62

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

classes/rust-common.bbclass

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ def rust_target(d, spec_type):
88
arch = d.getVar('%s_ARCH' % spec_type, True)
99
os = d.getVar('%s_OS' % spec_type, True)
1010

11+
# Make sure that tasks properly recalculate after ARCH or OS change
12+
d.appendVarFlag("rust_target", "vardeps", " %s_ARCH" % spec_type)
13+
d.appendVarFlag("rust_target", "vardeps", " %s_OS" % spec_type)
14+
1115
# Sometimes bitbake mixes the calling convention into the OS, sometimes it
1216
# doesn't... let's just take the first part
1317
os = os.split('-')[0]

recipes-devtools/rust/cargo-bin-cross.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ python () {
3636
(cargo_url(target), cargo_md5(target), cargo_sha256(target),
3737
d.getVar("PN", True) + "-" + pv + "-" + target + ".tar.gz"))
3838
src_uri = d.getVar("SRC_URI", True).split()
39+
cargo_extract_path = cargo_url(target).split('/')[-1].replace('.tar.gz', '')
3940
d.setVar("SRC_URI", ' '.join(src_uri + [cargo_uri]))
40-
d.setVar("S", "{}/{}".format(d.getVar("WORKDIR", True), cargo_url(target).split('/')[-1].replace('.tar.gz', '')))
41+
d.setVar("S", "${{WORKDIR}}/{}".format(cargo_extract_path))
42+
d.appendVarFlag("S", "vardeps", " cargo_url")
43+
d.appendVarFlag("S", "vardepsexclude", " WORKDIR")
4144
}

recipes-devtools/rust/rust-bin-cross.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ RUST_ALL_TARGETS = "${RUST_BUILD_TARGET} ${RUST_TARGET_TARGET} ${EXTRA_RUST_TARG
2222

2323
S = "${WORKDIR}/rustc-${PV}-${RUST_BUILD_TARGET}"
2424

25+
# Relocating WORKDIR doesn't matter to installer
26+
S[vardepsexclude] += "WORKDIR"
27+
2528
SYSROOT_DIRS_NATIVE += "${prefix}"
2629
SYSROOT_DIRS_BLACKLIST += "\
2730
${prefix}/share \

0 commit comments

Comments
 (0)