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

Incorrect description of environment variables in rustc man pages #59504

Closed
mulkieran opened this issue Mar 28, 2019 · 6 comments · Fixed by #59666
Closed

Incorrect description of environment variables in rustc man pages #59504

mulkieran opened this issue Mar 28, 2019 · 6 comments · Fixed by #59666
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@mulkieran
Copy link

mulkieran commented Mar 28, 2019

Here it is:

ENVIRONMENT
       Some of these affect the output of the compiler,  while  others  affect
       programs which link to the standard library.

       RUST_TEST_THREADS
              The  test  framework  Rust  provides executes tests in parallel.
              This variable sets the maximum number of threads used  for  this
              purpose.  This  setting  is  overridden  by  the  --test-threads
              option.

       RUST_TEST_NOCAPTURE
              If set to a value other than "0", a synonym for the  --nocapture
              flag.

       RUST_MIN_STACK
              Sets the minimum stack size for new threads.

       RUST_BACKTRACE
              If  set  to  a value different than "0", produces a backtrace in
              the output of a program which panics.

I believe that the line here is incorrect

"Some of these affect the output of the compiler, while others affect
programs which link to the standard library."

since I believe none of these variables affect the output of the compiler.

Why is this a problem? Well, the logical reader might say to themselves:
" "Some" means at least 1. It makes very little sense for the top three to affect the output of the compiler. Therefore it must be the bottom one, RUST_BACKTRACE, which affects the output of the compiler."

@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Mar 28, 2019
@jonas-schievink
Copy link
Contributor

I think "the output" should just be removed here - RUST_BACKTRACE applies to both rustc and binaries produced by it, for example.

@pnkfelix
Copy link
Member

pnkfelix commented Mar 29, 2019

First, I do agree the phrase "the output of the compiler" is suboptimal, since it can be taken to mean the diagnostics emitted to stdout or other files it generates, while the original intent here (I think) is for the word "output" to denote the behavior of the binary generated by the compiler.

Second, while saying "Some of these affect the compiler, ..." would be technically correct, I think it would be misleading.

In particular, I personally would read the phase "RUST_BACKTRACE affects the compiler", at least initially, as meaning that the environment variable only matters during execution of the compiler itself, which is the opposite of what we want to convey.

How about:

Some of these affect only test harness programs (generated via rustc --test); others affect
all programs which link to the Rust standard library.
Note that rustc itself is an example of a program linked to the Rust standard library.

(I'm actually not particularly wedded to that second sentence. I would not mind if it were omitted.)

@mulkieran
Copy link
Author

Thanks, @pnkfelix. Now that you point it out I realize that the problem with the problematic statement is not that it is wrong, so much as that it is entirely ambiguous and that when reading it it is easy to choose the wrong, that is unintended, meaning.

Your suggested wording works for me.

@DevQps
Copy link
Contributor

DevQps commented Mar 29, 2019

First, I do agree the phrase "the output of the compiler" is suboptimal, since it can be taken to mean the diagnostics emitted to stdout or other files it generates, while the original intent here (I think) is for the word "output" to denote the behavior of the binary generated by the compiler.

Second, while saying "Some of these affect the compiler, ..." would be technically correct, I think it would be misleading.

In particular, I personally would read the phase "RUST_BACKTRACE affects the compiler", at least initially, as meaning that the environment variable only matters during execution of the compiler itself, which is the opposite of what we want to convey.

How about:

Some of these affect only test harness programs (generated via rustc --test); others affect
all programs which link to the Rust standard library.
Note that rustc itself is an example of a program linked to the Rust standard library.

(I'm actually not particularly wedded to that second sentence. I would not mind if it were omitted.)

I think the extra note on the end is likely to make things more confusing. So keeping it to only the first part of your suggestion is the best I think!:

Some of these affect only test harness programs (generated via rustc --test); others affect
all programs which link to the Rust standard library.

If you want I could create a PR for this?

@mulkieran
Copy link
Author

mulkieran commented Apr 3, 2019

@DevQps I'ld be fine w/ that wording as well.

@DevQps
Copy link
Contributor

DevQps commented Apr 3, 2019

@mulkieran I created a PR for you here!

Centril added a commit to Centril/rust that referenced this issue Apr 3, 2019
…criptions, r=GuillaumeGomez

Updated the environment description in rustc.

# Description

- Updated the "environment" description in the `rustc` man pages

The old wording suggested that all the mentioned flags influenced the output of the compiler,
where this was not the case.

closes rust-lang#59504
Centril added a commit to Centril/rust that referenced this issue Apr 3, 2019
…criptions, r=GuillaumeGomez

Updated the environment description in rustc.

# Description

- Updated the "environment" description in the `rustc` man pages

The old wording suggested that all the mentioned flags influenced the output of the compiler,
where this was not the case.

closes rust-lang#59504
Centril added a commit to Centril/rust that referenced this issue Apr 3, 2019
…criptions, r=GuillaumeGomez

Updated the environment description in rustc.

# Description

- Updated the "environment" description in the `rustc` man pages

The old wording suggested that all the mentioned flags influenced the output of the compiler,
where this was not the case.

closes rust-lang#59504
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants