-
Notifications
You must be signed in to change notification settings - Fork 21
Conversation
This switches us from using `cargo run` to `cargo build`, reading where the binary is placed, and callin that instead. Fixes assert-rs#95 because the user changing the `CWD` doesn't impact `cargo build`. Fixes assert-rs#79 because there is no `cargo` output when capturing the user's stdout/stderr. Fixes assert-rs#51 because the user changing the environment doesn't impact `cargo build`. This is a step towards working around assert-rs#100 because we can allow a user to cache the result of `cargo build`.
filenames: Vec<&'a str>, | ||
} | ||
|
||
fn filenames(msg: cargo::Message, kind: &str) -> Option<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve name
].into_iter() | ||
.map(OsString::from) | ||
.collect(), | ||
pub fn main_binary() -> Result<Self, failure::Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a proper error for this and related functions
const CURRENT_TARGET: &str = include_str!(concat!(env!("OUT_DIR"), "/current_target.txt")); | ||
|
||
#[derive(Debug)] | ||
pub struct Cargo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new file is generating a lot of warnings from unused code.
I developed more than I'd need. I plan to eventually split this out into is own crate. It'll be reused by stager
and other tools I'm working on that need to run cargo
programmatically but don't want to link against cargo
(slow to build, . This was a testing ground for the idea.
This is superseded by https://github.com/assert-rs/assert_cmd |
This switches us from using
cargo run
tocargo build
, reading wherethe binary is placed, and callin that instead.
Fixes #95 because the user changing the
CWD
doesn't impactcargo build
.Fixes #79 because there is no
cargo
output when capturing the user'sstdout/stderr.
Fixes #51 because the user changing the environment doesn't impact
cargo build
.This is a step towards working around #100 because we can allow a user
to cache the result of
cargo build
.