Skip to content

rustbuild: Use Cargo's "target runner" #43534

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

Merged
merged 1 commit into from
Jul 29, 2017

Conversation

alexcrichton
Copy link
Member

This commit leverages a relatively new feature in Cargo to execute
cross-compiled tests, the target.$target.runner configuration. We configure it
through environment variables in rustbuild and this avoids the need for us to
locate and run tests after-the-fact, instead relying on Cargo to do all that
execution for us.

@rust-highfive
Copy link
Contributor

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

r? @Mark-Simulacrum

Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to see code being moved into cargo.

@@ -1418,7 +1418,8 @@ mod tests {

for (ref k, ref v) in env::vars() {
// don't check android RANDOM variables
if cfg!(target_os = "android") && *k == "RANDOM" {
if cfg!(target_os = "android") &&
(*k == "RANDOM" || k.contains("-")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like it's including lots of environment variables from android systems, no? I'd definitely want a comment here..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh oops right forgot to mention this, I'll add a comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW environment variables with - is pretty rare (most have _) and I'm just sort of randomly chalking this up to a bug in the set command which we're using to learn about environment variables.

This commit leverages a relatively new feature in Cargo to execute
cross-compiled tests, the `target.$target.runner` configuration. We configure it
through environment variables in rustbuild and this avoids the need for us to
locate and run tests after-the-fact, instead relying on Cargo to do all that
execution for us.
@alexcrichton
Copy link
Member Author

Updated!

@alexcrichton alexcrichton force-pushed the cargo-target-runner branch from 5529a72 to 8e7849e Compare July 29, 2017 01:00
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally missed that the changes to android where in a test. I think it's much clearer with the comment, though. Thanks!

@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 29, 2017

📌 Commit 8e7849e has been approved by Mark-Simulacrum

@bors
Copy link
Collaborator

bors commented Jul 29, 2017

⌛ Testing commit 8e7849e with merge ad36f8f...

bors added a commit that referenced this pull request Jul 29, 2017
…acrum

rustbuild: Use Cargo's "target runner"

This commit leverages a relatively new feature in Cargo to execute
cross-compiled tests, the `target.$target.runner` configuration. We configure it
through environment variables in rustbuild and this avoids the need for us to
locate and run tests after-the-fact, instead relying on Cargo to do all that
execution for us.
@bors
Copy link
Collaborator

bors commented Jul 29, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: Mark-Simulacrum
Pushing ad36f8f to master...

@bors bors merged commit 8e7849e into rust-lang:master Jul 29, 2017
@alexcrichton alexcrichton deleted the cargo-target-runner branch August 22, 2017 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants