From 838339ef7e577dc7447209017729e9f5dc4b650d Mon Sep 17 00:00:00 2001 From: Benjamin Fry Date: Thu, 24 Oct 2019 19:50:53 -0700 Subject: [PATCH] dont require frozen or locked cargo and work offline --- integration-tests/src/lib.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs index 2242426a..4eb4a622 100644 --- a/integration-tests/src/lib.rs +++ b/integration-tests/src/lib.rs @@ -11,9 +11,16 @@ use cargo::core::compiler::{Compilation, CompileMode}; use cargo::util::errors::CargoResult; use postgres::Connection; +fn configure_cargo() -> CargoResult { + let mut cfg = cargo::util::config::Config::default()?; + cfg.configure(0, None, &None, false, false, true, &None, &[])?; + + Ok(cfg) +} + pub fn build_lib(name: &str) -> CargoResult { println!("building library: {}", name); - let cfg = cargo::util::config::Config::default()?; + let cfg = configure_cargo()?; let mut opts = cargo::ops::CompileOptions::new(&cfg, CompileMode::Build) .expect("failed to get compile options"); @@ -49,7 +56,7 @@ pub fn build_lib(name: &str) -> CargoResult { pub fn build_bin(name: &str) -> CargoResult { println!("building binary: {}", name); - let cfg = cargo::util::config::Config::default()?; + let cfg = configure_cargo()?; let mut opts = cargo::ops::CompileOptions::new(&cfg, CompileMode::Build) .expect("failed to get compile options");