Skip to content

./configure --help should print --disable-docs instead of --enable-docs #131883

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

Closed
dilyanpalauzov opened this issue Oct 18, 2024 · 6 comments
Closed
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@dilyanpalauzov
Copy link

dilyanpalauzov commented Oct 18, 2024

With rust 1.82 ./configure --help prints:

        --enable-docs  OR  --disable-docs build standard library documentation

This does not indicate if the docs for the standard library will be built if the argument is omitted. If the --help output was

        --disable-docs                  do not build standard library documentation 

this would have suggested, that by default the documentation is built. Cf. https://ab.bapha.be/posts/help-output/)

config.example.toml contains

# Whether to build documentation by default. If false, rustdoc and
# friends will still be compiled but they will not be used to generate any
# documentation.
#
# You can still build documentation when this is disabled by explicitly passing paths,
# e.g. `x doc library`.
#docs = true

For me the last line means, that by default the documentation is build. Indeed, ./configure --disable-docs puts in config.toml: docs = false.

  • Change the output of ./configure --help from --enable-docs to --disable-docs to indicate what actions users should take in order to deviate from the default behaviour.

See also #129146.

@dilyanpalauzov dilyanpalauzov added the C-bug Category: This is a bug. label Oct 18, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 18, 2024
@jieyouxu jieyouxu added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-discussion Category: Discussion or questions that doesn't represent real issues. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 19, 2024
@clubby789
Copy link
Contributor

clubby789 commented Oct 19, 2024

The description was copypasted from the previous issue, so I've updated it to be accurate to the current situation. I'm also going to remove the bug label since this is consistent across all enable/disable options, and this is more a discussion of style.

This would require refactoring configure.py to parse the example config first in order to accurately print the defaults.

@clubby789 clubby789 removed the C-bug Category: This is a bug. label Oct 19, 2024
@onur-ozkan
Copy link
Member

The title still doesn't make any sense. Please write the context clearly before opening this or any other issues.

@onur-ozkan onur-ozkan closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2024
@dilyanpalauzov
Copy link
Author

I asked at #129146 to show in ./configure --help for each option, what the default is, if the option is not passed. This was misinterpreted to instead demonstrate, that for each option --disable- can be used, next to --enable-, and moreover I was discouraged to explain in the same ticket what I meant when opening the ticket.

The context is, that I do not want to see, when reading ./configure --help which options I can pass, if passing that particular option does not alter the behaviour anyhow. E.g. ./configure and ./configure --enable-docs do the same, so the help should not spell --enable-docs. Likewise for the other options.

@PatchMixolydic
Copy link
Contributor

Please write the context clearly

The context seems pretty clear to me:

./configure --help should print --disable-docs instead of --enable-docs

because

With rust 1.82 ./configure --help prints:

   --enable-docs  OR  --disable-docs build standard library documentation

This does not indicate if the docs for the standard library will be built if the argument is omitted. If the --help output was

   --disable-docs                  do not build standard library documentation 

this would have suggested, that by default the documentation is built. Cf. https://ab.bapha.be/posts/help-output/)

Shoehorning the entirety of an issue's context into its title has never been a requirement afaict, but a possible alternate title might be "./configure --help should print --disable-* when the default is to --enable-*, and vice-versa". (You could add in a concrete example, explain that this is to elucidate the actual options you have vs. the default configuration, etc., but that would cause the title to balloon in size.)

@onur-ozkan
Copy link
Member

The context seems pretty clear to me:

./configure --help should print --disable-docs instead of --enable-docs

$ ./configure --help | rg docs
        --enable-docs  OR  --disable-docs build standard library documentation

We don't just display --enable-docs alone and the configure script doesn't work like "this option is false, so set it to true". If you want to see default values, you should refer to config.example.toml file. As I explained here, it's technically not possible for configure script to do what you are asking. There's also another limitation: we don't have a single default value all the time. The default values depend on other options, and when you run the configure script, those other options haven't been set yet.

@dilyanpalauzov
Copy link
Author

We don't just display --enable-docs alone and the configure script doesn't work like "this option is false, so set it to true".

That is the point of this ticket: I asked to change how the configure script works.

There's also another limitation: we don't have a single default value all the time.

This is fine. Then the default value is “check/auto/depends”, and ./configure --help can show it. But in case of some options, like docs, there is a single default value.

Not very relevant, but to be precise, with rust-1.82 ./configure --help does print:

    --enable-docs                  build standard library documentation

as I wrote initially, and it does not emit:

    --enable-docs  OR  --disable-docs build standard library documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

6 participants