Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dont require frozen or locked cargo #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions integration-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@ use cargo::core::compiler::{Compilation, CompileMode};
use cargo::util::errors::CargoResult;
use postgres::Connection;

fn configure_cargo() -> CargoResult<cargo::Config> {
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<PathBuf> {
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");
Expand Down Expand Up @@ -49,7 +56,7 @@ pub fn build_lib(name: &str) -> CargoResult<PathBuf> {

pub fn build_bin(name: &str) -> CargoResult<PathBuf> {
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");
Expand Down