Skip to content

Commit 355a325

Browse files
Merge #900
900: Enable skipping of copying build artifacts back to host. r=Emilgardis a=Alexhuszagh If using remote docker but primarily wishing to build or test your builds remotely, without caring about the generated artifacts, the time required to copy the generated artifacts over a network connection can be prohibitive. Setting `CROSS_REMOTE_SKIP_BUILD_ARTIFACTS=1` will disable copying these build artifacts back to the host, for faster build times with remote container engines. Co-authored-by: Alex Huszagh <ahuszagh@gmail.com>
2 parents 5bb63ae + 54d41d3 commit 355a325

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Added
1111

12+
- #900 - add the option to skip copying build artifacts back to host when using remote cross via `CROSS_REMOTE_SKIP_BUILD_ARTIFACTS`.
1213
- #891 - support custom user namespace overrides by setting the `CROSS_CONTAINER_USER_NAMESPACE` environment variable.
1314
- #890 - support rootless docker via the `CROSS_ROOTLESS_CONTAINER_ENGINE` environment variable.
1415

src/docker/remote.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,10 @@ symlink_recurse \"${{prefix}}\"
10551055

10561056
// 7. copy data from our target dir back to host
10571057
// this might not exist if we ran `clean`.
1058-
if container_path_exists(engine, &container, &target_dir, msg_info)? {
1058+
let skip_artifacts = env::var("CROSS_REMOTE_SKIP_BUILD_ARTIFACTS")
1059+
.map(|s| bool_from_envvar(&s))
1060+
.unwrap_or_default();
1061+
if !skip_artifacts && container_path_exists(engine, &container, &target_dir, msg_info)? {
10591062
subcommand(engine, "cp")
10601063
.arg("-a")
10611064
.arg(&format!("{container}:{}", target_dir.as_posix()?))

0 commit comments

Comments
 (0)