Skip to content

Commit

Permalink
Try #661:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Mar 17, 2022
2 parents 762f0f0 + d837e8e commit fd607c4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- #661 - Panic when image does not exist and running on CI or with `CROSS_FORCE_IMAGE=1`
- #658 - Upgrade dependencies
- #647 - Add `mips64-unknown-linux-muslabi64` and `mips64el-unknown-linux-muslabi64` support
- #652 - Allow trying individual targets via bors.
Expand Down
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ edition = "2018"
atty = "0.2"
error-chain = "0.12"
home = "0.5"
is_ci = "1"
lazy_static = "1.0"
libc = "0.2.104"
rustc_version = "0.4"
Expand Down
5 changes: 5 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub struct Args {
pub target: Option<Target>,
pub target_dir: Option<PathBuf>,
pub docker_in_docker: bool,
pub force_image: bool,
}

pub fn parse(target_list: &TargetList) -> Args {
Expand Down Expand Up @@ -65,6 +66,9 @@ pub fn parse(target_list: &TargetList) -> Args {
let docker_in_docker = env::var("CROSS_DOCKER_IN_DOCKER")
.map(|s| bool::from_str(&s).unwrap_or_default())
.unwrap_or_default();
let force_image = env::var("CROSS_FORCE_IMAGE")
.map(|s| bool::from_str(&s).unwrap_or_default())
.unwrap_or_default();

Args {
all,
Expand All @@ -73,5 +77,6 @@ pub fn parse(target_list: &TargetList) -> Args {
target,
target_dir,
docker_in_docker,
force_image,
}
}
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ fn run() -> Result<ExitStatus> {

let image_exists = match docker::image(&config, &target) {
Ok(_) => true,
Err(err) if is_ci::uncached() || args.force_image => {
return Err(err).map_err(Into::into)
}
Err(err) => {
eprintln!("Warning: {} Falling back to `cargo` on the host.", err);
false
Expand Down

0 comments on commit fd607c4

Please sign in to comment.