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
This change adds support for a new environment variable,
CARGO_TARGET_DIR_PREFIX, to cargo. This variable, when set, is treated
as a prefix to the target directory.
Note that support for the functionality behind this variable is not
trivial to implement with the current design. In particular, we wanted
to stick as close to the existing CARGO_TARGET_DIR logic. However, the
Config in which it is implemented really does not know anything about
the directory of the particular crate we concerned with. As a quick work
around to this problem, we just pass in the path to the Cargo.toml from
the "upper layer". That works, but ultimately it would be better to make
the other layer handle the CARGO_TARGET_DIR_PREFIX logic.
This change addresses rust-lang#5544.
TODO: Definitely not finished. This patch needs more tests and may need
additional config.toml support (?).
TODO: There is also the potential for a permission related problems.
E.g., when user root compiles something below /tmp/ and then user
nobody tries to do the same the resulting directory
${CARGO_TARGET_DIR_PREFIX}/tmp/ may be owned by root, causing the
build for nobody to fail with a permission denied error.
0 commit comments