You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cargo_bin.bbclass forces CARGO_HOME to be a subdirectory of the recipe's WORKDIR
# Move CARGO_HOME from default of ~/.cargo
export CARGO_HOME = "${WORKDIR}/cargo_home"
the result is that every recipe has its own set of downloaded crates resulting in a lot of duplicate network traffic. As indicated in the comment, a common shared ~/.cargo directory is the Rust default.
IMO for building with Yocto, CARGO_HOME should be similar to DL_DIR and SSTATE_DIR, which are subdirectories of ${TOPDIR} by default, but can be changed by specifying an alternate directory in the local.conf file.
For my use case, release builds are performed using a large, but volatile TMPDIR from which only a select few files from tmp/deploy are made available before the volume is deleted. To minimize the build time and network activity, the build uses custom DL_DIR and SSTATE_DIR on a reasonably small volume that persists its contents between builds. I'd like CARGO_HOME to be a subdirectory of ${DL_DIR} (no changes for me) or a subdirectory of ${TOPDIR} (a trivial line added to local.conf). However once CARGO_HOME can be customized, the default value is no longer critical for me, other than my desire to remain relatively close to standard usage.
Can the following be used in cargo_bin.bbclass to permit my use case?
# Move CARGO_HOME from default of ~/.cargo
CARGO_HOME ?= "${DL_DIR}/cargo_home"
export CARGO_HOME
I'm not positive, but I believe Yocto will automatically create DL_DIR and SSTATE_DIR when they are the default directories in ${TMPDIR}, but require me to create my custom out-of-tree directories. So if CARGO_HOME is not in the TMPDIR tree there may be a potential issue with the command
mkdir -p "${CARGO_HOME}"
The text was updated successfully, but these errors were encountered:
The cargo_bin.bbclass forces
CARGO_HOME
to be a subdirectory of the recipe'sWORKDIR
the result is that every recipe has its own set of downloaded crates resulting in a lot of duplicate network traffic. As indicated in the comment, a common shared
~/.cargo
directory is the Rust default.IMO for building with Yocto,
CARGO_HOME
should be similar toDL_DIR
andSSTATE_DIR
, which are subdirectories of${TOPDIR}
by default, but can be changed by specifying an alternate directory in the local.conf file.For my use case, release builds are performed using a large, but volatile
TMPDIR
from which only a select few files fromtmp/deploy
are made available before the volume is deleted. To minimize the build time and network activity, the build uses customDL_DIR
andSSTATE_DIR
on a reasonably small volume that persists its contents between builds. I'd likeCARGO_HOME
to be a subdirectory of${DL_DIR}
(no changes for me) or a subdirectory of${TOPDIR}
(a trivial line added tolocal.conf
). However onceCARGO_HOME
can be customized, the default value is no longer critical for me, other than my desire to remain relatively close to standard usage.Can the following be used in
cargo_bin.bbclass
to permit my use case?I'm not positive, but I believe Yocto will automatically create
DL_DIR
andSSTATE_DIR
when they are the default directories in${TMPDIR}
, but require me to create my custom out-of-tree directories. So ifCARGO_HOME
is not in theTMPDIR
tree there may be a potential issue with the commandThe text was updated successfully, but these errors were encountered: