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

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

Closed
dilyanpalauzov opened this issue Aug 16, 2024 · 16 comments
Closed
Assignees
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@dilyanpalauzov
Copy link

dilyanpalauzov commented Aug 16, 2024

With rust 1.80 ./configure --help prints:

        --enable-docs                  build standard library documentation 

This means, that by default the standard librarly documentation is not built, but with this option it can be turned on.

However, 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.
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 16, 2024
@jieyouxu jieyouxu added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Aug 16, 2024
@lolbinarycat lolbinarycat added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Sep 5, 2024
@saksham-agarwal-dev
Copy link

@rustbot claim

@saksham-agarwal-dev
Copy link

print('') print('This configure script is a thin configuration shim over the true') print('configuration system,config.toml. You can explore the comments') print('in config.example.tomlnext to this configure script to see') print('more information about what each option is. Additionally you can') print('pass--setas an argument to set arbitrary key/value pairs') print('in the TOML configuration if desired') print('') print('Also note that all options which take--enablecan similarly') print('be passed with--disable-footo forcibly disable the option')

Right after printing the --enable-docs, there is also this disclaimer.

I am a first-time contributor to Rust.
Should I add some conditional logic for checking what the default value for that option is and printing --enable-{} or --disable-{} based on that default?

Thanks for the guidance.

@arin-r
Copy link

arin-r commented Sep 8, 2024

Should I add some conditional logic for checking what the default value for that option is and printing --enable-{} or --disable-{} based on that default?

I believe default option for building docs is true, that is, documentation is built by default.

@saksham-agarwal-dev
Copy link

Hi, I got that.
My question was whether should I add some conditional logic to check if the default value for any given option is true or false.
Right now, the script doesn't care if something is enabled or disabled by default, it only prints --enable-{option}.

I am thinking we need to somehow get the default values for each option and print --enable or --disable accordingly.

@saksham-agarwal-dev
Copy link

#130125

@onur-ozkan
Copy link
Member

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.

This will still be a problem in the future. I'm sure there are other unsynced flags in configure --help. We should probably change how we write the helper docs. Instead of printing enable-$option, we should make it clearer that users can control options with enable and disable.

@onur-ozkan onur-ozkan added E-help-wanted Call for participation: Help is requested to fix this issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Sep 22, 2024
@dilyanpalauzov
Copy link
Author

Instead of printing enable-$option, we should make it clearer that users can control options with enable and disable.

--help should indicate what is the default and how to change it. Currently it does not say what the default is.

@onur-ozkan
Copy link
Member

--help should indicate what is the default and how to change it.

What makes you think that?

@dilyanpalauzov
Copy link
Author

All --help output of autoconf, etc. should work in similar way. As the output is short, for each option there should be indication what the default is (static, auto=or depends on parameters discovered while running the configure-script). And it should indicate how to change the default. Obviously there is no point to pass parameters, which trigger anyway the default behaviour and the output of --help should suggest only how to deviate from the defaults, not how to keep the defaults.

@onur-ozkan
Copy link
Member

configure is nothing like autoconf. It's just a wrapper for this python script and most default (as some of them defined in config profiles) values are managed by the rust side bootstrap. We can't display default values in the configure script because it's a different program and it's not possible until we remove the python programs and handle everything from single program (which is our plan). Until then, I think this should be useful enough.

@saksham-agarwal-dev
Copy link

@rustbot release-assignment

@AvatarSenju
Copy link
Contributor

@rustbot claim

@AvatarSenju
Copy link
Contributor

raised PR #131117 taking @onur-ozkan suggestion of updating the helper docs till python wrapper is deprecated.

bors added a commit to rust-lang-ci/rust that referenced this issue Oct 2, 2024
…zkan

Update helper docs display disable option

Updated helper docs via configure.py to make it clearer that users can control options with enable and disable
Fixing issue rust-lang#129146
@jieyouxu
Copy link
Member

Fixed by #131117.

@dilyanpalauzov
Copy link
Author

The problem report here is, that --help does not indicate, if a feature is by default on or off. In turn it does not show how to deviate from the default (and suppress information how to enforce the default).

#131117 is not a fix to the problem addressed here. If you are not willing to show on --help what the defaults are, if no parameters are passed, is a different story.

I wrote an article on whether to print --enable-M or --disable-M on --help : https://ab.bapha.be/posts/help-output/.

@jieyouxu jieyouxu reopened this Oct 16, 2024
@onur-ozkan
Copy link
Member

This is not a valid issue anymore, please open another one if you think --help behaviour should be different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. 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

8 participants