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

Use std::process::Command throughout compile-test #43798

Closed
wants to merge 7 commits into from

Conversation

euclio
Copy link
Contributor

@euclio euclio commented Aug 11, 2017

Fixes #43762.

r? @alexcrichton

Fixed up what didn't require a major refactor. I'd like to remove ProcArgs, but there's no way to get the current program name and args from a Command builder.

  • What do you think about compose_and_run? I wonder if we could simplify that.
  • Still a little unhappy with the number of expects in the output. Maybe it's worth threading the errors up through.

}

fn compose_and_run(&self,
ProcArgs{ args, prog }: ProcArgs,
procenv: Vec<(String, String)> ,
mut command: Command,
lib_path: &str,
aux_path: Option<&str>,
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if maybe we could remove these arguments as well? It looks like not all tests need to pass this so we could have a helper which works with these variables and otherwise these aren't passed and the helper isn't called when not needed.

}

fn compose_and_run(&self,
ProcArgs{ args, prog }: ProcArgs,
procenv: Vec<(String, String)> ,
mut command: Command,
Copy link
Member

Choose a reason for hiding this comment

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

One thing that may be worth testing is to take &mut Command here instead of Command. I'm not 100% sure which is more ergonomic, though!

};

// FIXME (#9639): This needs to handle non-utf8 paths
Copy link
Member

Choose a reason for hiding this comment

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

Great to see all these FIXME annotations removed!

@alexcrichton
Copy link
Member

This looks great to me, thanks!

We can always delegate future refactorings to later PRs, this seems great enough to land in the meantime.

@euclio
Copy link
Contributor Author

euclio commented Aug 11, 2017

Great. Happy to address the comments in the future.

@shepmaster shepmaster added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 11, 2017
@alexcrichton
Copy link
Member

Oh so to be clear, @euclio mind trying to remove the aux_path argument from the compose_and_run function before landing? Working with Command vs &mut Command doesn't necessarily have to block this.

@euclio
Copy link
Contributor Author

euclio commented Aug 11, 2017

Ah, sorry for the misunderstanding. I'll see if I can find the time this weekend.

@euclio
Copy link
Contributor Author

euclio commented Aug 14, 2017

Which invocations actually need the library path munging? Just rustc?

@alexcrichton
Copy link
Member

Oh I figured we'd just preserve the existing behavior which is that wherever Some is passed we continue to munge the search path, I don't think it's just rustc but also the test binaries themselves.

@bors
Copy link
Contributor

bors commented Aug 16, 2017

☔ The latest upstream changes (presumably #43710) made this pull request unmergeable. Please resolve the merge conflicts.

@euclio
Copy link
Contributor Author

euclio commented Aug 16, 2017

@alexcrichton Ok, do the commands ever need just "" added to their search path? I was a little wary of doing this because I wasn't sure how to tell which invocations required an empty path in the library path.

@euclio
Copy link
Contributor Author

euclio commented Aug 16, 2017

In other words I'm wondering if there are any invocations that have a None aux path and still need their path munged to include an empty path.

@euclio euclio closed this Aug 16, 2017
@alexcrichton
Copy link
Member

@euclio did you mean to close this? I don't think anything needs "" added to the search path, but that's just my hope sort of!

If this takes awhile to do though I don't want to block this! I'm fine landing this ahead of time if you'd like to take some more time to game out that change.

@euclio
Copy link
Contributor Author

euclio commented Aug 16, 2017

Ah, whoops! Reopened.

So, I think there's still a little question on how to handle the make_cmdline function if we remove the libpath argument, and I'd like to take the time to experiment with it. I'd rather land this now and fix it up later since this rebase is no fun.

@euclio
Copy link
Contributor Author

euclio commented Aug 16, 2017

Ugh, looks like my rebase borked the branch. Will reopen shortly.

@alexcrichton
Copy link
Member

Ok sounds good to me! Feel free to cc me on the new PR and I'll r+

bors added a commit that referenced this pull request Aug 24, 2017
Use std::process::Command throughout compile-test

Resubmission of #43798.

Fixes #43762.

r? @alexcrichton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants