-
Notifications
You must be signed in to change notification settings - Fork 21
main_binary
and cargo_binary
fail with Environment::empty
#51
Comments
I think this is a reasonable limitation, I just wanted to ensure it is noted somewhere. So ways I see forward for this
|
Good point! Let's add a test for these cases! I think we are only testing
with shell internal commands (printenv) currently. That's obviously not
good enough. (Okay if these tests are skipped with a comment as they are
failing for now.)
To solve this: Can we just run `which cargo` in the constructor and run the
command with the full path to cargo?
Ed Page <notifications@github.com> schrieb am Fr. 13. Okt. 2017 um 02:53:
… I think this is a reasonable limitation, I just wanted to ensure it is
noted somewhere.
So ways I see forward for this
- Rejecting it with label wontfix
- Noting the limitation somewhere (an example workaround?) and closing
this out with that (maybe still with a label wontfix).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABOXw8hRk0mv2sZA92K1Ju7NUhped47ks5srrR9gaJpZM4P30-W>
.
|
Yep if we wipe out the env we don't have access to the PATH. Do we have a simple workaround? Saving the CARGO_* variables? |
We'd have to keep in mind support for both Windows and Linux
I was thinking of contributing to The main question is what the API should look like. As |
Just to confirm that I expected the Previously, I used to use https://doc.rust-lang.org/1.1.0/std/process/struct.Command.html#method.env - where:
The usage there is just to append to the inherited environment variables, not to totally clear them. I find the fact that |
To not detract from the discussion in this thread, I opened #58 |
I don't know if this is new, but the cargo docs say that cargo sets the |
Thanks for looking into this!
Sounds like it is literally the EDIT: Oh. right, that'd still allow us to delegate to cargo for running the binary |
FWIW, I used |
I gave running |
Yeah, cargo first looks for rustc in the If you unset |
Here is an alternative approach to finding the test binary I suspect it won't work with skeptic which runs examples in a tmp directory |
Apropos skeptic: Do we still have problems with that? I recently rediscovered |
That could be a real nice way to avoid the skeptic problems.
The downside to running the README like that is it won't be in people's regular workflow. On the otherhand, the README should probably be light on examples anyways and the CI should be sufficient. |
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`.
Addressed in assert_cmd |
cargo
can't be found because it is no longer in the path.The text was updated successfully, but these errors were encountered: