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

Add unix::process::CommandExt::arg0 #66512

Merged
merged 1 commit into from
Nov 25, 2019
Merged

Conversation

jsgf
Copy link
Contributor

@jsgf jsgf commented Nov 18, 2019

This allows argv[0] to be overridden on the executable's command-line. This also makes the program
executed independent of argv[0].

Does Fuchsia have the same semantics? I'm assuming so.

Addresses: #66510

@rust-highfive
Copy link
Collaborator

r? @sfackler

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 18, 2019
@sfackler
Copy link
Member

Seems reasonable - r=me once the comments are resolved.

@jsgf
Copy link
Contributor Author

jsgf commented Nov 19, 2019

@sfackler OK I removed the stray #![allow(stable_features)] which was the only actionable comment.

@Centril
Copy link
Contributor

Centril commented Nov 19, 2019

Thanks; @bors r=sfackler

@bors
Copy link
Contributor

bors commented Nov 19, 2019

📌 Commit 3de7bd2 has been approved by sfackler

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 19, 2019
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Nov 19, 2019
Add unix::process::CommandExt::arg0

This allows argv[0] to be overridden on the executable's command-line. This also makes the program
executed independent of argv[0].

Does Fuchsia have the same semantics? I'm assuming so.

Addresses: rust-lang#66510
bors added a commit that referenced this pull request Nov 19, 2019
Rollup of 13 pull requests

Successful merges:

 - #66090 (Misc CI improvements)
 - #66239 (Suggest calling async closure when needed)
 - #66430 ([doc] Fix the source code highlighting on source comments)
 - #66431 (Fix 'type annotations needed' error with opaque types)
 - #66461 (Add explanation message for E0641)
 - #66468 (Cleanup Miri SIMD intrinsics)
 - #66478 (rustc_plugin: Remove the compatibility shim)
 - #66493 (Add JohnTitor to rustc-guide toolstate notification list)
 - #66511 (std::error::Chain: remove Copy)
 - #66512 (Add unix::process::CommandExt::arg0)
 - #66520 (Disable gdb pretty printer global section on wasm targets)
 - #66529 (resolve: Give derive helpers highest priority during resolution)
 - #66536 (Move the definition of `QueryResult` into `plumbing.rs`.)

Failed merges:

r? @ghost
@Centril
Copy link
Contributor

Centril commented Nov 19, 2019

Failed in #66542 (comment), @bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 19, 2019
@jsgf
Copy link
Contributor Author

jsgf commented Nov 19, 2019

Imports fixed for Fuchsia.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-19T17:44:20.9231282Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-19T17:44:20.9436633Z ##[command]git config gc.auto 0
2019-11-19T17:44:20.9500930Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-19T17:44:20.9550485Z ##[command]git config --get-all http.proxy
2019-11-19T17:44:20.9711268Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66512/merge:refs/remotes/pull/66512/merge
---
2019-11-19T17:51:21.2813698Z   local time: Tue Nov 19 17:51:21 UTC 2019
2019-11-19T17:51:21.5583602Z   network time: Tue, 19 Nov 2019 17:51:21 GMT
2019-11-19T17:51:21.5588291Z == end clock drift check ==
2019-11-19T17:51:24.4697678Z 
2019-11-19T17:51:24.4817011Z ##[error]Bash exited with code '1'.
2019-11-19T17:51:24.4846772Z ##[section]Starting: Checkout
2019-11-19T17:51:24.4860165Z ==============================================================================
2019-11-19T17:51:24.4860243Z Task         : Get sources
2019-11-19T17:51:24.4860297Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

This allows argv[0] to be overridden on the executable's command-line. This also makes the program
executed independent of argv[0].

Does Fuchsia have the same semantics?

Addresses: rust-lang#66510
@jsgf
Copy link
Contributor Author

jsgf commented Nov 19, 2019

Now actually fixed.

@jsgf
Copy link
Contributor Author

jsgf commented Nov 21, 2019

@Centril, @sfackler I think this is unblocked now.

@Dylan-DPC-zz Dylan-DPC-zz added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 24, 2019
@Dylan-DPC-zz
Copy link

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 24, 2019

📌 Commit 6dee1a5 has been approved by Dylan-DPC

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 24, 2019
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 24, 2019
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Nov 25, 2019
Add unix::process::CommandExt::arg0

This allows argv[0] to be overridden on the executable's command-line. This also makes the program
executed independent of argv[0].

Does Fuchsia have the same semantics? I'm assuming so.

Addresses: rust-lang#66510
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Nov 25, 2019
Add unix::process::CommandExt::arg0

This allows argv[0] to be overridden on the executable's command-line. This also makes the program
executed independent of argv[0].

Does Fuchsia have the same semantics? I'm assuming so.

Addresses: rust-lang#66510
bors added a commit that referenced this pull request Nov 25, 2019
Rollup of 7 pull requests

Successful merges:

 - #65613 (Preserve whitespace inside one-backtick codeblocks)
 - #66512 (Add unix::process::CommandExt::arg0)
 - #66569 (GitHub Actions: preparations, part 1)
 - #66678 (Remove useless line for error index generation)
 - #66684 (Drive-by cleanup in region naming)
 - #66694 (Add some comments to panic runtime)
 - #66698 (tidy: Remove unused import)

Failed merges:

r? @ghost
@bors bors merged commit 6dee1a5 into rust-lang:master Nov 25, 2019
@jsgf jsgf deleted the process-argv0 branch November 25, 2019 23:45
@reitermarkus
Copy link
Contributor

reitermarkus commented Dec 7, 2019

As noticed in cross-rs/cross#357, this changed Debug to output the program name twice for the default case. Would it make sense to only output both program and arg0 if they differ?

@jsgf
Copy link
Contributor Author

jsgf commented Dec 7, 2019

I'll take a look.

@jsgf
Copy link
Contributor Author

jsgf commented Dec 7, 2019

@reitermarkus That issue doesn't seem at all related?

@reitermarkus
Copy link
Contributor

Seems like the 7 got deleted at the end of the link.

jsgf added a commit to jsgf/rust that referenced this pull request Dec 16, 2019
PR rust-lang#66512 added the ability to set argv[0] on
Command. As a side effect, it changed the Debug output to print both the program and
argv[0], which in practice results in stuttery output ("echo echo foo").

This PR reverts the behaviour to the the old one, so that the command is only printed
once - unless arg0 has been set. In that case it emits "[command] arg0 arg1 ...".
Centril added a commit to Centril/rust that referenced this pull request Dec 20, 2019
…plett

Fix up Command Debug output when arg0 is specified.

PR rust-lang#66512 added the ability to set argv[0] on
Command. As a side effect, it changed the Debug output to print both the program and
argv[0], which in practice results in stuttery output (`"echo" "echo" "foo"`).

This PR reverts the behaviour to the the old one, so that the command is only printed
once - unless arg0 has been set. In that case it emits `"[command]" "arg0" "arg1" ...`.
Centril added a commit to Centril/rust that referenced this pull request Dec 20, 2019
…plett

Fix up Command Debug output when arg0 is specified.

PR rust-lang#66512 added the ability to set argv[0] on
Command. As a side effect, it changed the Debug output to print both the program and
argv[0], which in practice results in stuttery output (`"echo" "echo" "foo"`).

This PR reverts the behaviour to the the old one, so that the command is only printed
once - unless arg0 has been set. In that case it emits `"[command]" "arg0" "arg1" ...`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants