Rust-lang: Reusing compiled toolchain - Package devs

I'm getting towards the end of the initial integration of rust-lang into the OpenWrt build-system.

During the initial compile, I generate installation distribution files split by arch, making it modular. The goal is to either allow the build-bots compile the toolchains for use, or at the very least, allow the build-system to reuse the already, previously compiled archives.

23392012 Apr  5 06:45 rust-1.59.0-mips64-openwrt-linux-musl-install.tar.xz
120224492 Apr  5 06:46 rust-1.59.0-x86_64-unknown-linux-gnu-install.tar.xz
115459508 Apr  3 03:41 rust-1.59.0.tar.xz

The installation is already done via:

define Host/Install

        cd $(RUST_TMP_DIR) && \
          find -iname "*.xz" -exec tar -xJf {} ";" && \
          find ./* -type f -name -execdir sh {} --prefix=$(CARGO_HOME) --disable-ldconfig \;

Original concern about pre-compiled installation toolchains are alleviated because these are compiled from source.

I want to find a way to identify whether the toolchains for the $(RUST_INSTALL_HOST_FILENAME) and/or $(RUST_INSTALL_TARGET_FILENAME) already exist. If not, call the compile to build them. If so, validate (via sha256sum functions in include/ Storing them in a .mk file to check against?) and if they match, roll them out rather than compiling.

This will not only setup the ability down the line to pull down the toolchains remotely (if it ever is considered viable), but if not/until then, would cut future toolchain use after the first compile to nearly nothing (rather than the 2-4 hours it currently takes per build when targets change).